https://bugs.kde.org/show_bug.cgi?id=353192

--- Comment #17 from Paul Floyd <[email protected]> ---
(In reply to Fredrik Tolf from comment #16)
> (In reply to Paul Floyd from comment #15)
> > Valgrind has its own DWARF reader.
> 
> Certainly; I didn't mean to imply that Valgrind should actually call on gdb,
> I just used "info line *$address" as an example of fetching the symbol for a
> "file offset" address.
> 
> > The problem here is detecting the conditions that trigger 
> > looking in a segment for symbols.
> 
> I'm sorry if I'm missing something again (not being a Valgrind developer, I
> haven't needed to delve deeply into the concrete debug-info formats and
> whatnot), but "looking in a segment for symbols" sounds needlessly
> complicated from my naïve perspective. My perspective is to look at it more
> as "finding the symbol for a file offset". Is that perspective not valid?
> You mention generating symbols for Valgrind itself as well; given that
> Valgrind is also mapped into the guest's address space, wouldn't that work
> for that case just as well?

We need to look for redirects when an executable segment is loaded. At the same
time we also record the memory range and the associated ELF file. I don't
remember if we do anything with the DWARF segement at that time, I suspect not.

It's the other way around - the guest is mapped into Valgrind's address space.
Valgrind mmap's the guest binary and ld.so.

> > My concern is that some of the platform hard-codedness may be really
> > necessary.
> 
> Interesting. Are we talking about embedded architectures, or something?

No, just that every architecture seems to be different with many special cases.

> What
> would be an example of a platform where you can't match a guest address to a
> file path and offset? Or am I misunderstanding the problem?

That is what we do, but only when we have decided that the memory was loaded
from some variation of rw- or r-x segments. And that can be quite tricky,
especially for the tool binary.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to