This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: core file / executable + shared library base address


Am Samstag, 26. Januar 2019, 16:39:55 MEZ hat Hannes Domani via gdb <gdb@sourceware.org> Folgendes geschrieben:

> I'm trying to implement a new core file format, and I'm stuck with:
> - tell gdb that it should load the shared libraries on a specific base address
> - in case of ASLR, tell gdb to load the executable on a different base address
> 
> I'm not even sure if these are the same problem or not.
> 
> My best guess so far is that uses ".dynamic" sections, but even if this is
> true, I couldn't find the actual code where this section was then used in gdb.

Never mind, I think I figured it out (I added a new custom section, kinda like it was done
for ".module/XXX" sections in windows-tdep.c).
And for the executable base address, I used objfile_rebase() for relocation, similar to
how it was done solib-darwin.c.

My first simple tests looks good, now I will have to try with bigger executables, and multiple threads.


Regards
Domani Hannes


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]