Re: [RFA] Submit process record and replay third time, 3/9

teawater
2009-03-18T13:05:02Z

>
>
>> +
>> +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