<br><br><div class="gmail_quote">On 25 November 2010 12:33, marius zbihlei <span dir="ltr"><<a href="mailto:marius.zbihlei@1and1.ro">marius.zbihlei@1and1.ro</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div text="#000000" bgcolor="#ffffff"><div><div></div><div class="h5">
On 11/25/2010 01:31 PM, dotnetdub wrote:
</div></div><blockquote type="cite">
<div class="gmail_quote"><div><div></div><div class="h5"><br>
<div>
<div>There are 36 section headers, starting at offset 0x17b34:</div>
<div><br>
</div>
<div>Section Headers:</div>
<div> [Nr] Name Type Addr Off Size
ES Flg Lk Inf Al</div>
<div> [ 0] NULL 00000000 000000 000000
00 0 0 0</div>
<div> [ 1] .hash HASH 000000b4 0000b4 000498
04 A 3 0 4</div>
<div> [ 2] .gnu.hash GNU_HASH 0000054c 00054c 0002d8
04 A 3 0 4</div>
<div> [ 3] .dynsym DYNSYM 00000824 000824 000650
10 A 4 1 4</div>
<div> [ 4] .dynstr STRTAB 00000e74 000e74 000581
00 A 0 0 1</div>
<div> [ 5] .gnu.version VERSYM 000013f6 0013f6 0000ca
02 A 3 0 2</div>
<div> [ 6] .gnu.version_r VERNEED 000014c0 0014c0 000030
00 A 4 1 4</div>
<div> [ 7] .rel.dyn REL 000014f0 0014f0 0001d0
08 A 3 0 4</div>
<div> [ 8] .rel.plt REL 000016c0 0016c0 000210
08 A 3 10 4</div>
<div> [ 9] .init PROGBITS 000018d0 0018d0 000030
00 AX 0 0 4</div>
<div> [10] .plt PROGBITS 00001900 001900 000430
04 AX 0 0 4</div>
<div> [11] .text PROGBITS 00001d30 001d30 0080d8
00 AX 0 0 16</div>
<div> [12] .fini PROGBITS 00009e08 009e08 00001c
00 AX 0 0 4</div>
<div> [13] .rodata PROGBITS 00009e24 009e24 001618
01 AMS 0 0 4</div>
<div> [14] .eh_frame PROGBITS 0000b43c 00b43c 000004
00 A 0 0 4</div>
<div> [15] .ctors PROGBITS 0000c440 00b440 000008
00 WA 0 0 4</div>
<div> [16] .dtors PROGBITS 0000c448 00b448 000008
00 WA 0 0 4</div>
<div> [17] .jcr PROGBITS 0000c450 00b450 000004
00 WA 0 0 4</div>
<div> [18] .dynamic DYNAMIC 0000c454 00b454 0000c8
08 WA 4 0 4</div>
<div> [19] .got PROGBITS 0000c51c 00b51c 00006c
04 WA 0 0 4</div>
<div> [20] .got.plt PROGBITS 0000c588 00b588 000114
04 WA 0 0 4</div>
<div> [21] .data PROGBITS 0000c6a0 00b6a0 00012c
00 WA 0 0 32</div>
<div> [22] .bss NOBITS 0000c7e0 00b7cc 0004a0
00 WA 0 0 32</div>
<div> [23] .comment PROGBITS 00000000 00b7cc 0000d9
00 0 0 1</div>
<div> [24] .debug_aranges PROGBITS 00000000 00b8a8 0000b0
00 0 0 8</div>
<div> [25] .debug_pubnames PROGBITS 00000000 00b958 000448
00 0 0 1</div>
<div> [26] .debug_info PROGBITS 00000000 00bda0 005dd1
00 0 0 1</div>
<div> [27] .debug_abbrev PROGBITS 00000000 011b71 0007a8
00 0 0 1</div>
<div> [28] .debug_line PROGBITS 00000000 012319 0014b9
00 0 0 1</div>
<div> [29] .debug_frame PROGBITS 00000000 0137d4 0004b0
00 0 0 4</div>
<div> [30] .debug_str PROGBITS 00000000 013c84 001d76
01 MS 0 0 1</div>
<div> [31] .debug_loc PROGBITS 00000000 0159fa 001ebe
00 0 0 1</div>
<div> [32] .debug_ranges PROGBITS 00000000 0178b8 000140
00 0 0 8</div>
<div> [33] .shstrtab STRTAB 00000000 0179f8 00013b
00 0 0 1</div>
<div> [34] .symtab SYMTAB 00000000 0180d4 0009e0
10 35 58 4</div>
<div> [35] .strtab STRTAB 00000000 018ab4 0006ec
00 0 0 1</div>
<div>Key to Flags:</div>
<div> W (write), A (alloc), X (execute), M (merge), S (strings)</div>
<div> I (info), L (link order), G (group), x (unknown)</div>
<div> O (extra OS processing required) o (OS specific), p (processor
specific)</div>
</div>
<div><br>
</div>
<div><br>
</div>
</div></div><blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex">
<div text="#000000" bgcolor="#ffffff">in the gdb console load the
topoh.so<div class="im"><br>
<br>
add-symbol-file /path/to/topoh.so 0xb7004000 + 0x<offset of .text
segment found as above> <br>
<br>
</div></div>
</blockquote>
<div><br>
</div>
<div>Ok.</div>
<div><br>
</div>
</div>
</blockquote>
Hello <br>
<br>
Did you give gdb the command <br>
add-symbol-file /path/to/topoh.so 0xb7004000+0x00001d30<br></div></blockquote><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div text="#000000" bgcolor="#ffffff">
<br>
Gdb should inquire you if you want to lead topoh.so at offset
0xb7005d30 (press 'y'). Then the IP should not be out of bounds ... it
should be mapped to the topoh.so text segment. Ah, I have made a
mistake, there should be no spaces between the address and the offset
(as seen above)<br>
<br>
Anyway you should get something like this (on my machine - on your use
the offsets from above)<br>
(gdb) add-symbol-file modules/topoh/topoh.so 0xb7004000+0x00001d80<br>
add symbol table from file "modules/topoh/topoh.so" at<br>
.text_addr = 0xb7005d80<br>
(y or n) y<br>
Reading symbols from
/home/marius/dev/sip-router/modules/topoh/topoh.so...done.<br>
<br>
Then<br>
(gdb) x/s 0xb70070d9<br>
!!!!!!!!!!!!!!!!!!0xb70070d9 <th_get_hdr_cookie+25>:
<Address 0xb70070d9 out of bounds>!!!!!!!!!!!!!!!!!<br>
<br>
The line between all the !!!!!! is the line I care about<br>
<br>
<br>
Also don't forget <br>
(gdb)info registers<br>
<br>
Thank you <br>
Marius<br></div></blockquote><div><br></div><div>Hi Marius,</div><div><br></div><div><div>I hope this is what your after!</div></div><div><br></div><div><div>(gdb) add-symbol-file /lib/kamailio/modules/topoh.so 0xb7004000+0x00001d30</div>
<div>add symbol table from file "/lib/kamailio/modules/topoh.so" at</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>.text_addr = 0xb7005d30</div><div>(y or n) y</div><div>Reading symbols from /lib/kamailio/modules/topoh.so...done.</div>
<div>(gdb) x/s 0xb70070d9</div><div>0xb70070d9 <th_skip_msg+9>:<span class="Apple-tab-span" style="white-space:pre"> </span> <Address 0xb70070d9 out of bounds></div><div>(gdb) info registers </div><div>eax 0xbf916160<span class="Apple-tab-span" style="white-space:pre"> </span>-1080991392</div>
<div>ecx 0x0<span class="Apple-tab-span" style="white-space:pre"> </span>0</div><div>edx 0x2<span class="Apple-tab-span" style="white-space:pre"> </span>2</div><div>ebx 0xb7010588<span class="Apple-tab-span" style="white-space:pre"> </span>-1224669816</div>
<div>esp 0xbf916118<span class="Apple-tab-span" style="white-space:pre"> </span>0xbf916118</div><div>ebp 0xbf916118<span class="Apple-tab-span" style="white-space:pre"> </span>0xbf916118</div><div>esi 0xbf916160<span class="Apple-tab-span" style="white-space:pre"> </span>-1080991392</div>
<div>edi 0x82500c0<span class="Apple-tab-span" style="white-space:pre"> </span>136642752</div><div>eip 0xb70070d9<span class="Apple-tab-span" style="white-space:pre"> </span>0xb70070d9 <th_skip_msg+9></div>
<div>eflags 0x10246<span class="Apple-tab-span" style="white-space:pre"> </span>[ PF ZF IF RF ]</div><div>cs 0x73<span class="Apple-tab-span" style="white-space:pre"> </span>115</div><div>ss 0x7b<span class="Apple-tab-span" style="white-space:pre"> </span>123</div>
<div>ds 0x7b<span class="Apple-tab-span" style="white-space:pre"> </span>123</div><div>es 0x7b<span class="Apple-tab-span" style="white-space:pre"> </span>123</div><div>fs 0x0<span class="Apple-tab-span" style="white-space:pre"> </span>0</div>
<div>gs 0x33<span class="Apple-tab-span" style="white-space:pre"> </span>51</div></div><div><br></div><div><br></div><div>Thanks</div><div>Brian</div><div><br></div><div><br></div><div> </div></div><br>