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] Prec multi-thread support


>>>>> ">" == 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


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