gdb split view with code

后端 未结 9 2053
温柔的废话
温柔的废话 2020-11-27 10:02

I was just debugging a program in gdb and somehow I found a new feature I\'ve never seen or even heard of before, a split view where I can see and browse the code in additio

相关标签:
9条回答
  • 2020-11-27 10:32

    Type layout as a command in gdb and the split window will be shown.

    0 讨论(0)
  • 2020-11-27 10:34

    You can also start it from the gdb shell using the command "-" (dash). Not sure how to dynamically turn it off though.

    0 讨论(0)
  • 2020-11-27 10:38

    You can trigger it dynamically by push ctrl+x and ctrl+a.

    0 讨论(0)
  • 2020-11-27 10:43

    It's called the TUI (no kidding). Start for example with gdbtui or gdb -tui ...


    Please also see this answer by Ciro Santilli. It wasn't available in 2012 to the best of my knowledge, but definitely worth a look.

    0 讨论(0)
  • 2020-11-27 10:45

    There is also interface tool for GDB called cgdb. Even with some color highlighting. "ESC" to switch to code view, "i" to switch back to gdb

    0 讨论(0)
  • 2020-11-27 10:47

    There are two variants of it.

    1. to only see code Press

    Press CTRL X together and then 1

    1. To see both source and assembly

    Press 'CTRL' 'X' together and then '2'

    http://www.cs.fsu.edu/~baker/ada/gnat/html/gdb_23.html

    A screen shot of the view with code and assembly. enter image description here

    Also check out this amazing Github project.

    0 讨论(0)
提交回复
热议问题