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: Pedro Alves <palves at redhat dot com>
- To: Tom Tromey <tromey at redhat dot com>, gdb-patches at sourceware dot org
- Date: Tue, 15 Jul 2014 11:36:27 +0100
- 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>
Hi Tom,
I like the idea of this patch a lot.
On 06/19/2014 09:03 PM, Tom Tromey wrote:
> - void (*to_resume) (struct target_ops *, ptid_t, int, enum gdb_signal)
> + void (*to_resume) (struct target_ops *, ptid_t, target_debug_step,
> + enum gdb_signal)
> TARGET_DEFAULT_NORETURN (noprocess ());
What I'm not sure I like is the need for new typedefs. Seems odd to
me to have a textual mismatch between the declaration and all
the implementations.
Did you try an __attribute__(())-like approach? Something like:
void (*to_resume) (struct target_ops *,
ptid_t,
int step TDP (print_target_resume_step),
enum gdb_signal)
TARGET_DEFAULT_NORETURN (noprocess ());
Parameters that have no explicit attribute would still fallback
to type based printing. It'd be a way to override the default.
Another similar idea, but written out of line:
void (*to_resume) (struct target_ops *, ptid_t, int step,
enum gdb_signal)
TARGET_DEBUG_PRINT (step, print_target_resume_step)
TARGET_DEFAULT_NORETURN (noprocess ());
?
--
Pedro Alves