Bug 21623 - add-symbol-file not loading symbols at the provided .text offset
Summary: add-symbol-file not loading symbols at the provided .text offset
Status: UNCONFIRMED
Alias: None
Product: gdb
Classification: Unclassified
Component: gdb (show other bugs)
Version: 8.0
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-06-19 14:48 UTC by Kamran Khan
Modified: 2017-07-09 23:13 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kamran Khan 2017-06-19 14:48:41 UTC
On a guest VM:

> # cat /sys/module/dm_crypt/sections/{.text,.data}
> 0xffffffffa049f000
> 0xffffffffa04a4000

Debugger:

> (gdb) add-symbol-file drivers/md/dm-crypt.ko 0xffffffffa049f000 -s .data 0xffffffffa04a4000
> add symbol table from file "drivers/md/dm-crypt.ko" at
>         .text_addr = 0xffffffffa049f000
>         .data_addr = 0xffffffffa04a4000
> (y or n) y
> Reading symbols from drivers/md/dm-crypt.ko...done.
> (gdb) p crypt_target.version
> $1 = {1, 15, 0}
> (gdb) info addr crypt_target
> Symbol "crypt_target" is static storage at address 0xffffffffa04a4020.
> (gdb) info addr dm_crypt_exit
> Symbol "dm_crypt_exit" is a function at address 0x4e.
> (gdb) b dm_crypt_exit
> Cannot access memory at address 0x4e
Comment 1 Kamran Khan 2017-07-09 23:13:50 UTC
Ping.. This can be repro-ed reliably using gdb-8 and any 4.10 series kernel.