<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><i>> It is now!</i></div></blockquote><div><br></div><div>Good :). Any plans to fix it? I guess I should just file a bug, right?</div><div><br></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><i>> The main question is what do you consider to be your "image address"?</i></div></blockquote><div><br></div><div>I need the address that I feed to <span style="font-size: 12pt;">SBTarget::SetModuleLoadAddress() if I load modules manually.</span></div><div><br></div><div>I iterated over module sections. As I understand, the base address is <span style="font-size: 12pt;">0x7fc7125ff000. I verified it by really calling SetModuleLoadAddress() and looking at stacks that LLDB produces. But to find it programmatically I'll need to do some math: pick any section with non-zero size and subtract its file address form its memory address. Hmm... seems like a workaround, but it would be better to have a more direct way.</span></div><div><span style="font-size: 12pt;"><br></span></div><div><font size="2" face="Courier New, sans-serif">(x86_64) /home/eugene/joe/so/libjemalloc.so.1</font></div><div><font size="2" face="Courier New, sans-serif">0xffffffffffffffff [0x0000000000000000-0x0000000000000000) libjemalloc.so.1.</font></div><div><font size="2" face="Courier New, sans-serif">0x7fc7125ff200 [0x0000000000000200-0x0000000000000224) libjemalloc.so.1..note.gnu.build-id</font></div><div><font size="2" face="Courier New, sans-serif">0x7fc7125ff228 [0x0000000000000228-0x0000000000000328) libjemalloc.so.1..gnu.hash</font></div><div><font size="2" face="Courier New, sans-serif">0x7fc7125ff328 [0x0000000000000328-0x0000000000000b08) libjemalloc.so.1..dynsym</font></div><div><font size="2" face="Courier New, sans-serif">0x7fc7125ffb08 [0x0000000000000b08-0x0000000000000f01) libjemalloc.so.1..dynstr</font></div><div><font size="2" face="Courier New, sans-serif">0x7fc7125fff02 [0x0000000000000f02-0x0000000000000faa) libjemalloc.so.1..gnu.version</font></div><div><font size="2" face="Courier New, sans-serif">0x7fc7125fffb0 [0x0000000000000fb0-0x0000000000001040) libjemalloc.so.1..gnu.version_r</font></div><div><font size="2" face="Courier New, sans-serif">0x7fc712600040 [0x0000000000001040-0x0000000000002c00) libjemalloc.so.1..rela.dyn</font></div><div><font size="2" face="Courier New, sans-serif">0x7fc712601c00 [0x0000000000002c00-0x0000000000003008) libjemalloc.so.1..rela.plt</font></div><div><font size="2" face="Courier New, sans-serif">0x7fc712602008 [0x0000000000003008-0x0000000000003022) libjemalloc.so.1..init</font></div><div><font size="2" face="Courier New, sans-serif">0x7fc712602030 [0x0000000000003030-0x00000000000032f0) libjemalloc.so.1..plt</font></div><div><font size="2" face="Courier New, sans-serif">0x7fc7126022f0 [0x00000000000032f0-0x00000000000286fa) libjemalloc.so.1..text</font></div><div><font size="2" face="Courier New, sans-serif">0x7fc7126276fc [0x00000000000286fc-0x0000000000028705) libjemalloc.so.1..fini</font></div><div><font size="2" face="Courier New, sans-serif">0x7fc712627740 [0x0000000000028740-0x000000000002a344) libjemalloc.so.1..rodata</font></div><div><font size="2" face="Courier New, sans-serif">0x7fc712629344 [0x000000000002a344-0x000000000002afa0) libjemalloc.so.1..eh_frame_hdr</font></div><div><font size="2" face="Courier New, sans-serif">0x7fc712629fa0 [0x000000000002afa0-0x000000000002fdcc) libjemalloc.so.1..eh_frame</font></div><div><font size="2" face="Courier New, sans-serif">0x7fc71282f710 [0x0000000000230710-0x0000000000230714) libjemalloc.so.1..tdata</font></div><div><font size="2" face="Courier New, sans-serif">0x7fc71282f718 [0x0000000000230718-0x0000000000230748) libjemalloc.so.1..tbss</font></div><div><font size="2" face="Courier New, sans-serif">0x7fc71282f718 [0x0000000000230718-0x0000000000230728) libjemalloc.so.1..init_array</font></div><div><font size="2" face="Courier New, sans-serif">0x7fc71282f728 [0x0000000000230728-0x0000000000230730) libjemalloc.so.1..fini_array</font></div><div><font size="2" face="Courier New, sans-serif">0x7fc71282f730 [0x0000000000230730-0x0000000000230738) libjemalloc.so.1..jcr</font></div><div><font size="2" face="Courier New, sans-serif">0x7fc71282f740 [0x0000000000230740-0x0000000000231d70) libjemalloc.so.1..data.rel.ro</font></div><div><font size="2" face="Courier New, sans-serif">0x7fc712830d70 [0x0000000000231d70-0x0000000000231f70) libjemalloc.so.1..dynamic</font></div><div><font size="2" face="Courier New, sans-serif">0x7fc712830f70 [0x0000000000231f70-0x0000000000232000) libjemalloc.so.1..got</font></div><div><font size="2" face="Courier New, sans-serif">0x7fc712831000 [0x0000000000232000-0x0000000000232170) libjemalloc.so.1..got.plt</font></div><div><font size="2" face="Courier New, sans-serif">0x7fc712831180 [0x0000000000232180-0x0000000000232209) libjemalloc.so.1..data</font></div><div><font size="2" face="Courier New, sans-serif">0x7fc712831220 [0x0000000000232220-0x00000000002334b0) libjemalloc.so.1..bss</font></div><div><font size="2" face="Courier New, sans-serif">0xffffffffffffffff [0x0000000000000000-0x0000000000000000) libjemalloc.so.1..gnu_debuglink</font></div><div><font size="2" face="Courier New, sans-serif">0xffffffffffffffff [0x0000000000000000-0x0000000000000000) libjemalloc.so.1..shstrtab</font></div><div><br></div>Thanks,<div>Eugene</div><div><br><div>> Subject: Re: [lldb-dev] How to load core on a different machine? - image base addresses<br>> From: gclayton@apple.com<br>> Date: Thu, 7 Jan 2016 09:35:40 -0800<br>> CC: lldb-dev@lists.llvm.org<br>> To: eugenebi@hotmail.com<br>> <br>> <br>> > On Jan 7, 2016, at 9:02 AM, Eugene Birukov <eugenebi@hotmail.com> wrote:<br>> > <br>> > Forking the thread since image list looks like an independent issue.<br>> > <br>> > • There is no image base addresses on Linux. Is this a known issue? <br>> <br>> It is now!<br>> <br>> > • I did not find any C++ API to get it in my program. Did I miss it? Seems useful...<br>> <br>> The main question is what do you consider to be your "image address"? For MachO files on MacOSX, it is the address of the mach header in memory. If the ELF header and all of the program headers and sections headers are actually in memory, then the address should be the address of the ELF header.<br>> <br></div></div> </div></body>
</html>