From 2762e079ae1b59b1dff6dfb377b2303ec0f16470 Mon Sep 17 00:00:00 2001 From: Dan <46821332+nsadeveloper789@users.noreply.github.com> Date: Tue, 16 Jun 2026 18:07:24 +0000 Subject: [PATCH] GP-6974: Make ghidragdb's putreg more fault tolerant. --- .../src/main/py/src/ghidragdb/commands.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/py/src/ghidragdb/commands.py b/Ghidra/Debug/Debugger-agent-gdb/src/main/py/src/ghidragdb/commands.py index 376db6d4c5..f6937c3b97 100644 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/py/src/ghidragdb/commands.py +++ b/Ghidra/Debug/Debugger-agent-gdb/src/main/py/src/ghidragdb/commands.py @@ -633,12 +633,15 @@ def putreg(frame: gdb.Frame, reg_descs: Sequence[ # NB: This command will fail if the process is running for desc in reg_descs: v = frame.read_register(desc.name) - rv = mapper.map_value(inf, desc.name, v) - values.append(rv) - # Mapper has converted to big endian. - # Display value should interpret it as such. - value = hex(int.from_bytes(rv.value, byteorder='big')) - cobj.set_value(desc.name, str(value)) + try: + rv = mapper.map_value(inf, desc.name, v) + values.append(rv) + # Mapper has converted to big endian. + # Display value should interpret it as such. + value = hex(int.from_bytes(rv.value, byteorder='big')) + cobj.set_value(desc.name, str(value)) + except Exception as e: + cobj.set_value(desc.name, str(v)) keys.append(desc.name) cobj.retain_values(keys) # TODO: Memorize registers that failed for this arch, and omit later.