Browse Source

+ debug info for register variables

git-svn-id: trunk@2410 -
florian 19 years ago
parent
commit
e1e611b86e
1 changed files with 7 additions and 6 deletions
  1. 7 6
      compiler/dbgdwarf.pas

+ 7 - 6
compiler/dbgdwarf.pas

@@ -25,6 +25,10 @@
   Currently a lot of code looks like being mergable with dbgstabs. This might
   Currently a lot of code looks like being mergable with dbgstabs. This might
   change however when improved dwarf info is generated, so the stuff shouldn't be
   change however when improved dwarf info is generated, so the stuff shouldn't be
   merged yet. (FK)
   merged yet. (FK)
+  
+  The easiest way to debug dwarf debug info generation is the usage of
+  readelf --debug-dump <executable>
+  This works only with elf targets though.
 }
 }
 unit dbgdwarf;
 unit dbgdwarf;
 
 
@@ -1208,13 +1212,10 @@ implementation
               LOC_FPUREGISTER,
               LOC_FPUREGISTER,
               LOC_CFPUREGISTER :
               LOC_CFPUREGISTER :
                 begin
                 begin
-                {
                   regidx:=findreg_by_number(sym.localloc.register);
                   regidx:=findreg_by_number(sym.localloc.register);
-                  { "eax", "ecx", "edx", "ebx", "esp", "ebp", "esi", "edi", "eip", "ps", "cs", "ss", "ds", "es", "fs", "gs", }
-                  { this is the register order for GDB}
-                  if regidx<>0 then
-                    result:=sym_stabstr_evaluate(sym,'"${name}:r$1",${N_RSYM},0,${line},$2',[st,tostr(regstabs_table[regidx])]);
-                }
+                  templist.concat(tai_const.create_8bit(ord(DW_OP_regx)));
+                  templist.concat(tai_const.create_uleb128bit(regdwarf_table[regidx]));
+                  blocksize:=Lengthuleb128(regdwarf_table[regidx])+1;
                 end;
                 end;
               else
               else
                 begin
                 begin