Coder Social home page Coder Social logo

gdb: unrecognised option '--nh' about pyringe HOT 6 CLOSED

google avatar google commented on May 29, 2024
gdb: unrecognised option '--nh'

from pyringe.

Comments (6)

TehMillhouse avatar TehMillhouse commented on May 29, 2024

Of all the flags that are given to gdb, I wouldn't have expected --nh to be a problem on other distros. For the time being, could you try the following for starting the debugger:

import pyringe
pyringe.inferior._GDB_ARGS.remove('--nh')
pyringe.interact()

I'll try to think of a generic way to get this to work, in the meantime, knowing which flags cause problems on some distros will help.

from pyringe.

andrewmichaelsmith avatar andrewmichaelsmith commented on May 29, 2024

Thanks, that workaround did the trick. I'll try it on some other distros and let you know if I come across any more.

from pyringe.

mckelvin avatar mckelvin commented on May 29, 2024

I come across the same issue, but the trick does not works.

In [1]: import pyringe

In [2]: pyringe.inferior._GDB_ARGS
Out[2]: ['gdb', '--nh', '--nw', '--quiet', '--batch-silent']

In [3]: pyringe.inferior._GDB_ARGS.remove('--nh')

In [4]: pyringe.interact()
Pyringe (Python 2.7.5) on linux2
For a list of debugger commands, try "help()". (python's help is available as pyhelp.)
==> pid:[None] #threads:[0] current thread:[None]
In : attach(10987)
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/home/username/.local/lib64/python2.7/site-packages/pyringe/repl.py", line 157, in Attach
    self.inferior.Reinit(pid)
  File "/home/username/.local/lib64/python2.7/site-packages/pyringe/inferior.py", line 418, in Reinit
    self.__init__(pid, auto_symfile_loading)
  File "/home/username/.local/lib64/python2.7/site-packages/pyringe/inferior.py", line 390, in __init__
    self.StartGdb()
  File "/home/username/.local/lib64/python2.7/site-packages/pyringe/inferior.py", line 437, in StartGdb
    self._gdb.Attach(self.position)
  File "/home/username/.local/lib64/python2.7/site-packages/pyringe/inferior.py", line 181, in <lambda>
    return lambda *args, **kwargs: self._Execute(name, *args, **kwargs)
  File "/home/username/.local/lib64/python2.7/site-packages/pyringe/inferior.py", line 277, in _Execute
    result_string = self._Recv(timeout)
  File "/home/username/.local/lib64/python2.7/site-packages/pyringe/inferior.py", line 362, in _Recv
    raise ProxyError(exc_text)
ProxyError:
-----------------------------------
Error occurred within GdbService:
  File "/home/username/.local/lib64/python2.7/site-packages/pyringe/payload/gdb_service.py", line 652, in <module>
    serv.EvalLoop()
  File "/home/username/.local/lib64/python2.7/site-packages/pyringe/payload/gdb_service.py", line 274, in EvalLoop
    while self._AcceptRPC():
  File "/home/username/.local/lib64/python2.7/site-packages/pyringe/payload/gdb_service.py", line 293, in _AcceptRPC
    rpc_result = getattr(self, request['func'])(*request['args'])
  File "/home/username/.local/lib64/python2.7/site-packages/pyringe/payload/gdb_service.py", line 429, in Attach
    self.selected_tstate = self._ThreadPtrs(pos)[0]
  File "/home/username/.local/lib64/python2.7/site-packages/pyringe/payload/gdb_service.py", line 454, in _ThreadPtrs
    self.EnsureGdbPosition(position[0], None, None)
  File "/home/username/.local/lib64/python2.7/site-packages/pyringe/payload/gdb_service.py", line 333, in EnsureGdbPosition
    if not self.IsAttached():
  File "/home/username/.local/lib64/python2.7/site-packages/pyringe/payload/gdb_service.py", line 366, in IsAttached
    inf = gdb.selected_inferior()
AttributeError: 'module' object has no attribute 'selected_inferior'

GNU gdb (Gentoo 7.3.1 p2) 7.3.1
Linux hostname 3.0.36-gentoo

from pyringe.

TehMillhouse avatar TehMillhouse commented on May 29, 2024

@mckelvin Your issue seems to be a different one. Digging in the gdb release schedule and the gdb changelog (first copy I could find online, search for the patch "PR Python/12692"), it looks like while python scripting was introduced in gdb 7.3, significant portions of the python API were only added after its release.

I will bump the required version of gdb to 7.4. Try getting a more recent version of gdb, that should fix the issue you're seeing.

from pyringe.

devunt avatar devunt commented on May 29, 2024

--nh flag was introduced in gdb 7.6.1 stable (actually 7.6-1 unstable), but Ubuntu precise's official repo have gdb 7.4

from pyringe.

TehMillhouse avatar TehMillhouse commented on May 29, 2024

@devunt Thanks for tracking this change down. I finally got around to adding a quick version check. Shouldn't be an issue anymore since 8fce35c.

from pyringe.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.