load-symbols [optional: FILENAME] (load symbols from /proc/self/maps) Normally, load-symbols works with no arguments. When GDB stack does not show any symbols, try this. This handles the case with one executable file loaded, such as attaching with GDB to a process restarted by DMTCP. There is _e
| 386 | |
| 387 | |
| 388 | class LoadSymbols(gdb.Command): |
| 389 | """load-symbols [optional: FILENAME] (load symbols from /proc/self/maps) |
| 390 | |
| 391 | Normally, load-symbols works with no arguments. When GDB stack does |
| 392 | not show any symbols, try this. |
| 393 | |
| 394 | This handles the case with one executable file loaded, such as attaching |
| 395 | with GDB to a process restarted by DMTCP. There is _experimental_ support |
| 396 | for when an executable was copied to a second address and the original |
| 397 | may or may not have been unmapped. |
| 398 | |
| 399 | If there is more than one executable binary loaded (e.g., split processes), |
| 400 | or if there are remaining frames on stack with no symbols, then you may |
| 401 | need to try using load-symbols-library, and select as an argument the |
| 402 | filename (or address in /proc/*/maps) for the specific binary desired.""" |
| 403 | |
| 404 | def __init__(self): |
| 405 | super(LoadSymbols, |
| 406 | self).__init__("load-symbols", |
| 407 | gdb.COMMAND_FILES, gdb.COMPLETE_FILENAME) |
| 408 | self.dont_repeat() |
| 409 | |
| 410 | def invoke(self, filename, from_tty): |
| 411 | if filename: |
| 412 | filename = os.path.abspath(filename) |
| 413 | load_symbols(filename.split()[0]) |
| 414 | else: |
| 415 | load_symbols() |
| 416 | # This will add the new gdb command: load-symbols |
| 417 | LoadSymbols() |
| 418 |