Sign in Join

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

Mailing lists / fpc-devel / 2022-03

MacOS/dwarf: Was there any change to how/when relocation info is included.

3 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

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

Martin Frb

It appears with 3.2.2  the address of a global var in dwarf already contains the relocation.
Since fpdebug, does not retrieve any relocation info from lldb, it does not adjust any addresses.

But with 3.3.1 it seems different.

https://forum.lazarus.freepascal.org/index.php?topic=58822.new#new

The test app has 2 global vars.
They can be inspected if compiled with 3.2.2.

But compile with 3.3.1 and fpdebug send the following to  lldb:   memory read --force --size 1 --format x --count 4 1008   memory read --force --size 1 --format x --count 4 1012 Looks like the offset within the exe, without relocation.

Was there an intentional change to introduce this?

Reply by email

Jonas Maebe
to Martin Frb
Martin Frb wrote 18 lines
It appears with 3.2.2  the address of a global var in dwarf already contains the relocation. Since fpdebug, does not retrieve any relocation info from lldb, it does not adjust any addresses. But with 3.3.1 it seems different. https://forum.lazarus.freepascal.org/index.php?topic=58822.new#new The test app has 2 global vars. They can be inspected if compiled with 3.2.2. But compile with 3.3.1 and fpdebug send the following to  lldb:   memory read --force --size 1 --format x --count 4 1008   memory read --force --size 1 --format x --count 4 1012 Looks like the offset within the exe, without relocation. Was there an intentional change to introduce this?

git diff -w tags/release_3_2_2..main compiler/dbgdwarf.pas doesn't really show any impactful changes between the two versions. tf_dwarf_relative_addresses is also still set in
compiler/systems/i_darwin.pas

Jonas

Reply by email

Martin Frb
to Jonas Maebe
Jonas Maebe wrote 15 lines
On 24/03/2022 01:57, Martin Frb via fpc-devel wrote: > It appears with 3.2.2  the address of a global var in dwarf already > contains the relocation. > Since fpdebug, does not retrieve any relocation info from lldb, it > does not adjust any addresses. > > But with 3.3.1 it seems different. > https://forum.lazarus.freepascal.org/index.php?topic=58822.new#new > > Was there an intentional change to introduce this? git diff -w tags/release_3_2_2..main compiler/dbgdwarf.pas doesn't really show any impactful changes between the two versions. tf_dwarf_relative_addresses is also still set in compiler/systems/i_darwin.pas

What else could case the diff?
Maybe the linker? But if the user has (at least as I understand it) both setups on the same pc, I would expect the same linker to be used? Different arguments when calling the linker?

I don't do much work on Mac myself.  All I have is the report on the forum.

But if he reported right, then both his IDE fail with 3.3.1.

I can't currently double check his report. Because if he got his testing wrong, then Fpdebug has changes by Joost for Linux and Win, how it handle relocation in dwarf....

Reply by email