Sign in Join

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

Mailing lists / fpc-devel / 2011-10

stabs on Mac / relocation issue?

9 messages · 4 people ·

Reply by email Subscribe to this list Your subscription

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

Martin

Is there a known issue on Mac?

The following was observed on 2 different 32 bit Mac:

compiling from lazarus tests/lazutils/testunicode.lpi with -gs / also entire LCL compiled with -gs / standard fpc 2.4.4 installation (I would assume that does not have dwarf? but I do not know)

info line
"/Users/felipe/Programas/lazarus/test/lazutils/testunicode.pas":182

&"info line
\"/Users/felipe/Programas/lazarus/test/lazutils/testunicode.pas\":182\n" ~"Line 182 of \"testunicode.pas\" starts at address 0xedb and ends at 0xef6.\n"
^done

same address when trying to insert a breakpoint

-break-insert -f testunicode.pas:182
^done,bkpt={number="11",type="breakpoint",disp="keep",enabled="y",addr="0x00000edb",file="testunicode.pas",line="182",shlib="/Users/felipe/Programas/lazarus/test/lazutils/testunicode",times="0"},time={wallclock="0.00016",user="0.00016",system="0.00001",start="1318483988.064643",end="1318483988.064808"} (gdb)

running, pausing, and using the disassembler on the stackframe containing that code, shows addresses in the 0x011xxx range.

So it seems the symbols are not relocated?

Reply by email

Jonas Maebe
to Martin
Martin wrote 10 lines
same address when trying to insert a breakpoint -break-insert -f testunicode.pas:182 ^done,bkpt={number="11",type="breakpoint",disp="keep",enabled="y",addr="0x00000edb",file="testunicode.pas",line="182",shlib="/Users/felipe/Programas/lazarus/test/lazutils/testunicode",times="0"},time={wallclock="0.00016",user="0.00016",system="0.00001",start="1318483988.064643",end="1318483988.064808"} (gdb) running, pausing, and using the disassembler on the stackframe containing that code, shows addresses in the 0x011xxx range. So it seems the symbols are not relocated?

It's not specific to FPC:

Breakpoint 1, 0x00001fdc in main () at tt.c:7
7 }
(gdb) info line 6
Line 6 of "tt.c" starts at address 0x1c and

Reply by email

Felipe Monteiro de Carvalho
to Jonas Maebe

Hello,

Then maybe the default debug info created by -g on Mac should be dwarf2? dwarf2 works correctly in my tests.

Is there a table somewhere about which debug info types are default in each operating system?

Felipe Monteiro de Carvalho

Reply by email

Jonas Maebe
to Felipe Monteiro de Carvalho
Felipe Monteiro de Carvalho wrote
Then maybe the default debug info created by -g on Mac should be dwarf2? dwarf2 works correctly in my tests.

Yes, I agree it's about time to change that (along with making - godwarfsets the default). It requires at least the latest gdb from Mac OS X 10.5 to work correctly, but that should be no problem anymore.

Is there a table somewhere about which debug info types are default in each operating system?

No, and such table will not be made because it's an implementation detail. If you require a particular debug information format, specify it. Anything else will break as soon as the default is changed from one compiler version to another.

Jonas

Reply by email

Jonas Maebe
to Jonas Maebe
Jonas Maebe wrote 7 lines
On 13 Oct 2011, at 10:17, Felipe Monteiro de Carvalho wrote: > Then maybe the default debug info created by -g on Mac should be > dwarf2? dwarf2 works correctly in my tests. Yes, I agree it's about time to change that (along with making - godwarfsets the default).

One downside is that -gl doesn't work with DWARF on Mac OS X though (because it's not implemented, and requires a completely different implementation compared to other platforms).

Jonas

Reply by email

Martin
to Jonas Maebe: Yes, I agree it's about time to change that (along with making - godwarfsets the…
Jonas Maebe wrote 9 lines
> Is there a table somewhere about which debug info types are default in > each operating system? No, and such table will not be made because it's an implementation detail. If you require a particular debug information format, specify it. Anything else will break as soon as the default is changed from one compiler version to another.

But maybe a switch could be added, where an fpc exe gives feedback, what it currently defaults to?

Reply by email

Jonas Maebe
to Martin
Martin wrote 9 lines
On 13/10/2011 09:37, Jonas Maebe wrote: > > No, and such table will not be made because it's an implementation > detail. If you require a particular debug information format, > specify it. Anything else will break as soon as the default is > changed from one compiler version to another. > But maybe a switch could be added, where an fpc exe gives feedback, what it currently defaults to?

If you depend on a particular debug format, set it. If you don't, then the compiler doesn't need extra code to tell you. Besides, what the debug format is for a particular file does not tell you anything about other code in the program anyway.

Jonas

Reply by email

Marco van de Voort
to Martin: But maybe a switch could be added, where an fpc exe gives feedback, what it currently…

In our previous episode, Martin said:

Show quoted text 5 lines
> it. Anything else will break as soon as the default is changed from > one compiler version to another. > But maybe a switch could be added, where an fpc exe gives feedback, what it currently defaults to?

in the case of the multiple RTL situation, the target designation gets enhanced with the encoding (or at least 1byte/2byte, since it might be possible to switch a 1byte RTL to be either utf8 or ansi by changing the default codepage)

Reply by email

Jonas Maebe
to Marco van de Voort
Marco van de Voort wrote 10 lines
In our previous episode, Martin said: > But maybe a switch could be added, where an fpc exe gives feedback, > what > it currently defaults to? in the case of the multiple RTL situation, the target designation gets enhanced with the encoding (or at least 1byte/2byte, since it might be possible to switch a 1byte RTL to be either utf8 or ansi by changing the default codepage)

As the subject indicates, this thread is about the debug format. It is unrelated to strings.

Jonas

Reply by email