gdb add-symbol-file命令

origin: http://www.delorie.com/gnu/docs/gdb/gdb_125.html
add-symbol-file filename address

add-symbol-file filename address [ -readnow ] [ -mapped ]

add-symbol-file filename -ssection address ...
The add-symbol-file command reads additional symbol tableinformation from the file filename. You would use this commandwhen filename has been dynamically loaded (by some other means)into the program that is running. address should be the memoryaddress at which the file has been loaded; GDB cannot figurethis out for itself. You can additionally specify an arbitrary numberof `-ssection address' pairs, to give an explicitsection name and base address for that section. You can specify any address as an expression.

The symbol table of the file filename is added to the symbol tableoriginally read with the symbol-file command. You can use theadd-symbol-file command any number of times; the new symbol datathus read keeps adding to the old. To discard all old symbol datainstead, use the symbol-file command without any arguments.

Although filename is typically a shared library file, anexecutable file, or some other object file which has been fullyrelocated for loading into a process, you can also load symbolicinformation from relocatable `.o' files, as long as:

  • the file's symbolic information refers only to linker symbols defined inthat file, not to symbols defined by other object files,
  • every section the file's symbolic information refers to has actuallybeen loaded into the inferior, as it appears in the file, and
  • you can determine the address at which every section was loaded, andprovide these to the add-symbol-file command.

Some embedded operating systems, like Sun Chorus and VxWorks, can loadrelocatable files into an already running program; such systemstypically make the requirements above easy to meet. However, it'simportant to recognize that many native systems use complex linkprocedures (.linkonce section factoring and C++ constructor tableassembly, for example) that make the requirements difficult to meet. Ingeneral, one cannot assume that using add-symbol-file to read arelocatable object file's symbolic information will have the same effectas linking the relocatable object file into the program in the normalway.

add-symbol-file does not repeat if you press RET after using it.

You can use the `-mapped' and `-readnow' options just as withthe symbol-file command, to change how GDB manages the symboltable information for filename.


  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值