From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 338 invoked by alias); 22 May 2008 16:38:08 -0000 Received: (qmail 327 invoked by uid 22791); 22 May 2008 16:38:08 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 22 May 2008 16:37:50 +0000 Received: (qmail 29475 invoked from network); 22 May 2008 16:37:48 -0000 Received: from unknown (HELO orlando.local) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 22 May 2008 16:37:48 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: GDB record patch 0.1.3.1 for GDB-6.8 release Date: Fri, 23 May 2008 03:52:00 -0000 User-Agent: KMail/1.9.9 Cc: Tea , "Michael Snyder" , "Thiago Jung Bauermann" References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200805221737.50773.pedro@codesourcery.com> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-05/txt/msg00666.txt.bz2 Hi Teawater, I took a really quick glimpse at the patch, and I was wondering if making t= he record target a proper target that sits on top of all the other targets=20 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 need= ed, @@ -1026,10 +1047,18 @@ wait_for_inferior (int treat_exec_as_sig =C2=A0 =C2=A0 =C2=A0while (1) =C2=A0 =C2=A0 =C2=A0{ - if (deprecated_target_wait_hook) - ecs->ptid =3D deprecated_target_wait_hook (ecs->waiton_ptid, ecs->w= p); + if (record_list && (record_list->next || gdb_is_reverse)) + { + ecs->ptid =3D record_wait (current_gdbarch, ecs->waiton_ptid,=20 ecs->wp); + } else - ecs->ptid =3D target_wait (ecs->waiton_ptid, ecs->wp); + { + if (deprecated_target_wait_hook) + ecs->ptid =3D + deprecated_target_wait_hook (ecs->waiton_ptid, ecs->wp); + else + ecs->ptid =3D 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. --=20 Pedro Alves