diff options
| author | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2020-11-03 22:39:00 +0100 |
|---|---|---|
| committer | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2020-11-03 22:42:52 +0100 |
| commit | 2dde7bcb26e9015b3331384b7bee82b1066229d4 (patch) | |
| tree | 3bb73f14ec8fe97fa28e2e17858ede89e589eef7 /gdbstub | |
| parent | 5d8182c246538e84b4b1bda5ba1c4e388fa9cccd (diff) | |
Notify gdb stub whenever a break instruction is executed
Diffstat (limited to 'gdbstub')
| m--------- | gdbstub/gdbstub | 0 | ||||
| -rw-r--r-- | gdbstub/gdbstub_sys.c | 19 | ||||
| -rw-r--r-- | gdbstub/gdbstub_sys.h | 3 |
3 files changed, 15 insertions, 7 deletions
diff --git a/gdbstub/gdbstub b/gdbstub/gdbstub -Subproject 13012701334821cf1038a81920eaafff1921268 +Subproject 1266e61757af01485f56b4e5bd3969fdaba9c35 diff --git a/gdbstub/gdbstub_sys.c b/gdbstub/gdbstub_sys.c index 86f18f63..bf154fcf 100644 --- a/gdbstub/gdbstub_sys.c +++ b/gdbstub/gdbstub_sys.c @@ -196,15 +196,22 @@ static int wait_hit_or_break(struct msg *msg) break; } } - else if (msg->type != MSG_TYPE_HIT) { - fprintf(stderr, "unexpected msg.type %d\n", msg->type); - return 1; + else { + switch (msg->type) { + case MSG_TYPE_BREAK: + return 1; + case MSG_TYPE_HIT: + return 0; + + default: + fprintf(stderr, "%s:%d:unexpected msg.type %d\n", + __func__, __LINE__, msg->type); + return EOF; + } } - else - return 0; } while (1); - return 1; + return EOF; } #endif diff --git a/gdbstub/gdbstub_sys.h b/gdbstub/gdbstub_sys.h index f44dfcc9..4d0fe3e9 100644 --- a/gdbstub/gdbstub_sys.h +++ b/gdbstub/gdbstub_sys.h @@ -66,7 +66,8 @@ struct msg { MSG_TYPE_SHUTDOWN, /* Response frames. */ - MSG_TYPE_HIT + MSG_TYPE_HIT, + MSG_TYPE_BREAK, } type; union { |
