This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] valprint.c (read_string): Rework clean-up logic.
- From: Tom Tromey <tromey at redhat dot com>
- To: Phil Muldoon <pmuldoon at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Fri, 27 Feb 2009 11:55:20 -0700
- Subject: Re: [patch] valprint.c (read_string): Rework clean-up logic.
- References: <49A82F5C.9000801@redhat.com>
- Reply-to: tromey at redhat dot com
>>>>> "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