Merge pull request #273 from pelrun/fix_segfaults

Fix gdb segfaults due to bypassed locking
This commit is contained in:
Zachary Cutlip 2021-01-29 12:45:45 -08:00 committed by GitHub
commit 9f09c3f20b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -124,7 +124,7 @@ class DebuggerAdaptor(object):
`target_id` is a target ID (or None for the first target) `target_id` is a target ID (or None for the first target)
""" """
try: try:
target = self._target(target_id=target_id) target = self.target(target_id=target_id)
except Exception as e: except Exception as e:
log.error("Exception checking if target exists: {} {}".format(type(e), e)) log.error("Exception checking if target exists: {} {}".format(type(e), e))
return False return False
@ -138,7 +138,7 @@ class DebuggerAdaptor(object):
`target_id` is a target ID (or None for the first target) `target_id` is a target ID (or None for the first target)
""" """
try: try:
target = self._target(target_id=target_id) target = self.target(target_id=target_id)
except: except:
return False return False
return target['state'] != "invalid" return target['state'] != "invalid"
@ -151,7 +151,7 @@ class DebuggerAdaptor(object):
`target_id` is a target ID (or None for the first target) `target_id` is a target ID (or None for the first target)
""" """
try: try:
target = self._target(target_id=target_id) target = self.target(target_id=target_id)
except: except:
raise NoSuchTargetException() raise NoSuchTargetException()
return target['state'] == "running" return target['state'] == "running"
@ -204,7 +204,7 @@ class DebuggerAdaptor(object):
""" """
Disassemble with capstone. Disassemble with capstone.
""" """
target = self._target(target_id) target = self.target(target_id)
if not address: if not address:
pc_name, address = self.pc() pc_name, address = self.pc()