Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2016-01

Debuginfo for dynamic arrays

8 messages · 4 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Martin Schreiber

Hi,
For a "array of integer" type variable FPC 32bit stabs returns for gdb "ptype" command
"
type = ^(array [0..-1] of LONGINT)
".
MSEide uses this info to fetch the itemcount and item memory and to show the array items in watches window.
FPC 64bit dwarf "ptype" returns
"
type = ^LONGINT
".
How can we identify a dynamic array with FPC dwarf?

Thanks, Martin

Reply by email

Martin
to Martin Schreiber
Martin Schreiber wrote 14 lines
Hi, For a "array of integer" type variable FPC 32bit stabs returns for gdb "ptype" command " type = ^(array [0..-1] of LONGINT) ". MSEide uses this info to fetch the itemcount and item memory and to show the array items in watches window. FPC 64bit dwarf "ptype" returns " type = ^LONGINT ". How can we identify a dynamic array with FPC dwarf?

If I remember correctly then you can do (after you got above result) ptype foo^
or if foo is an expression ptype (foo)^
and this will return an array as ptype.

Reply by email

Jonas Maebe
to Martin Schreiber: For a "array of integer" type variable FPC 32bit stabs returns for gdb "ptype" command "…
Martin Schreiber wrote
How can we identify a dynamic array with FPC dwarf?

You can't, and ideally this shouldn't even be necessary. In the past years, people have implemented support in GDB for Fortran and ADA arrays that also have dynamic length counts. We should update our DWARF code to properly describe the dynamic length location too, so GDB will automatically do the right thing (to be enabled/disabled via a -gXXX command line option, so the old method can still be selected for use with older GDB versions).

Jonas

Reply by email

Florian Klämpfl
to Martin: If I remember correctly then you can do (after you got above result) ptype foo^ or if foo…
Martin wrote 21 lines
On 24/01/2016 14:06, Martin Schreiber wrote: > Hi, > For a "array of integer" type variable FPC 32bit stabs returns for gdb "ptype" > command > " > type = ^(array [0..-1] of LONGINT) > ". > MSEide uses this info to fetch the itemcount and item memory and to show the > array items in watches window. > FPC 64bit dwarf "ptype" returns > " > type = ^LONGINT > ". > How can we identify a dynamic array with FPC dwarf? > If I remember correctly then you can do (after you got above result) ptype foo^ or if foo is an expression ptype (foo)^ and this will return an array as ptype.

Dwarf-3 can handle dyn. arrays much better. What do you think about switching the default dwarf level from 2 to 3?

Reply by email

Martin
to Florian Klämpfl
Florian Klämpfl wrote
Dwarf-3 can handle dyn. arrays much better. What do you think about switching the default dwarf level from 2 to 3?

The last gdb I tested on win (32bit vista) was gdb 10.0 (current is 10.1)

And (IIRC) it still crashes (gdb exe has stopped working) with dwarf3.

This is when I run a great lot of queries on it, using the test case I have for the lazarus debug integration.

Reply by email

Martin Schreiber
to Martin
Martin wrote 8 lines
On 24/01/2016 16:03, Florian Klämpfl wrote: > Dwarf-3 can handle dyn. arrays much better. What do you think about > switching the default dwarf level from 2 to 3? The last gdb I tested on win (32bit vista) was gdb 10.0 (current is 10.1) And (IIRC) it still crashes (gdb exe has stopped working) with dwarf3.

Confirmed with Linux x64 gdb 7.9.1. gdb with FPC -gw3 crashes by many watches ("self",arrays,pointers...) and does not find uppercase queries for lowercase variables so the workaround for class variables can not be used. It is completely unusable for IDE purpose.

Martin

Reply by email