From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16887 invoked by alias); 17 Nov 2010 10:09:07 -0000 Received: (qmail 16860 invoked by uid 22791); 17 Nov 2010 10:09:06 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO sourceware.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 17 Nov 2010 10:09:01 +0000 From: "Jacob.Bramley at arm dot com" To: gdb-prs@sourceware.org Subject: [Bug tdep/12223] New: GDB becomes unusable if it fails to speculate about frame information on ARM. X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: tdep X-Bugzilla-Keywords: X-Bugzilla-Severity: critical X-Bugzilla-Who: Jacob.Bramley at arm dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Date: Wed, 17 Nov 2010 10:09:00 -0000 Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org X-SW-Source: 2010-q4/txt/msg00142.txt.bz2 http://sourceware.org/bugzilla/show_bug.cgi?id=3D12223 Summary: GDB becomes unusable if it fails to speculate about frame information on ARM. Product: gdb Version: HEAD URL: https://bugzilla.mozilla.org/show_bug.cgi?id=3D605758#c6 Status: NEW Severity: critical Priority: P2 Component: tdep AssignedTo: unassigned@sourceware.org ReportedBy: Jacob.Bramley@arm.com Host: ARM Target: ARM Where frame debug information is not available, such as when executing some JIT-compiled code in Mozilla's Trace Monkey, GDB tries to guess what the frame looks like by assuming that the 'FP' register points to a traditional frame. Most JIT-compilers don't actually use a traditional frame, so this generally fails, and no frame information can be found. Provided that the FP points to a valid memory address and it looks enough like a frame that GDB can attempt to read it, everything works fine. No, you don't get backtraces, but you can still do instruction-level debugging. By some amazing coincidence, at least Trace Monkey has had this property until recently. Trace Monkey now stores a value at *fp which is not a valid pointer, and GDB falls over. When JIT-compiled code is stepped into, GDB dumps the following to the terminal: (gdb) si Cannot access memory at address 0x5ffff8 (The memory address depends on the value at *fp.) Any further commands (including 'quit') result in a repeat of the message, and the debug session is essentially lost. ---- The fix for this requires a modification of the logic in arm_scan_prologue as follows: =E2=80=A2 Detect memory access errors in frame speculation and bail out cleanly. =E2=80=A2 Use memory access functions which don't print to the terminal i= f an error is detected. (Otherwise, even if the speculation fails cleanly, the user still sees an error message after every command in the JIT-compiled code.) Instruction-level debug is once again possible with these changes. ---- Refer here for my original description of the problem: https://bugzilla.mozilla.org/show_bug.cgi?id=3D605758#c6 --=20 Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=3Demail ------- You are receiving this mail because: ------- You are on the CC list for the bug.