Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Override GDB functionality #153

Open
theIDinside opened this issue Dec 14, 2022 · 0 comments
Open

Override GDB functionality #153

theIDinside opened this issue Dec 14, 2022 · 0 comments

Comments

@theIDinside
Copy link
Collaborator

theIDinside commented Dec 14, 2022

Feature TLDR:
The user should be able to set checkpoints and info checkpoints from the debug console in VSCode, by typing checkpoint and info checkpoints

Problem:
We need to override functionality that GDB provides.

For instance, if the user types checkpoint in the debug console, the command will fail, because we are connecting to a GDB Server instance that RR spawns - we don't let RR spawn GDB (like it does when rr replay foo).

Thus, commands like checkpoint and info checkpoints will either fail or return nothing.

Overriding this is fairly easy. Write python functions that calls the RR-GDB-Server implementations commands, and then to .gdb_rrinit; add the re-definitions of the commands info checkpoints and checkpoint.

This is not a Midas problem, but an RR/GDB problem - if a user says from the command line: rr replay foo -s 50505 -k, it will spawn rr and spit something like this out:

$ ./rr replay foo -s 12345 -k
Launch gdb with
  gdb '-l' '10000' '-ex' 'set sysroot /' '-ex' 'target extended-remote 127.0.0.1:12345' /home/cx/.local/share/rr/foo/mmap_hardlink_4_foo

If the user connects using this command, the checkpoint and info checkpoints commands will not work, as GDB will try to perform it's own version of those commands (and fail). The same goes for RR commands like when or when-tid, which are not "native" GDB commands. When RR spawns GDB for the user directly (i.e. on rr replay foo), it injects python code, which overrides these functions.

This is not essential that we implements this, since we have our own UI for setting and restarting checkpoints, however, Midas has a stated goal to be 1-to-1 with the command line, and in this case, even slightly better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant