From a500c3d8e0260a556d48c7d5ee2bc4212982dfe2 Mon Sep 17 00:00:00 2001 From: Andrew Burgess Date: Wed, 17 May 2023 09:50:12 +0100 Subject: gdb/breakpoint: use warning function instead of gdb_printf Noticed that in breakpoint.c, in one place, we do this: gdb_printf (_("warning: Error removing " "breakpoint %d\n"), old_loc->owner->number); Instead of using the `warning` function. There are a number of differences between using gdb_printf like this and calling `warning`, the main one is probably that real warnings are sent to gdb_stderr, while the above gdb_printf call will go to gdb_stdout. In this commit I: 1. Change to call `warning`, we can drop the "warning: " prefix from the string in breakpoint.c, 2. Update the warning text, I now start with a lower case 'e', which I believe is the GDB style for warnings, 3. And I have included the address of the bp_location in the warning messsage, 4. Finally, I update all the tests (2) that include this error message. Reviewed-By: Tom Tromey --- gdb/breakpoint.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'gdb/breakpoint.c') diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index fdb184a..552b789 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -11342,9 +11342,9 @@ update_global_location_list (enum ugll_insert_mode insert_mode) Note that at this point, old_loc->owner is still valid, as delete_breakpoint frees the breakpoint only after calling us. */ - gdb_printf (_("warning: Error removing " - "breakpoint %d\n"), - old_loc->owner->number); + warning (_("error removing breakpoint %d at %s"), + old_loc->owner->number, + paddress (old_loc->gdbarch, old_loc->address)); } removed = true; } -- cgit v1.1