From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5965 invoked by alias); 14 Nov 2002 11:01:45 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 5946 invoked from network); 14 Nov 2002 11:01:41 -0000 Received: from unknown (HELO cerbere.u-strasbg.fr) (130.79.112.250) by sources.redhat.com with SMTP; 14 Nov 2002 11:01:41 -0000 Received: from laocoon.ics.u-strasbg.fr (laocoon.u-strasbg.fr [130.79.112.72]) by cerbere.u-strasbg.fr (Postfix) with ESMTP id 3A21E66A for ; Thu, 14 Nov 2002 12:15:19 +0100 (CET) Message-Id: <5.0.2.1.2.20021114112441.032c9fb0@ics.u-strasbg.fr> X-Sender: muller@ics.u-strasbg.fr Date: Thu, 14 Nov 2002 03:01:00 -0000 To: gdb-patches@sources.redhat.com From: Pierre Muller Subject: [RFC] Display exact entered expression for watchpoints Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-SW-Source: 2002-11/txt/msg00409.txt.bz2 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 * 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: