gdb/breakpoint: use warning function instead of gdb_printf
authorAndrew Burgess <aburgess@redhat.com>
Wed, 17 May 2023 08:50:12 +0000 (09:50 +0100)
committerAndrew Burgess <aburgess@redhat.com>
Fri, 19 May 2023 09:15:01 +0000 (10:15 +0100)
commita500c3d8e0260a556d48c7d5ee2bc4212982dfe2
treebb5a9cb73fba071d17115ffc4ea5c3a5ae9a0e27
parent637969a709c4542702d283a0471c5364d26ba81b
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 <tom@tromey.com>
gdb/breakpoint.c
gdb/testsuite/gdb.base/break-main-file-remove-fail.exp
gdb/testsuite/gdb.base/hw-sw-break-same-address.exp