淺入淺出 GDB

  • 1,283 views
Uploaded on

 

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
1,283
On Slideshare
0
From Embeds
0
Number of Embeds
1

Actions

Shares
Downloads
47
Comments
0
Likes
1

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. GNU Debugger
  • 2. Debugger!
  • 3. Debugger ?
  • 4. bug
  • 5. ?
  • 6. !
  • 7. bug ?
  • 8. debug
  • 9. ↑ ↑ ↓ ↓ ← → ← → BA
  • 10. printf
  • 11. RUNTIME TRACING
  • 12. DYNAMIC ANALYSIS
  • 13. • • • • •
  • 14. Good and Evil
  • 15. Good and Evil
  • 16. White and Black
  • 17. White -box and Black -box
  • 18. Debug Event
  • 19. Breakpoints
  • 20. soft Breakpoint
  • 21. hardware Breakpoint
  • 22. memory Breakpoint
  • 23. Memory violation
  • 24. Memory violation (segmentation faults)
  • 25. Exceptions
  • 26. GDB
  • 27. ?
  • 28. $ gcc test.c -o test.o $ ./test.o
  • 29. $ gcc -g test.c -o test.o $ gdb test.o
  • 30. file run start main break Ctrl+c list [line/function] print [var] next [times] step [times] until [line] continue finish function jump [line] info [command] (ex:info break)
  • 31. Breakpoint help breakpoints breakpoints break [line] breakpoint break [function] info break breakpoints delete [n] breakpoint ( ) clear [line] breakpoint ( ) enable [n] breakpoint ( ) enable once [n] breakpoint break disable [n] breakpoint ( ) ignore [n] [cont] breakpoint ( ) (cont ) condition [n] [cond] cond break break [line] [cond] break 10 if n > 5 commands [n] break ,
  • 32. watchpoint watch [var] var break rwatch [var] var break awatch [var] var info watch break watch point
  • 33. display step next display [var] display undisplay [n] n display enable display n display [n] disable display n display [n] display info display table
  • 34. function calls backtrace function stack up down frame [n] frame return [var] return
  • 35. • (gdb) help all • (gdb) help • Reference
  • 36. gdbtui ccdebug Xcode cgdb Glewn GDBtk/Insight Xxgdb Emacs WDB GVD DDD Dev-c Nemiver KDb ........
  • 37. gdbtui ccdebug Xcode cgdb Glewn GDBtk/Insight Xxgdb Emacs WDB GVD DDD Dev-c Nemiver KDb ........
  • 38. gdbtui ccdebug Xcode cgdb Glewn GDBtk/Insight Xxgdb Emacs WDB GVD DDD Dev-c Nemiver KDb ........
  • 39. GDB
  • 40. Reference • GNU http://www.gnu.org/software/gdb/ • GNU Debugger (gdb) Part I http://jserv.sayya.org/debugger/HappyGDB-PartI-2008-07-12.pdf • debugger GNU GDB http://cse.tw/981class/file/upe3.pdf • Gray Hat Python • http://www.cmlab.csie.ntu.edu.tw/~daniel/linux/gdb.html • http://www.study-area.org/cyril/opentools/opentools/ x1253.html
  • 41. Q&A