View Issue Details

IDProjectCategoryView StatusLast Update
0018508FPCCompilerpublic2011-01-15 13:40
ReporterMartin Friebe Assigned ToJoost van der Sluis  
PrioritynormalSeverityminorReproducibilityalways
Status assignedResolutionopen 
Platformw32OSwin 
Product Version2.5.1 
Summary0018508: Dwarf 3 and string/array types
Descriptionusing dwarf 3, and the special patched gdb by Joost there are some errors when trying to access debug info about arrays and strings.

mainly when doing "ptype SomeType" instead of "ptype SomeVar"

The info below is gathered about arrays, but similiar issues habben with stings (e.g "ptype AnsiString")


The following types/vars are used in the example
(Variable names are postfixed with an "A", if they have an inline/anonymous type, rather than a named/declared type)

All types and variables can be found in the lazarus gdbmi test-case

  type
    TDynIntArray = Array of Integer;
    PDynIntArray = ^TDynIntArray;
    TStatIntArray = Array [5..9] of Integer;
    PStatIntArray = ^TStatIntArray;
  var
    VarDynIntArray: TDynIntArray;
    VarStatIntArray: TStatIntArray;
    VarPDynIntArray: PDynIntArray;
    VarPStatIntArray: PStatIntArray;
    VarDynIntArrayA: Array of Integer;
    VarStatIntArrayA: Array [5..9] of Integer;

    TFoo = class
    public
      ValueInt: Integer;
      ValueFoo: TFoo;
      ValueRec: TRec;
      FooText: string[20]; // about this line
      property PropInt: Integer read ValueInt write ValueInt;
    end;
Steps To Reproducerun all of the following.
run them with ptype, whatis and -data-evaluate-expression

break on line 113 of WatchesPrg.pas in the lazarus gdbmi test case

ptype VarDynIntArray
ptype VarStatIntArray
ptype VarPDynIntArray
ptype VarPStatIntArray
ptype VarDynIntArrayA
ptype VarStatIntArrayA

ptype @VarDynIntArray
ptype @VarStatIntArray
ptype @VarPDynIntArray
ptype @VarPStatIntArray
ptype @VarDynIntArrayA
ptype @VarStatIntArrayA

// should ^ fail for static arrays?
ptype VarDynIntArray^
ptype VarStatIntArray^
ptype VarPDynIntArray^
ptype VarPDynIntArray^^
ptype VarPStatIntArray^
ptype VarPStatIntArray^^
ptype VarDynIntArrayA^
ptype VarStatIntArrayA^

ptype VarDynIntArray[0]
ptype VarStatIntArray[5]
ptype VarPDynIntArray[0]
ptype VarPDynIntArray^[0]
ptype VarPStatIntArray[5]
ptype VarPStatIntArray^[5]
ptype VarDynIntArrayA[0]
ptype VarStatIntArrayA[5]


ptype TDynIntArray
ptype TStatIntArray
ptype PDynIntArray
ptype PStatIntArray

Additional Information
* "ptype" and "whatis" for variables, seems to work.

However the last whatis shows a different range. This may be ok, because with "whatis" gdb resolves only one step in the type chain. So that may just be the info found
  <ptype VarDynIntArray> ~"type = array [0..1] of LongInt\n" #GOOD
  <ptype VarDynIntArrayA> ~"type = array [0..1] of LongInt\n"
  <whatis VarDynIntArray> ~"type = TDynIntArray\n" #GOOD
  <whatis VarDynIntArrayA> ~"type = array [0..-4220246888] of LongInt\n"


* ptype on the types (dyn-array) itself fails (same for "ptype AnsiString"

  <ptype TDynIntArray> ^error,msg="Cannot resolve DW_OP_push_object_address for a missing object"
  <whatis TDynIntArray> ^error,msg="Cannot resolve DW_OP_push_object_address for a missing object"


* Resolving pointer to variables fails sometimes

<ptype @VarDynIntArray>
~"type = ^"
^error,msg="Cannot resolve DW_OP_push_object_address for a missing object"

* same for declared pointer types (dyn-array) (but types failed above anyway)

<ptype PDynIntArray> ^error,msg="Cannot resolve DW_OP_push_object_address for a missing object"



**** static arrays

<ptype VarStatIntArray> ~"type = array [5..9] of LongInt\n" #GOOD

<ptype @VarStatIntArray> ~"type = ^LongInt\n"
<ptype PStatIntArray> ~"type = ^LongInt\n"



*** strings:
This works if ArgTFoo is not dereferenced (^)

<ptype ArgTFoo^>
&"ptype ArgTFoo^\n"
~"type = TFoo = class : public TObject \n"
~" public\n"
~" ValueInt : LongInt;\n"
~" ValueFoo : TFoo;\n"
~" ValueRec : TRec;\n"
~" FooText : array of "
&"Cannot resolve DW_OP_push_object_address for a missing object\n"
^error,msg="Cannot resolve DW_OP_push_object_address for a missing object"
(gdb)
 
TagsNo tags attached.
Fixed in Revision
FPCOldBugId
FPCTarget
Attached Files

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2011-01-15 00:24 Martin Friebe New Issue
2011-01-15 13:40 Jonas Maebe Status new => assigned
2011-01-15 13:40 Jonas Maebe Assigned To => Joost van der Sluis