Skip to content

Add to output for overridden commands #110

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

Merged
merged 1 commit into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified images/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -762,10 +762,13 @@ fn process_line(app: &mut App, val: &str) {
// gdb::write_mi(&app.gdb_stdin, "-gdb-set target-async on");

let cmd = "-gdb-set mi-async on";
let mut output_lock = app.output.lock().unwrap();
output_lock.push(format!("h> {cmd}"));
gdb::write_mi(&app.gdb_stdin, cmd);

let cmd = "-exec-run";
gdb::write_mi(&app.gdb_stdin, cmd);
output_lock.push(val);

app.input.reset();
return;
Expand All @@ -779,18 +782,24 @@ fn process_line(app: &mut App, val: &str) {
{
let cmd = "-exec-continue";
gdb::write_mi(&app.gdb_stdin, cmd);
let mut output_lock = app.output.lock().unwrap();
output_lock.push(val);

app.input.reset();
return;
} else if val == "si" || val == "stepi" {
let cmd = "-exec-step-instruction";
gdb::write_mi(&app.gdb_stdin, cmd);
let mut output_lock = app.output.lock().unwrap();
output_lock.push(val);

app.input.reset();
return;
} else if val == "step" {
let cmd = "-exec-step";
gdb::write_mi(&app.gdb_stdin, cmd);
let mut output_lock = app.output.lock().unwrap();
output_lock.push(val);

app.input.reset();
return;
Expand Down
4 changes: 2 additions & 2 deletions src/snapshots/heretek__tests__render_app.snap
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ snapshot_kind: text
" 0x401845 main+20 movq $0x44444444,-0x20(%rbp) "
" 0x40184d main+28 movq $0x55555555,-0x28(%rbp) "
"┌Output ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐"
"│h> -gdb-set mi-async on │"
"│run │"
"│file test-assets/test_render_app/a.out │"
"│Reading symbols from test-assets/test_render_app/a.out... │"
"│break main │"
"│Breakpoint 1 at 0x40182d: file test.c, line 11. │"
"│Breakpoint 1, main () at test.c:11 │"
"│warning: 11 test.c: No such file or directory │"
"│ │"
"│ │"
"└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘"
"┌|Press q to exit, i to enter input|─|Status: bkptno=1, reason=breakpoint-hit, stopped-threads=all, thread-id=1|───────────────────────────────────────────────┐"
"│(gdb) │"
Expand Down