[cfe-dev] Gain Addresses from a Debug file

Halfdan Ingvarsson via cfe-dev cfe-dev at lists.llvm.org
Mon Aug 28 09:01:12 PDT 2017


1. With a PDB, you can use the DbgHelp library on Windows to enumerate the
executable's symbols and their relative addresses within the executable
(see http://bit.ly/2vD5aG1)
2. No. Assembling object files into an executable is not a one-to-one
thing. Functions are moved around, duplicates and unused deleted, and so
forth. Since the linker doesn't store this mapping -- except in the form of
a final debug data for the executable -- mapping the individual objects'
debug data onto the executable is generally neither feasible nor
recommended.



- ½

On 28 August 2017 at 08:22, via cfe-dev <cfe-dev at lists.llvm.org> wrote:

> Dear friendly Clang-World,
>
> currently I try some variation of a Debugger. I have one process, which
> starts another process and gains access to its memory. Like a debugger,
> this process now should read the value of a global variable directly from
> the other process. But I don't know the address. So I pleased the clang-cl
> compiler to generate me a dwarf-debug-file. But in the end, I will have
> only dwarf files for the .obj-files, but the .exe will have a pdb-file.
> Using the llvm pdb-dump didn't help me finding the address, because the
> application will crash while dumping. The single-dwarf file for my object
> file didn't helped too. So I wanted to ask:
>
> 1.) Is there a way how I could gain the address of the global variable
> from any debug-format under Windows using clang-cl?
> 2.) Can I use a single dwarf-file with its .obj-file to gain an address?
> This would be interessting for jitting this obj-file.
>
> Kind regards
> Björn Gaier
> Als GmbH eingetragen im Handelsregister Bad Homburg v.d.H. HRB 9816,
> USt.ID-Nr. DE 114 165 789
> Geschäftsführer: Hiroshi Kawamura, Dr Hiroshi Nakamura, Markus Bode, Heiko
> Lampert, Takashi Nagano, Takeshi Fukushima.
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20170828/24fbdf2d/attachment.html>


More information about the cfe-dev mailing list