This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC] Prec multi-thread support
- From: Tom Tromey <tromey at redhat dot com>
- To: Hui Zhu <teawater at gmail dot com>
- Cc: gdb-patches ml <gdb-patches at sourceware dot org>, Michael Snyder <msnyder at vmware dot com>
- Date: Mon, 09 Nov 2009 10:59:48 -0700
- Subject: Re: [RFC] Prec multi-thread support
- References: <daef60380911020844s6ffa1677yc6ef5053784d90cf@mail.gmail.com>
- Reply-to: tromey at redhat dot com
>>>>> ">" == 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