From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8081 invoked by alias); 15 Nov 2002 01:58:52 -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 8073 invoked from network); 15 Nov 2002 01:58:50 -0000 Received: from unknown (HELO optimation.com.au) (203.18.86.3) by sources.redhat.com with SMTP; 15 Nov 2002 01:58:50 -0000 Received: by optimation.com.au (SMI-8.6/OSErob-2.4) for gdb-patches@sources.redhat.com id MAA22754; Fri, 15 Nov 2002 12:58:48 +1100 >Received: from pinot.mel.optimation.com.au by optimation.com.au (5.0/OSE-3.1) for gdb-patches@sources.redhat.com id AA23274; Fri, 15 Nov 2002 12:58:36 +1100 Date: Thu, 14 Nov 2002 17:58:00 -0000 From: Duncan Roe To: gdb-patches@sources.redhat.com Subject: Re: [RFC] Display exact entered expression for watchpoints Message-Id: <20021115125836.A20567@pinot> Mail-Followup-To: gdb-patches@sources.redhat.com References: <5.0.2.1.2.20021114112441.032c9fb0@ics.u-strasbg.fr> Mime-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <5.0.2.1.2.20021114112441.032c9fb0@ics.u-strasbg.fr>; from muller@ics.u-strasbg.fr on Thu, Nov 14, 2002 at 12:00:18PM +0100 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2002-11/txt/msg00417.txt.bz2 Hi Pierre, I like the "0x" variant better also. Just a BTW, but in the circumstances you describe, I would do: watch *(struct ui_file **) 0x823b5cc so that gdb knows how many bytes to watch. E.g.: Hardware watchpoint 2: *(double *) 3221223348 Old value = 3.2999999999999994 New value = 3.2999999999999998 i.e. a 1-bit change in the 8th byte (0x400a666666666665 -> 0x400a666666666666) Cheers ... Duncan. On Thu, Nov 14, 2002 at 12:00:18PM +0100, Pierre Muller wrote: > 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 >