Exciting Features in Recent GDB Versions

 
 
 
Some good stuff in more recent GDB versions
 
-
debuginfod
-
user-defined commands
-
better backtraces
-
TUI + Python awesomeness
-
compile command
-
condition breakpoint fix
text (i.e. code)
ELF, DWARF, processes and debuggers
gcc -g3 hello.c
symbol table
debug info
rodata (e.g. strings)
data (e.g. non-zero globals)
=> 
a.out
process
GDB
Source code
Separating debuginfo
Either:
cp a.out a.out.dbg && strip a.out
Or:
objcopy --only-keep-debug a.out a.out.dbg
objcopy --add-gnu-debug-link=a.out.dbg a.out
Or:
gcc -gsplit-dwarf -g3 hello.c
 
debuginfod
 
debuginfod serves debug information over HTTP
 
(a bit like Microsoft Symbol Server)
 
sudo apt install debuginfod
debuginfod
DEBUGINFOD_URLS=localhost:8002 gdb a.out
 
 
debuginfod servers
 
https://debuginfod.elfutils.org/
Federated to Debian, OpenSUSE, CentOS debuginfod servers.
Client support in GDB, Valgrind, SystemTap
Better user-defined commands
 
define-prefix abc xyz
Names can now use ‘.’ character
The 
with
 command
| CMD | shell
set may-call-functions on|off
print
 & 
eval
 now will not call in the inferior for string args.
 
Better backtraces
 
set print frame-arguments  
all | none | presence | scalars
set print frame-info
 
auto | location | location-and-address | short-location |
source-and-location | source-line
 
 
 
 
 
 
Output styling
 
set style enabled on|off
 
ptype /xo
 
 
New convenience variables
 
$_gdb_major $_gdb_minor
$_gdb_setting $_gdb_setting_str
$_shell_exitcode $_shell_exitsignal
 
Symbol worker threads
 
maintenance show worker-threads
 
Optional in v9, on by default in v10 and v11
 
Python TUI
 
 
compile
 command
 
 
Conditional breakpoint fix
 
Slide Note
Embed
Share

Discover the latest advancements in GDB versions, including debuginfod, user-defined commands, improved backtraces, TUI enhancements, Python integration, streamlined compilation processes, ELF/DWARF insights, debuginfo separation techniques, and more. Unleash the power of debuginfod servers, federated support, better command customization, advanced backtrace options, output styling controls, new convenience variables, and symbol worker thread management.

  • GDB
  • Debugging
  • Software Development
  • ELF/DWARF
  • Debuginfo

Uploaded on Nov 18, 2024 | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.

E N D

Presentation Transcript


  1. Some good stuff in more recent GDB versions - - - - - - debuginfod user-defined commands better backtraces TUI + Python awesomeness compile command condition breakpoint fix

  2. ELF, DWARF, processes and debuggers => a.out gcc -g3 hello.c process text (i.e. code) GDB data (e.g. non-zero globals) rodata (e.g. strings) symbol table debug info Source code

  3. Separating debuginfo Either: cp a.out a.out.dbg && strip a.out Or: objcopy --only-keep-debug a.out a.out.dbg objcopy --add-gnu-debug-link=a.out.dbg a.out Or: gcc -gsplit-dwarf -g3 hello.c

  4. debuginfod debuginfod serves debug information over HTTP (a bit like Microsoft Symbol Server) sudo apt install debuginfod debuginfod DEBUGINFOD_URLS=localhost:8002 gdb a.out

  5. debuginfod servers https://debuginfod.elfutils.org/ Federated to Debian, OpenSUSE, CentOS debuginfod servers. Client support in GDB, Valgrind, SystemTap

  6. Better user-defined commands define-prefix abc xyz Names can now use . character The with command | CMD | shell set may-call-functions on|off print & eval now will not call in the inferior for string args.

  7. Better backtraces set print frame-arguments all | none | presence | scalars set print frame-info auto | location | location-and-address | short-location | source-and-location | source-line

  8. Output styling set style enabled on|off

  9. ptype /xo

  10. New convenience variables $_gdb_major $_gdb_minor $_gdb_setting $_gdb_setting_str $_shell_exitcode $_shell_exitsignal

  11. Symbol worker threads maintenance show worker-threads Optional in v9, on by default in v10 and v11

  12. Python TUI

  13. compile command

  14. Conditional breakpoint fix

Related


More Related Content

giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#