Closed lexknuther closed 1 week ago
@lexknuther Yep, we can try-except that. Hadn't occurred to me at least that the stack pointer would be inaccessible. That may cause other problems. I'd be interested in knowing if commenting that line out gets you further and is just the beginning of more badness.
Yeah, I'm still working on the root cause.
I remember doing this for LLDB, but I guess we never did the same for GDB. I concur that somewhere in commands.py we should add the try-catch (as opposed to hooks.py). I'll have to review what we did for the others before I commit to that, though. We do have a mechanism for signalling the app, so that it doesn't try (repeatedly) to re-read the same spot of memory in error. Generally, in the except clause, we do a putmem-state [range] error
, which will paint the region red in the dynamic listing and prevent future attempts to read it automatically. I'll put an internal ticket in for this.
Describe the bug The put_bytes function in command.py doesn't wrap inf.read_memory in a try/except block. As a result, any area of memory that can't be read results in a debugger crash. I discovered this will testing a simple binary for the STM3210E-EVAL board. Wrapping the call in a try/except block and returning an equivalent number of zeros bypasses the problem; however, there should probably be some application level signaling that marks the memory as unreadable.
To Reproduce Steps to reproduce the behavior:
Expected behavior A clear and concise description of what you expected to happen.
Screenshots If applicable, add screenshots to help explain your problem.
Attachments main.c
Environment (please complete the following information):
Additional context
Add any other context about the problem here.