You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

能否将GDB TUI模式的默认垂直布局改为水平布局?

Changing GDB TUI Layout to Horizontal (Left-Right)

Absolutely, you can customize the GDB TUI layout to arrange the source, assembly, and command windows horizontally (left to right) instead of the default vertical stack. Here's how to do it step by step:

1. Define a Custom Horizontal Layout

First, enter TUI mode if you haven’t already (press Ctrl+X A or run tui enable in GDB). Then use the tui new-layout command to create your desired layout:

tui new-layout horizontal_src_asm_cmd src 1 asm 1 cmd 1 horizontal

Let’s break down what this command does:

  • horizontal_src_asm_cmd: A custom name for your layout (feel free to use any name you prefer)
  • src 1: The source window takes up 1 unit of space (adjust this number to give more/less width to the source pane)
  • asm 1: The assembly window takes up 1 unit of space
  • cmd 1: The command window takes up 1 unit of space
  • horizontal: Arranges all three windows in a left-to-right horizontal row

2. Apply the Custom Layout

Once you’ve defined the layout, activate it with:

tui apply-layout horizontal_src_asm_cmd

You’ll immediately see the windows shift to your new arrangement: source on the left, assembly in the middle, command on the right.

3. Set the Custom Layout as Default (Optional)

If you want this layout to load automatically every time you start GDB, add these lines to your .gdbinit file (create the file in your home directory if it doesn’t exist):

tui enable
tui new-layout horizontal_src_asm_cmd src 1 asm 1 cmd 1 horizontal
tui apply-layout horizontal_src_asm_cmd

4. Adjust Window Sizes (Optional)

To prioritize one window (e.g., give more space to the source pane), tweak the numbers in the layout definition. For example, make the source window twice as wide as the others:

tui new-layout horizontal_src_asm_cmd src 2 asm 1 cmd 1 horizontal
tui apply-layout horizontal_src_asm_cmd

Switching Back to Default Layout

If you ever want to revert to the original vertical stack, run:

tui apply-layout default

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

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.26 08:57:30