[RFC] init_breakpoint_sal: Add quotes around part of command in error message

Joel Brobecker
2012-05-15T15:00:21Z

Hello,

What do you guys think of the following change. If changes:

(gdb) b *rendez_vous'address TASK 2
Garbage TASK 2 at end of command

... into ...

(gdb) b *rendez_vous'address TASK 2
Garbage `TASK 2' at end of command

(actually, the current output is `Garbage 2 at end of command', but
that's a bug that I am planning on fixing).

Surprisingly, this doesn't appear to be tested at all, at the moment,
as a quick grep for `Garbage' in all of gdb/testsuite did not yield
any match. I will submit a testcase with my fix that will test this.

gdb/ChangeLog:

* breakpoint.c (init_breakpoint_sal): Add quotes around part
of command in two error message.

Untested for now, just trying to get feedback. Will definitely test
before checking in, if people like the change.

Thanks,
--
Joel

---
gdb/breakpoint.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 9eecdf8..9557430 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -8629,7 +8629,7 @@ init_breakpoint_sal (struct breakpoint *b, struct gdbarch *gdbarch,
char *arg = b->cond_string;
loc->cond = parse_exp_1 (&arg, block_for_pc (loc->address), 0);
if (*arg)
- error (_("Garbage %s follows condition"), arg);
+ error (_("Garbage `%s' follows condition"), arg);
}

/* Dynamic printf requires and uses additional arguments on the
@@ -8642,7 +8642,7 @@ init_breakpoint_sal (struct breakpoint *b, struct gdbarch *gdbarch,
error (_("Format string required"));
}
else if (b->extra_string)
- error (_("Garbage %s at end of command"), b->extra_string);
+ error (_("Garbage `%s' at end of command"), b->extra_string);
}

b->display_canonical = display_canonical;
--
1.7.1