Bug 9327 - Impossible to debug FreePascal programs on AMD64 Linux
Summary: Impossible to debug FreePascal programs on AMD64 Linux
Status: RESOLVED DUPLICATE of bug 8975
Alias: None
Product: gdb
Classification: Unclassified
Component: pascal (show other bugs)
Version: 6.5
: P3 enhancement
Target Milestone: 7.0
Assignee: Pierre Muller
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-26 08:58 UTC by viktor.nagy
Modified: 2024-07-02 15:25 UTC (History)
4 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description viktor.nagy 2007-01-26 08:58:01 UTC
[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)
Comment 1 drow@false.org 2007-01-26 12:20:16 UTC
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
Comment 2 drow@false.org 2007-02-05 20:30:00 UTC
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
Comment 3 Pierre Muller 2007-02-05 23:57:20 UTC
Responsible-Changed-From-To: unassigned->muller
Responsible-Changed-Why: Pascal specific bug
Comment 4 Pierre Muller 2007-02-05 23:57:20 UTC
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.
Comment 5 Hannes Domani 2024-07-02 15:25:03 UTC
Dup.

*** This bug has been marked as a duplicate of bug 8975 ***