Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: Hui Zhu <teawater@gmail.com>
Cc: gdb-patches ml <gdb-patches@sourceware.org>,
	        Michael Snyder <msnyder@vmware.com>
Subject: Re: [RFC] Prec multi-thread support
Date: Mon, 09 Nov 2009 18:00:00 -0000	[thread overview]
Message-ID: <m3ocnbinor.fsf@fleche.redhat.com> (raw)
In-Reply-To: <daef60380911020844s6ffa1677yc6ef5053784d90cf@mail.gmail.com> 	(Hui Zhu's message of "Tue, 3 Nov 2009 00:44:34 +0800")

>>>>> ">" == Hui Zhu <teawater@gmail.com> writes:

>> This patches just for discussions and comments.  Please help me with it.

>> +      struct record_message_args args;
>> +
>> +      args.regcache = get_current_regcache ();
>> +      args.signal = signal;
>> +      record_message (&args);

Directly calling record_message like this is ugly, because it avoids
type-checking by the compiler.

I would recommend restructuring this code in one of two possible ways.

The first approach is to make record_message a simple trampoline that
takes a void*, decodes it, and then calls a properly-typed function.
Then, only use record_message in calls to catch_errors -- direct calls
should call the properly-typed implementation function.

The second approach is to avoid catch_errors altogether and use
TRY_CATCH instead.  This lets you avoid trampolines entirely.  I prefer
this way, but I don't insist on it.

Tom


  parent reply	other threads:[~2009-11-09 18:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-02 16:45 Hui Zhu
2009-11-02 18:14 ` Michael Snyder
2009-11-09 18:00 ` Tom Tromey [this message]
2009-11-12  8:26   ` Hui Zhu
2009-11-13  9:27     ` Hui Zhu

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=m3ocnbinor.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=msnyder@vmware.com \
    --cc=teawater@gmail.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