From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5054 invoked by alias); 2 Dec 2009 17:38:00 -0000 Received: (qmail 5045 invoked by uid 22791); 2 Dec 2009 17:37:58 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 02 Dec 2009 17:37:52 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 64C652BABA8; Wed, 2 Dec 2009 12:37:50 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id WvImob0pfwTH; Wed, 2 Dec 2009 12:37:50 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 04A582BAB8B; Wed, 2 Dec 2009 12:37:50 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id 3FADDF5889; Wed, 2 Dec 2009 09:37:44 -0800 (PST) Date: Wed, 02 Dec 2009 17:38:00 -0000 From: Joel Brobecker To: Paul Pluzhnikov , eliz@gnu.org Cc: gdb-patches@sourceware.org Subject: [DOCO/PING] Re: [patch] Replace deprecated_memory_changed_hook with an observer. Message-ID: <20091202173744.GC4020@adacore.com> References: <8ac60eac0911251142r62f0e95al5ebd44503cac645c@mail.gmail.com> <20091125204837.GH26004@adacore.com> <8ac60eac0911251313r774f96a4h4b723062a698617e@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8ac60eac0911251313r774f96a4h4b723062a698617e@mail.gmail.com> User-Agent: Mutt/1.5.20 (2009-06-14) Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-12/txt/msg00015.txt.bz2 Hi Eli, Just wondering if you are away or just missed this patch where your feedback would be much appreciated :). If you're not around (no answer for another couple of days), then I'll approve the doco part since the change is small and has been waiting for a week now, and will personally make sure that either Paul or myself immediately address any comment you might have. Paul, please wait for another couple of days for Eli's feedback. If he's away, then just go ahead and commit. We will address any comment when he gets back. On Wed, Nov 25, 2009 at 01:13:53PM -0800, Paul Pluzhnikov wrote: > On Wed, Nov 25, 2009 at 12:48 PM, Joel Brobecker wrote: > > > It looks like you forgot to remove the definition in top.c. > > Indeed. Fixed patch attached. > > Thanks, > -- > Paul Pluzhnikov > > gdb/ChangeLog: > > 2009-11-25 Paul Pluzhnikov > > * ada-lang.c (ada_value_assign): Use observer_notify_memory_changed. > * valops.c (value_assign): Likewise. > * defs.h (deprecated_memory_changed_hook): Remove. > * top.c (deprecated_memory_changed_hook): Likewise. > * interps.c (clear_interpreter_hooks): Adjust. > > gdb/doc/ChangeLog: > > 2009-11-25 Paul Pluzhnikov > > * observer.texi: New memory_changed observer. > > gdb/gdbtk/ChangeLog: > > 2009-11-25 Paul Pluzhnikov > > * generic/gdbtk-hooks.c (gdbtk_memory_changed): Adjust. > (gdbtk_add_hooks): Adjust. > Index: ada-lang.c > =================================================================== > RCS file: /cvs/src/src/gdb/ada-lang.c,v > retrieving revision 1.234 > diff -u -p -u -r1.234 ada-lang.c > --- ada-lang.c 19 Nov 2009 22:45:56 -0000 1.234 > +++ ada-lang.c 25 Nov 2009 21:10:03 -0000 > @@ -2289,9 +2289,8 @@ ada_value_assign (struct value *toval, s > move_bits (buffer, value_bitpos (toval), > value_contents (fromval), 0, bits, 0); > write_memory (to_addr, buffer, len); > - if (deprecated_memory_changed_hook) > - deprecated_memory_changed_hook (to_addr, len); > - > + observer_notify_memory_changed (to_addr, len, buffer); > + > val = value_copy (toval); > memcpy (value_contents_raw (val), value_contents (fromval), > TYPE_LENGTH (type)); > Index: defs.h > =================================================================== > RCS file: /cvs/src/src/gdb/defs.h,v > retrieving revision 1.257 > diff -u -p -u -r1.257 defs.h > --- defs.h 21 Oct 2009 18:02:25 -0000 1.257 > +++ defs.h 25 Nov 2009 21:10:03 -0000 > @@ -1108,7 +1108,6 @@ extern void (*deprecated_readline_begin_ > extern char *(*deprecated_readline_hook) (char *); > extern void (*deprecated_readline_end_hook) (void); > extern void (*deprecated_register_changed_hook) (int regno); > -extern void (*deprecated_memory_changed_hook) (CORE_ADDR addr, int len); > extern void (*deprecated_context_hook) (int); > extern ptid_t (*deprecated_target_wait_hook) (ptid_t ptid, > struct target_waitstatus *status, > Index: interps.c > =================================================================== > RCS file: /cvs/src/src/gdb/interps.c,v > retrieving revision 1.32 > diff -u -p -u -r1.32 interps.c > --- interps.c 6 Feb 2009 21:33:58 -0000 1.32 > +++ interps.c 25 Nov 2009 21:10:03 -0000 > @@ -343,7 +343,6 @@ clear_interpreter_hooks (void) > deprecated_readline_hook = 0; > deprecated_readline_end_hook = 0; > deprecated_register_changed_hook = 0; > - deprecated_memory_changed_hook = 0; > deprecated_context_hook = 0; > deprecated_target_wait_hook = 0; > deprecated_call_command_hook = 0; > Index: top.c > =================================================================== > RCS file: /cvs/src/src/gdb/top.c,v > retrieving revision 1.173 > diff -u -p -u -r1.173 top.c > --- top.c 5 Nov 2009 20:43:52 -0000 1.173 > +++ top.c 25 Nov 2009 21:10:03 -0000 > @@ -259,9 +259,6 @@ void (*deprecated_interactive_hook) (voi > that several registers have changed (see value_assign). */ > void (*deprecated_register_changed_hook) (int regno); > > -/* Tell the GUI someone changed LEN bytes of memory at ADDR */ > -void (*deprecated_memory_changed_hook) (CORE_ADDR addr, int len); > - > /* Called when going to wait for the target. Usually allows the GUI to run > while waiting for target events. */ > > Index: valops.c > =================================================================== > RCS file: /cvs/src/src/gdb/valops.c,v > retrieving revision 1.227 > diff -u -p -u -r1.227 valops.c > --- valops.c 10 Nov 2009 22:17:58 -0000 1.227 > +++ valops.c 25 Nov 2009 21:10:03 -0000 > @@ -861,8 +861,8 @@ value_assign (struct value *toval, struc > } > > write_memory (changed_addr, dest_buffer, changed_len); > - if (deprecated_memory_changed_hook) > - deprecated_memory_changed_hook (changed_addr, changed_len); > + observer_notify_memory_changed (changed_addr, changed_len, > + dest_buffer); > } > break; > > Index: doc/observer.texi > =================================================================== > RCS file: /cvs/src/src/gdb/doc/observer.texi,v > retrieving revision 1.27 > diff -u -p -u -r1.27 observer.texi > --- doc/observer.texi 19 Oct 2009 09:51:42 -0000 1.27 > +++ doc/observer.texi 25 Nov 2009 21:10:03 -0000 > @@ -208,6 +208,11 @@ Either @value{GDBN} detached from the in > exited. The argument @var{pid} identifies the inferior. > @end deftypefun > > +@deftypefun void memory_changed (CORE_ADDR @var{addr}, int @var{len}, const bfd_byte *@var{data}) > +Bytes from @var{data} to @var{data} + @var{len} have been written > +to the current inferior at @var{addr}. > +@end deftypefun > + > @deftypefun void test_notification (int @var{somearg}) > This observer is used for internal testing. Do not use. > See testsuite/gdb.gdb/observer.exp. > Index: gdbtk/generic/gdbtk-hooks.c > =================================================================== > RCS file: /cvs/src/src/gdb/gdbtk/generic/gdbtk-hooks.c,v > retrieving revision 1.49 > diff -u -p -u -r1.49 gdbtk-hooks.c > --- gdbtk/generic/gdbtk-hooks.c 24 May 2009 08:38:27 -0000 1.49 > +++ gdbtk/generic/gdbtk-hooks.c 25 Nov 2009 21:10:03 -0000 > @@ -94,7 +94,8 @@ static void gdbtk_pre_add_symbol (const > static void gdbtk_print_frame_info (struct symtab *, int, int, int); > static void gdbtk_post_add_symbol (void); > static void gdbtk_register_changed (int regno); > -static void gdbtk_memory_changed (CORE_ADDR addr, int len); > +static void gdbtk_memory_changed (CORE_ADDR addr, int len, > + const bfd_byte *data); > static void gdbtk_selected_frame_changed (int); > static void gdbtk_context_change (int); > static void gdbtk_error_begin (void); > @@ -129,6 +130,7 @@ gdbtk_add_hooks (void) > observer_attach_tracepoint_modified (gdbtk_modify_tracepoint); > observer_attach_tracepoint_deleted (gdbtk_delete_tracepoint); > observer_attach_architecture_changed (gdbtk_architecture_changed); > + observer_attach_memory_changed (gdbtk_memory_changed); > > /* Hooks */ > deprecated_call_command_hook = gdbtk_call_command; > @@ -158,7 +160,6 @@ gdbtk_add_hooks (void) > deprecated_detach_hook = gdbtk_detach; > > deprecated_register_changed_hook = gdbtk_register_changed; > - deprecated_memory_changed_hook = gdbtk_memory_changed; > deprecated_selected_frame_level_changed_hook = gdbtk_selected_frame_changed; > deprecated_context_hook = gdbtk_context_change; > > @@ -393,7 +394,7 @@ gdbtk_register_changed (int regno) > } > > static void > -gdbtk_memory_changed (CORE_ADDR addr, int len) > +gdbtk_memory_changed (CORE_ADDR addr, int len, const bfd_byte *data) > { > if (Tcl_Eval (gdbtk_interp, "gdbtk_memory_changed") != TCL_OK) > report_error (); -- Joel