Comments (6)
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.
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.
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.
@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.
--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.
@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)
- attach(): AttributeError: 'module' object has no attribute 'poll' HOT 6
- Python 3 friendly? HOT 3
- Immediate SyntaxError on attach HOT 9
- Pyringe falls over if something (GdbProxy?) reports a non-numeric version HOT 5
- Debug Symbols on Ubuntu HOT 7
- No way to set log level from debugger repl HOT 1
- Failed to automatically load symbol file HOT 1
- syntax error in libpython.py HOT 8
- attach failed HOT 1
- WindowsError: [Error 2] The system cannot find the file specified HOT 3
- attach failed with TimeoutError exception HOT 1
- ModuleNotFoundError: No module named 'inferior' HOT 2
- Git tags missing?
- Fix simple typo: currenly -> currently
- Arch Linux not supported HOT 3
- Fall back to signal injection if symbol info is partial.
- payload directory should be in setup.py as data files, not submodule
- Support for debugging other versions of cpython
- Investigate PyFrame_FastToLocals
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyringe.