summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Hunter <m@lfurio.us>2025-08-25 02:47:44 -0400
committerMatt Hunter <m@lfurio.us>2025-09-07 21:03:26 -0400
commit9640f4b82b1030378bbf5e81ce205d0096cc6b73 (patch)
tree1c756c2f3846372d7b6ada9a548a2aee8a0d70c1
parent1001499baec9e8d6fb25c641b2a0577ccd419d6f (diff)
downloadmisplays-9640f4b82b1030378bbf5e81ce205d0096cc6b73.tar.gz
misplays-9640f4b82b1030378bbf5e81ce205d0096cc6b73.zip
Allow multiple modifier chars in breakpoint CLI
Signed-off-by: Matt Hunter <m@lfurio.us>
-rw-r--r--misplays.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/misplays.c b/misplays.c
index 20da6bb..25182e3 100644
--- a/misplays.c
+++ b/misplays.c
@@ -391,15 +391,19 @@ int main(int argc, char **argv) {
char *t = cmd;
int en = 1;
pid_t tid = 0;
- if (t[0] == '!') {
- en = -1;
- t++;
- } else if (t[0] == '#') {
- en = 0;
- t++;
- } else if (t[0] == '@') {
- tid = th->id;
- t++;
+ while (1) {
+ if (t[0] == '!') {
+ en = -1;
+ t++;
+ } else if (t[0] == '#') {
+ en = 0;
+ t++;
+ } else if (t[0] == '@') {
+ tid = th->id;
+ t++;
+ } else {
+ break;
+ }
}
unsigned long address = strtoul(t, NULL, 0);
struct breakpoint *b = add_breakpoint(th->proc, address, 0);