This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC] auto-generate most target debug methods
- From: Yao Qi <yao at codesourcery dot com>
- To: Tom Tromey <tromey at redhat dot com>, <gdb-patches at sourceware dot org>
- Date: Fri, 20 Jun 2014 15:58:32 +0800
- Subject: Re: [RFC] auto-generate most target debug methods
- Authentication-results: sourceware.org; auth=none
- References: <1403208237-27023-1-git-send-email-tromey at redhat dot com>
On 06/20/2014 04:03 AM, Tom Tromey wrote:
> +static void
> +target_debug_print_unsigned_char_p (unsigned char *sigs)
> +{
> + fputs_unfiltered ("{", gdb_stdlog);
> + if (sigs != NULL)
> + {
> + int i;
> +
> + for (i = 0; i < GDB_SIGNAL_LAST; i++)
> + if (sigs[i])
> + fprintf_unfiltered (gdb_stdlog, " %s", gdb_signal_to_name (i));
> + }
> + fputs_unfiltered (" }", gdb_stdlog);
> +}
This function should be renamed to target_debug_print_signal, for
example, and typedef unsigned char * signal, if I understand your
script correctly.
> +/* Printers for the debug target. Each prints an object of a given
> + type to a string that needn't be freed. In a few cases, a new
> + typedef is introduced just to override the normal printing approach
> + for the underlying type; see target.h for those. Most printers are
> + macros, for brevity, but a few are static functions where more
> + complicated behavior is needed.
> +
> + References to these printers are automatically generated by
> + make-target-delegates. See the generated file target-delegates.c.
> +
> + A few methods are still handled explicitly in target.c:
> + target_fetch_registers target_store_registers target_xfer_partial
This isn't valid to me. I do see debug_fetch_registers,
debug_store_registers and debug_xfer_partial are generated.
> + target_fileio_* target_close target_info_proc
> +
> + In most cases this is because target delegation hasn't been done for
> + the method. */
Otherwise, this patch looks good.
--
Yao (éå)