Can not debug strings with gdb
Original Reporter info from Mantis: miguelz
-
Reporter name: Miguel Ortuño
Original Reporter info from Mantis: miguelz
- Reporter name: Miguel Ortuño
Description:
I'd like to debug strings. Following freepascal.org documentation about debugging with gdb,
I try to use gdb.ini example shown here:
https://www.freepascal.org/docs-html/current/user/userse55.html#x166-17300010.3
But I get an error in line
set print sym on
So I changed it to
set print symbol-filename on
I also get an error trying to use pst user command, this is what I get:
(gdb) show user
User command "pst":
set $pos=&$arg0
set $strlen = {byte}$pos
print {char}&$arg0.st@($strlen+1)
(gdb) pst y
A syntax error in expression, near `&y'.
Steps to reproduce:
Additional information:
This is the code I was using:
{$mode objfpc}{$H-}{$R+}{$T+}{$Q+}{$V+}{$D+}{$X-}{$warnings on}
program test;
function f1(x:string): string;
var
y: string;
begin
y:='.bla';
result := x + y;
end;
var
a: string;
begin
a := 'test';
a := f1(a);
writeln(a);
end.
Mantis conversion info:
- Mantis ID: 38006
- OS: linux
- OS Build: ubuntu 20.04
- Build: [2019/11/25]
- Platform: amd64
- Version: 3.0.4
- Fixed in version: 3.3.1
- Fixed in revision: 1765 (#cb1fbb4d)
- Target version: 3.2.2