Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Tom Tromey <tromey@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFC] auto-generate most target debug methods
Date: Thu, 17 Jul 2014 14:50:00 -0000	[thread overview]
Message-ID: <53C7E1D8.7060808@redhat.com> (raw)
In-Reply-To: <87sim1z71y.fsf@fleche.redhat.com>

On 07/16/2014 03:56 PM, Tom Tromey wrote:
> Pedro> I like the idea of this patch a lot.
> [...]
> Pedro> Did you try an __attribute__(())-like approach?  Something like:
> 
> Appended is a patch that works this way.

This looks great to me.

>  static void
> +debug_post_attach (struct target_ops *self, int arg1)
> +{
> +  fprintf_unfiltered (gdb_stdlog, "-> %s->to_post_attach (...)\n", debug_target.to_shortname);
> +  debug_target.to_post_attach (&debug_target, arg1);
> +  fprintf_unfiltered (gdb_stdlog, "<- %s->to_post_attach (", debug_target.to_shortname);
> +  target_debug_print_struct_target_ops_p (&debug_target);
> +  fputs_unfiltered (", ", gdb_stdlog);
> +  target_debug_print_int (arg1);
> +  fputs_unfiltered (")\n", gdb_stdlog);

I think it'll end up being useful to print the arguments before
the call too, but I don't think we do that today, so this way
looks fine to me.

> +static void
> +delegate_resume (struct target_ops *self, ptid_t arg1, int TARGET_DEBUG_PRINTER (target_debug_print_step) arg2, enum gdb_signal arg3)

Doesn't really matter much, but would it be trivial to strip
out the TARGET_DEBUG_PRINTER part in these generated methods?

Thanks!

I wonder about generating the target_foo() entry point methods too...

-- 
Pedro Alves


  reply	other threads:[~2014-07-17 14:46 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-19 20:04 Tom Tromey
2014-06-20  8:00 ` Yao Qi
2014-06-20 14:04   ` Tom Tromey
2014-07-15 11:17 ` Pedro Alves
2014-07-15 15:20   ` Tom Tromey
2014-07-16 15:46   ` Tom Tromey
2014-07-17 14:50     ` Pedro Alves [this message]
2014-07-17 16:12       ` Tom Tromey
2014-07-17 16:35         ` Pedro Alves
2014-07-17 16:41           ` Tom Tromey
2014-07-17 16:52             ` Pedro Alves
2014-07-17 16:49       ` Tom Tromey
2014-07-17 16:51         ` Pedro Alves
2014-07-24 13:59         ` Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53C7E1D8.7060808@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tromey@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox