Merge pull request #134 from Redouane555/master
Fixed peda.getpid() when debugging remote processes: drop the code supports very old gdb versions
This commit is contained in:
commit
f76c34d5e0
22
peda.py
22
peda.py
|
@ -421,26 +421,6 @@ class PEDA(object):
|
|||
status = self.get_status()
|
||||
if not status or status == "STOPPED":
|
||||
return None
|
||||
|
||||
if self.is_target_remote(): # remote target
|
||||
ctx = config.Option.get("context")
|
||||
config.Option.set("context", None)
|
||||
try:
|
||||
out = self.execute_redirect("call getpid()")
|
||||
except:
|
||||
pass
|
||||
|
||||
config.Option.set("context", ctx)
|
||||
|
||||
if out is None:
|
||||
return None
|
||||
else:
|
||||
out = self.execute_redirect("print $")
|
||||
if out:
|
||||
return to_int(out.split("=")[1])
|
||||
else:
|
||||
return None
|
||||
|
||||
pid = gdb.selected_inferior().pid
|
||||
return int(pid) if pid else None
|
||||
|
||||
|
@ -3060,7 +3040,7 @@ class PEDACmd(object):
|
|||
"""
|
||||
pid = peda.getpid()
|
||||
if pid is None:
|
||||
text = "not running or target is remote"
|
||||
text = "not running"
|
||||
warning_msg(text)
|
||||
return None
|
||||
#raise Exception(text)
|
||||
|
|
Loading…
Reference in New Issue