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: [RFA] Submit process record and replay third time, 3/9


>
>
>> +
>> +static void
>> +record_disconnect (struct target_ops *target, char *args, int from_tty)
>> +{
>> + ?if (record_debug)
>> + ? ?fprintf_unfiltered (gdb_stdlog, "Process record: record_disconnect\n");
>> +
>> + ?unpush_target (&record_ops);
>> + ?target_disconnect (args, from_tty);
>> +}
>> +
>> +static void
>> +record_detach (struct target_ops *ops, char *args, int from_tty)
>> +{
>> + ?if (record_debug)
>> + ? ?fprintf_unfiltered (gdb_stdlog, "Process record: record_detach\n");
>> +
>> + ?unpush_target (&record_ops);
>> + ?target_detach (args, from_tty);
>> +}
>
> This trick you're using happens to work, but, could you try
> this instead? ?Here and elsewhere similarly.
>
> ?struct target_ops *beneath = find_target_beaneath (ops);
> ?unpush_target (ops);
> ?beneath->to_detach (args, from_tty);
>

If beneath->to_detach is NULL, it will make gdb crash.

Thanks,
Hui


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