View Issue Details

IDProjectCategoryView StatusLast Update
0038006FPCDocumentationpublic2020-11-08 11:26
ReporterMiguel Ortuño Assigned ToMichael Van Canneyt  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Platformamd64OSlinux 
Product Version3.0.4 
Fixed in Version3.3.1 
Summary0038006: Can not debug strings with gdb
DescriptionI'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'.


Additional InformationThis 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.

TagsNo tags attached.
Fixed in Revision1765
FPCOldBugId
FPCTarget3.2.2
Attached Files

Activities

Jonas Maebe

2020-10-28 21:53

manager   ~0126617

The documentation page seeems to be very much out of date:
* printing strings should be as simple as just using the p(rint) command
* gdb does know sets these dats

Michael Van Canneyt

2020-11-08 11:26

administrator   ~0126790

Adapted the documentation.

Issue History

Date Modified Username Field Change
2020-10-28 20:00 Miguel Ortuño New Issue
2020-10-28 21:53 Jonas Maebe Note Added: 0126617
2020-11-01 12:37 Jonas Maebe Category Debugger => Documentation
2020-11-01 12:37 Jonas Maebe FPCTarget => -
2020-11-01 12:37 Jonas Maebe Assigned To => Jonas Maebe
2020-11-01 12:37 Jonas Maebe Status new => assigned
2020-11-01 12:37 Jonas Maebe Assigned To Jonas Maebe => Michael Van Canneyt
2020-11-08 11:26 Michael Van Canneyt Status assigned => resolved
2020-11-08 11:26 Michael Van Canneyt Resolution open => fixed
2020-11-08 11:26 Michael Van Canneyt Fixed in Version => 3.3.1
2020-11-08 11:26 Michael Van Canneyt Fixed in Revision => 1765
2020-11-08 11:26 Michael Van Canneyt FPCTarget - => 3.2.2
2020-11-08 11:26 Michael Van Canneyt Note Added: 0126790