[fpc-devel] function evaluation by gdb

Paul Ishenin webpirat at mail.ru
Fri Mar 27 19:44:19 CET 2009

Hello, FPC developers' list

I made a simple gui lazarus application with a form and a button on it. 
I also wrote a function in the same unit:

function GetValue(c: Char): Integer;
  Result := Ord(c);

In the Button1 OnClick handler I have next code:

  I: integer;
  I := Ord('a') + GetValue('a');

I wrote it to force compiler to generate code for GetValue and for Ord 

I break after that line (if I break before gdb will return 0) and now I 
want to evaluate GetValue('a'):

[gdb log]
<-data-evaluate-expression GetValue('a')>
<ptype GetValue('a')>
&"ptype GetValue('a')\n"
~"type = LONGINT\n"
[/gdb log]

and evaluate Ord('a'):

[gdb log]
<-data-evaluate-expression Ord('a')>
&"No symbol \"Ord\" in current context.\n"
^error,msg="No symbol \"Ord\" in current context."
[/gdb log]

and evaluate IntToStr(I):

[gdb log]
<-data-evaluate-expression IntToStr(I)>
&"too few arguments in function call\n"
^error,msg="too few arguments in function call"
[/gdb log]

Are that all gdb bugs or wrong debug info?

Best regards,
Paul Ishenin.

More information about the fpc-devel mailing list