[Converted from Gnats 2222] With FreePascal 2.0.4 you cannot examine the stack local variables. The FreePascal developers say this is a gdb bug: http://www.freepascal.org/mantis/view.php?id=8215 This might be the same as problem 1967. Release: 6.5 Environment: GNU Linux, debian, AMD64 How-To-Repeat: dbgtest2.pas: ------------------------------ procedure MainProc; var x : integer; begin x := 5; writeln('x=',x); end; begin MainProc; end. ------------------------ # fpc dbgtest2.pas # gdb dbgtest2 ... (gdb) break MAINPROC Breakpoint 1 at 0x4001a4: file dbgtest2.pas, line 5. (gdb) run Starting program: /work/dbgtest64/dbgtest2 Breakpoint 1, MAINPROC () at dbgtest2.pas:5 5 x := 5; (gdb) step 6 writeln('x=',x); (gdb) print X Cannot access memory at address 0x80003877108c (gdb)
From: Daniel Jacobowitz <drow@false.org> To: viktor.nagy@abmm.hu Cc: gdb-gnats@sources.redhat.com Subject: Re: gdb/2222: Impossible to debug FreePascal programs on AMD64 Linux Date: Fri, 26 Jan 2007 07:20:16 -0500 On Fri, Jan 26, 2007 at 08:54:04AM -0000, viktor.nagy@abmm.hu wrote: > With FreePascal 2.0.4 you cannot examine the stack local variables. > > The FreePascal developers say this is a gdb bug: > > http://www.freepascal.org/mantis/view.php?id=8215 Unfortunately, their view of the bug is a little too simplistic. Making this change would break some cases that actually work and fix others that don't, just moving the problem around. Stabs, as the GNU tools use it, is a 32-bit format. The offsets are all 32-bit. When we see "fffffffc" in stabs, for an offset, it's pretty much impossible to guess whether that's 0xfffffffffffffffc (-4), or 0x00000000fffffffc (~ 4GB). Do not use stabs on 64-bit platforms. -- Daniel Jacobowitz CodeSourcery
From: Daniel Jacobowitz <drow@false.org> To: muller@ics.u-strasbg.fr, viktor.nagy@abmm.hu, gdb-gnats@sources.redhat.com Cc: Subject: Re: pascal/2222: Impossible to debug FreePascal programs on AMD64 Linux Date: Mon, 5 Feb 2007 15:30:00 -0500 On Mon, Feb 05, 2007 at 04:57:20PM -0000, muller@ics.u-strasbg.fr wrote: > I suppose that other languages also refrain from using > stabs on 64bit architectures for the same reason. Yes, precisely. -- Daniel Jacobowitz CodeSourcery
Responsible-Changed-From-To: unassigned->muller Responsible-Changed-Why: Pascal specific bug
State-Changed-From-To: open->suspended State-Changed-Why: From the reading of the notes of the Free Pascal bug database, I conclude that there is no real solution to this problem. I suppose that other languages also refrain from using stabs on 64bit architectures for the same reason.
Dup. *** This bug has been marked as a duplicate of bug 8975 ***