Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Update mini-gdbstub and the corresponding API #129

Merged
merged 1 commit into from
May 14, 2023

Conversation

RinHizakura
Copy link
Collaborator

It is possible that a GDB user will query an access for invalid register or memory address. In such case, GDBstub should respond E NN (where NN is an errno) for the error. However, both the original implementations of mini-gdbstub and rv32emu just simply assume that those operations will always succeed, which may lead to some annoying problems. For example, a segmentation fault happens on the emulator when we request to read a memory chunk that our emulator didn't write before yet. For this reason, this patch updates the library mini-gdbstub and the implementation of rv32emu itself to make debug mode experience on rv32emu better.

By the way, it is worth noting that running the command make gdbstub-test will have a fail result. But this is not caused by this patch, because it seems to be broken on the main branch for a long time :(. I'll fix this in other patches and maybe we should run make gdbstub-test in CICD in the future to make sure it always runs correctly.

Comment on lines +55 to +57
/* FIXME: This is implemented as a simple workaround for reading
* an invalid address. We may have to do error handling in the
* mem_read_* function directly. */

Check notice

Code scanning / CodeQL

FIXME comment

FIXME comment: This is implemented as a simple workaround for reading \[...\]
@jserv
Copy link
Contributor

jserv commented May 14, 2023

By the way, it is worth noting that running the command make gdbstub-test will have a fail result. But this is not caused by this patch, because it seems to be broken on the main branch for a long time.

Thanks for pointing this. Please improve CI pipeline for gdbstub coverage.

@jserv jserv merged commit 3ef3da7 into sysprog21:master May 14, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants