From: Pierre Muller <muller@ics.u-strasbg.fr>
To: gdb-patches@sources.redhat.com
Subject: [RFC] Display exact entered expression for watchpoints
Date: Thu, 14 Nov 2002 03:01:00 -0000 [thread overview]
Message-ID: <5.0.2.1.2.20021114112441.032c9fb0@ics.u-strasbg.fr> (raw)
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:
next reply other threads:[~2002-11-14 11:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-11-14 3:01 Pierre Muller [this message]
2002-11-14 11:52 ` Daniel Jacobowitz
2002-11-19 3:06 ` Pierre Muller
2002-11-14 17:58 ` Duncan Roe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5.0.2.1.2.20021114112441.032c9fb0@ics.u-strasbg.fr \
--to=muller@ics.u-strasbg.fr \
--cc=gdb-patches@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox