[fpc-devel] FPC 64bit and gdb on Linux
Martin Schreiber
fpmse at bluewin.ch
Fri Oct 23 20:38:41 CEST 2009
Hi,
x64 Suse 11.1, the program:
"
program gdbvarparam;
{$ifdef FPC}{$mode objfpc}{$h+}{$endif}
{$ifdef mswindows}{$apptype console}{$endif}
uses
sysutils;
procedure test(var par1: integer);
begin
end;
var
int1: integer;
begin
int1:= 123;
test(int1);
end.
"
The debug session:
"
mse at linuxmse64:~/proj/testcase/mse/gdbvarparam> /home/mse/packs/standard/svn/fp/fixes_2_4/compiler/ppcx64 -dsvnfixes_2_4 -gl -B -O-
gdbvarparam.pas
Free Pascal Compiler version 2.3.1 [2009/10/23] for x86_64
Copyright (c) 1993-2009 by Florian Klaempfl
Target OS: Linux for x86-64
Compiling gdbvarparam.pas
Linking gdbvarparam
16 lines compiled, 0.6 sec
mse at linuxmse64:~/proj/testcase/mse/gdbvarparam> gdb ./gdbvarparam
GNU gdb (GDB; openSUSE 11.1) 6.8.50.20081120-cvs
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-suse-linux".
For bug reporting instructions, please see:
<http://bugs.opensuse.org/>...
(gdb) break test
Function "test" not defined.
Make breakpoint pending on future shared library load? (y or [n]) n
(gdb) break main
Breakpoint 1 at 0x4001f9: file gdbvarparam.pas, line 14.
(gdb) break gdbvarparam.pas:8
Breakpoint 2 at 0x4001ec: file gdbvarparam.pas, line 9.
(gdb) run
Starting program: /home/mse/proj/testcase/mse/gdbvarparam/gdbvarparam
Breakpoint 1, main () at gdbvarparam.pas:14
14 int1:= 123;
(gdb) c
Continuing.
Breakpoint 2, TEST (PAR1=@0x65cb70) at gdbvarparam.pas:9
9 end;
(gdb) print PAR1
$1 = (&LONGINT) @0x65cb70
(gdb)
"
Why is it not possible to set a breakpoint to "test"?
Is it as designed that the displayed value of a var parameter is the address
instead the value?
Martin
More information about the fpc-devel
mailing list