This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] valprint.c (read_string): Rework clean-up logic.


>>>>> "Phil" == Phil Muldoon <pmuldoon@redhat.com> writes:

Phil> 2009-02-27  Phil Muldoon  <pmuldoon@redhat.com>
Phil>    * valprint.c (xfree_gdb_byte): New function.
Phil>    (read_string): Rework clean-up logic.  Use xfree_gdb_byte for
Phil>    clean-up.

This is almost ok...

Phil> +/* Local clean-up for a gdb_byte buffer pointed to via double
Phil> +   indirection.  This function is used in read_string.  */
Phil> +static void
Phil> +xfree_gdb_byte (void *buffer)

I forgot that there is already a function for this --
free_current_contents.  So, this new function is not needed...

Phil> +  old_chain = make_cleanup (xfree_gdb_byte, buffer);
 
... and you can just s/xfree_gdb_byte/free_current_contents/ here.

It is ok with that change.  Thanks.

Tom


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]