Merge remote-tracking branch 'origin/GP-6478_d-millar_drgn_bugs--SQUASHED'

This commit is contained in:
Ryan Kurtz
2026-02-25 04:54:39 -05:00
2 changed files with 10 additions and 9 deletions

View File

@@ -271,10 +271,11 @@ def ghidra_trace_create(start_trace: bool = True) -> None:
prog.set_kernel()
elif kind == "coredump":
img = os.getenv('OPT_TARGET_IMG')
if img is not None:
prog.set_core_dump(img)
if '/' in img:
img = img[img.rindex('/')+1:]
if img is None:
return
prog.set_core_dump(img)
if '/' in img:
img = img[img.rindex('/')+1:]
else:
pid = os.getenv('OPT_TARGET_PID')
if pid is not None:
@@ -297,7 +298,7 @@ def ghidra_trace_create(start_trace: bool = True) -> None:
img = prog.main_module().name # type: ignore
util.selected_tid = prog.main_thread().tid
if start_trace and img is not None:
if start_trace:
ghidra_trace_start(img)
PROGRAMS[util.selected_pid] = prog
@@ -1146,7 +1147,7 @@ def put_frames() -> None:
if nproc < 0:
return
nthrd = util.selected_thread()
if nthrd is None:
if nthrd is None or nthrd < 0:
return
thread = prog.thread(nthrd)
if thread is None:

View File

@@ -26,9 +26,9 @@ import drgn.cli
DrgnVersion = namedtuple('DrgnVersion', ['display', 'full'])
selected_pid = 0
selected_tid = 0
selected_level = 0
selected_pid = -1
selected_tid = -1
selected_level = -1
def _compute_drgn_ver() -> DrgnVersion: