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: GDB record patch 0.1.3.1 for GDB-6.8 release


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


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