From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30854 invoked by alias); 15 Aug 2003 18:21:16 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 30847 invoked from network); 15 Aug 2003 18:21:16 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 15 Aug 2003 18:21:16 -0000 Received: from int-mx2.corp.redhat.com (nat-pool-rdu-dmz.redhat.com [172.16.52.200] (may be forged)) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id h7FILFt05755 for ; Fri, 15 Aug 2003 14:21:15 -0400 Received: from potter.sfbay.redhat.com (potter.sfbay.redhat.com [172.16.27.15]) by int-mx2.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h7FILEL22530; Fri, 15 Aug 2003 14:21:14 -0400 Received: from redhat.com (reddwarf.sfbay.redhat.com [172.16.24.50]) by potter.sfbay.redhat.com (8.11.6/8.11.6) with ESMTP id h7FILDO13753; Fri, 15 Aug 2003 11:21:13 -0700 Message-ID: <3F3D2499.4090904@redhat.com> Date: Fri, 15 Aug 2003 18:21:00 -0000 From: Michael Snyder User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "Newman, Mark (N-Superior Technical Resource Inc)" CC: gdb-patches@sources.redhat.com, Michael Snyder Subject: Re: FW: bug ???? References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-08/txt/msg00250.txt.bz2 Newman, Mark (N-Superior Technical Resource Inc) wrote: >>Michael - >> >>I am not certain how to handle this. Perhaps you can give me some >>insight. I am not familar with GDB internals. >> >>I appears that the the following is not working correctly in >>trace_dump_command >> >> /* The current frame is a trap frame if the frame PC is equal >> to the tracepoint PC. If not, then the current frame was >> collected during single-stepping. */ >> >> stepping_frame = (t->address != read_pc ()); >> >>The trace address is one less than the read_pc address (I am not >>stepping). Either gdbserver needs to adjust the register set so that >>the pc is back by one or some adjustment needs to be made to t->address >>so it looks at the next address. Should the tracepoint look at the >>state prior to executing the instruction at the address or after the >>instruction is executed? >> >> >> > >Ah, this is the old DECR_PC_AFTER_BREAK problem. I never >ran into it because I never had tracepoints working on an x86 target >(just about the only one left where it's an issue. > >Try this: > > stepping_frame = (t->address != (read_pc () - DECR_PC_AFTER_BREAK); > >The macro should evaluate to zero if the pc points to the trap >instruction, and >to (sizeof(trap_instruction) if it points past the trap. > >If this works, why don't you submit it as a patch to gdb-patches? > Hi Mark, Thanks for your two bug reports and fixes. These are small enough that we can accept them without an FSF assignment, but if you don't have one on file and are planning to do more extensive work on gdb, this would be the time to get the paperwork done. If you'll have a look at the file gdb/CONTRIBUTE, there's an outline of what a submission should look like. I'll give you an example by whipping this one into shape (see below): You can consider this one approved. ------------------------------------------------------------------------------------------------- The bug: tracepoint.c tests a tracepoint location without allowing for DECR_PC_AFTER_BREAK, therefore the test fails on x86. 2003-08-15 Mark Newman * tracepoint.c (trace_dump_command): Trace break address is subject to DECR_PC_AFTER_BREAK. *************** trace_dump_command (char *args, int from *** 2511,2517 **** to the tracepoint PC. If not, then the current frame was collected during single-stepping. */ ! stepping_frame = (t->address != read_pc ()); for (action = t->actions; action; action = action->next) { --- 2511,2517 ---- to the tracepoint PC. If not, then the current frame was collected during single-stepping. */ ! stepping_frame = (t->address != (read_pc () - DECR_PC_AFTER_BREAK)); for (action = t->actions; action; action = action->next) {