On 14 Mar 2009, at 15:42, Paul Ishenin wrote:

Tomas Hajny wrote:
Keeping -gl instead of -gw?

Sorry, "leave out" was not in my head dictionary :)

c:\programming\fpc\bin\i386-win32\ppc386.exe -gw test.pp

(gdb) break test.pp:8
invalid dwarf2 offset 4243567

In the mean time, we got basic debugging working. There's one problem left I'm not sure how to solve though. In the DWARF compilation unit header, you have to record the start and the end address of the code in that compilation unit (= object file). We currently do this by inserting a ".text" section at the start of the object file with a start label, and one at the end of the object file with an end label.

On Win32 however, we don't put any code in a plain ".text" section. We put all code is sections called like ".text.n_p$test_proc" and ".text.n__main". The linker script afterwards groups all .text* sections, but it puts the plain ".text" sections first. As a result, all these start and end labels end up at exactly the same location: at the very beginning of the code section of the entire application, rather than at the individual start and end addresses of the code from the individual object files.

I don't immediately see how to fix this. Maybe be we can put those labels at the start and end of the al_procedures assembler lists for Windows, but I don't know whether we never put .text* sections in any other assembler lists.


Jonas
_______________________________________________
fpc-devel maillist  -  [email protected]
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to