You need to enable JavaScript to run this app.
最新活动
大模型
产品
解决方案
定价
生态与合作
支持与服务
开发者
了解我们

如何在.gdbinit或配置文件中设置GDB TUI默认regs布局?

How to Launch GDB TUI with Registers Layout by Default

Absolutely! You can set this up directly in your ~/.gdbinit configuration file—it’s totally straightforward. Here’s the step-by-step breakdown:

  • Open your ~/.gdbinit file with your preferred text editor (e.g., vim ~/.gdbinit or nano ~/.gdbinit). If the file doesn’t exist yet, just create a new one.
  • Add these two lines to the file:
    tui enable
    layout regs
    
    The first line turns on TUI mode by default, while the second sets the default layout to display registers alongside your code.
  • Save the file and exit the editor.

Next time you launch GDB, it will automatically start in TUI mode with the registers layout active. If you ever need to switch to a different layout temporarily (like source-only or assembly view), you can still use commands such as layout src or layout asm as usual.

内容的提问来源于stack exchange,提问作者StudentsTea

火山引擎 最新活动