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: [RFC] auto-generate most target debug methods


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


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