[RFC] Prec multi-thread support
Tom Tromey
tromey@redhat.com
Mon Nov 9 18:00:00 GMT 2009
>>>>> ">" == 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
More information about the Gdb-patches
mailing list