Be explicit when using software breakpoint/watchpoint

Message ID 20170922091741.5882-1-nicolac76@yahoo.fr
State New, archived
Headers

Commit Message

Terekhov, Mikhail via Gdb-patches Sept. 22, 2017, 9:17 a.m. UTC
  When there is no more hw watchpoint/breakpoint we see:
  (gdb) watch *0x10
  Hardware watchpoint 1: *0x10
  (gdb) info watchpoints
  Num  Type        Disp  Enb Address  What
  1    watchpoint  keep  y            *0x10

This patch change to:
  (gdb) info watchpoints
  Num  Type           Disp  Enb Address  What
  1    sw watchpoint  keep  y            *0x10
---
 gdb/breakpoint.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Yao Qi Sept. 22, 2017, 8:57 p.m. UTC | #1
On Fri, Sep 22, 2017 at 10:17 AM, Nicolas Cornu via gdb-patches
<gdb-patches@sourceware.org> wrote:
> When there is no more hw watchpoint/breakpoint we see:
>   (gdb) watch *0x10
>   Hardware watchpoint 1: *0x10
>   (gdb) info watchpoints
>   Num  Type        Disp  Enb Address  What
>   1    watchpoint  keep  y            *0x10
>
> This patch change to:
>   (gdb) info watchpoints
>   Num  Type           Disp  Enb Address  What
>   1    sw watchpoint  keep  y            *0x10

Hi,
"watchpoint" -> "sw watchpoint" is a trivial change
to me.  Personally, I've got use that "watchpoint" is
a "sw" one, but I do agree that being explicit is always
useful.  Some tests in gdb testsuite expect to match
"watchpoint", and changing it to "sw watchpoint" will
fail the tests.
  

Patch

diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 8585f5e..2a542b1 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -6102,12 +6102,12 @@  bptype_string (enum bptype type)
   static struct ep_type_description bptypes[] =
   {
     {bp_none, "?deleted?"},
-    {bp_breakpoint, "breakpoint"},
+    {bp_breakpoint, "sw breakpoint"},
     {bp_hardware_breakpoint, "hw breakpoint"},
     {bp_single_step, "sw single-step"},
     {bp_until, "until"},
     {bp_finish, "finish"},
-    {bp_watchpoint, "watchpoint"},
+    {bp_watchpoint, "sw watchpoint"},
     {bp_hardware_watchpoint, "hw watchpoint"},
     {bp_read_watchpoint, "read watchpoint"},
     {bp_access_watchpoint, "acc watchpoint"},