Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFC] Display exact entered expression for watchpoints
@ 2002-11-14  3:01 Pierre Muller
  2002-11-14 11:52 ` Daniel Jacobowitz
  2002-11-14 17:58 ` Duncan Roe
  0 siblings, 2 replies; 4+ messages in thread
From: Pierre Muller @ 2002-11-14  3:01 UTC (permalink / raw)
  To: gdb-patches

 When I watch a memory location,
I almost always use hexadecimal notation.

For instance lets say that I want to watch 
the memory containing the value of gdb_stderr
On my linux box 
(top-gdb)p &gdb_stderr
returns
$1 = (struct ui_file **) 0x823b5cc
(ok, here I could simply use 'watch gdb_stderr,
but in some other cases like dynamically allocated memory I can't).
if I enter
(top-gdb) watch *0x823b5cc
Hardware watchpoint 3: *136558028
(top-gdb) inf b
Num Type           Disp Enb Address    What
1   breakpoint     keep y   0x080f0d79 in internal_error
                                       at ../../src/origdb/utils.c:810
2   breakpoint     keep y   0x080783eb in info_command
                                       at ../../src/origdb/cli/cli-cmds.c:202
        silent
        return
3   hw watchpoint  keep y              *136558028
(top-gdb)


After my patch, I get
(top-gdb) watch *0x823b5cc
Hardware watchpoint 3: *0x823b5cc
(top-gdb) inf b
Num Type           Disp Enb Address    What
1   breakpoint     keep y   0x080f0d79 in internal_error
                                       at ../../src/origdb/utils.c:810
2   breakpoint     keep y   0x080783eb in info_command
                                       at ../../src/origdb/cli/cli-cmds.c:202
        silent
        return
3   hw watchpoint  keep y              *0x823b5cc


I really prefer the later,
but maybe I did miss a good reason
why its not  that way.
I ran the testsuite before and after,
and to my surprise, found no new failure....


ChangeLog entry

2002-11-14  Pierre Muller  <muller@ics.u-strasbg.fr>

        * breakpoint.c (print_one_breakpoint): Use exp_string field
        to display expression of watchpoints.
        (mention): Likewise.

Index: breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.93
diff -u -p -r1.93 breakpoint.c
--- breakpoint.c        10 Nov 2002 15:36:26 -0000      1.93
+++ breakpoint.c        14 Nov 2002 11:00:06 -0000
@@ -3284,8 +3284,7 @@ print_one_breakpoint (struct breakpoint
       if (addressprint)
        ui_out_field_skip (uiout, "addr");
       annotate_field (5);
-      print_expression (b->exp, stb->stream);
-      ui_out_field_stream (uiout, "what", stb);
+      ui_out_field_string (uiout, "what", b->exp_string);
       break;

     case bp_catch_load:
@@ -4421,8 +4420,7 @@ mention (struct breakpoint *b)
       ui_out_tuple_begin (uiout, "wpt");
       ui_out_field_int (uiout, "number", b->number);
       ui_out_text (uiout, ": ");
-      print_expression (b->exp, stb->stream);
-      ui_out_field_stream (uiout, "exp", stb);
+      ui_out_field_string (uiout, "exp", b->exp_string);
       ui_out_tuple_end (uiout);
       break;
     case bp_hardware_watchpoint:
@@ -4430,8 +4428,7 @@ mention (struct breakpoint *b)
       ui_out_tuple_begin (uiout, "wpt");
       ui_out_field_int (uiout, "number", b->number);
       ui_out_text (uiout, ": ");
-      print_expression (b->exp, stb->stream);
-      ui_out_field_stream (uiout, "exp", stb);
+      ui_out_field_string (uiout, "exp", b->exp_string);
       ui_out_tuple_end (uiout);
       break;
     case bp_read_watchpoint:
@@ -4439,8 +4436,6 @@ mention (struct breakpoint *b)
       ui_out_tuple_begin (uiout, "hw-rwpt");
       ui_out_field_int (uiout, "number", b->number);
       ui_out_text (uiout, ": ");
-      print_expression (b->exp, stb->stream);
-      ui_out_field_stream (uiout, "exp", stb);
       ui_out_tuple_end (uiout);
       break;
     case bp_access_watchpoint:
@@ -4448,8 +4443,7 @@ mention (struct breakpoint *b)
       ui_out_tuple_begin (uiout, "hw-awpt");
       ui_out_field_int (uiout, "number", b->number);
       ui_out_text (uiout, ": ");
-      print_expression (b->exp, stb->stream);
-      ui_out_field_stream (uiout, "exp", stb);
+      ui_out_field_string (uiout, "exp", b->exp_string);
       ui_out_tuple_end (uiout);
       break;
     case bp_breakpoint:



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-11-19 11:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-14  3:01 [RFC] Display exact entered expression for watchpoints Pierre Muller
2002-11-14 11:52 ` Daniel Jacobowitz
2002-11-19  3:06   ` Pierre Muller
2002-11-14 17:58 ` Duncan Roe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox