This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: GDB record patch 0.1.3.1 for GDB-6.8 release
- From: Pedro Alves <pedro at codesourcery dot com>
- To: gdb-patches at sourceware dot org
- Cc: Tea <teawater at gmail dot com>, "Michael Snyder" <msnyder at specifix dot com>, "Thiago Jung Bauermann" <bauerman at br dot ibm dot com>
- Date: Thu, 22 May 2008 17:37:50 +0100
- Subject: Re: GDB record patch 0.1.3.1 for GDB-6.8 release
- References: <daef60380804222316j1b2f10afm77e01ac2618a86ba@mail.gmail.com>
Hi Teawater,
I took a really quick glimpse at the patch, and I was wondering if making the
record target a proper target that sits on top of all the other targets
wouldn't make more sense?
enum strata
{
dummy_stratum, /* The lowest of the low */
file_stratum, /* Executable files, etc */
core_stratum, /* Core dump files */
process_stratum, /* Executing processes */
thread_stratum, /* Executing threads */
record_stratum /* Support reverse debugging */
};
Then, things could be a bit more encapsulated. e.g., this wouldn't be needed,
@@ -1026,10 +1047,18 @@ wait_for_inferior (int treat_exec_as_sig
Â
 Âwhile (1)
  Â{
- if (deprecated_target_wait_hook)
- ecs->ptid = deprecated_target_wait_hook (ecs->waiton_ptid, ecs->wp);
+ if (record_list && (record_list->next || gdb_is_reverse))
+ {
+ ecs->ptid = record_wait (current_gdbarch, ecs->waiton_ptid,
ecs->wp);
+ }
else
- ecs->ptid = target_wait (ecs->waiton_ptid, ecs->wp);
+ {
+ if (deprecated_target_wait_hook)
+ ecs->ptid =
+ deprecated_target_wait_hook (ecs->waiton_ptid, ecs->wp);
+ else
+ ecs->ptid = target_wait (ecs->waiton_ptid, ecs->wp);
+ }
Those new checks could be done inside record_wait, and if eval as false,
defer to the target beneath.
There are probably other things that would become cleaner too.
--
Pedro Alves