This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] Submit process record and replay third time, 3/9
- From: teawater <teawater at gmail dot com>
- To: Pedro Alves <pedro at codesourcery dot com>
- Cc: gdb-patches at sourceware dot org, Marc Khouzam <marc dot khouzam at ericsson dot com>
- Date: Wed, 18 Mar 2009 21:04:53 +0800
- Subject: Re: [RFA] Submit process record and replay third time, 3/9
- References: <daef60380901072146w727f7abat7ff7738a03e58d23@mail.gmail.com> <daef60380902230120l6a12764du34a05b3bdc0b1f85@mail.gmail.com> <200903092034.57367.pedro@codesourcery.com>
>
>
>> +
>> +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