From 4769476b7b064c9efd7f2998139631027e45ad05 Mon Sep 17 00:00:00 2001 From: peace-maker Date: Sun, 8 Jun 2025 10:41:05 +0200 Subject: [PATCH] TUI: Switch threads and expressions windows (#3095) The order of the context section windows in the pre-configured pwndbg layouts didn't match the order in which they are drawn in the CLI context output as specified by the `context-sections` config. This caused glitches while rendering the section titles. This is a workaround for the current TUI layout and the context-sections order. If the order is changed later, it might break again. Fixes #3045 --- docs/tutorials/gdb-tui.md | 2 +- pwndbg/gdblib/tui/__init__.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/tutorials/gdb-tui.md b/docs/tutorials/gdb-tui.md index 95728286a..ca2805849 100644 --- a/docs/tutorials/gdb-tui.md +++ b/docs/tutorials/gdb-tui.md @@ -8,6 +8,6 @@ Use `focus cmd` to focus the command window and have the arrow keys scroll throu To create [your own layout](https://sourceware.org/gdb/current/onlinedocs/gdb.html/TUI-Commands.html) and selecting it use normal `tui new-layout` syntax like: ``` -tui new-layout pwndbg_custom {-horizontal { { -horizontal { pwndbg_code 1 pwndbg_disasm 1 } 2 { {-horizontal pwndbg_legend 8 pwndbg_control 2 } 0 pwndbg_regs 1 pwndbg_stack 1 } 3 } 7 cmd 3 } 3 { pwndbg_backtrace 2 pwndbg_threads 1 pwndbg_expressions 2 } 1 } 1 status 1 +tui new-layout pwndbg_custom {-horizontal { { -horizontal { pwndbg_code 1 pwndbg_disasm 1 } 2 { {-horizontal pwndbg_legend 8 pwndbg_control 2 } 0 pwndbg_regs 1 pwndbg_stack 1 } 3 } 7 cmd 3 } 3 { pwndbg_backtrace 2 pwndbg_expressions 2 pwndbg_threads 1 } 1 } 1 status 1 layout pwndbg_custom ``` diff --git a/pwndbg/gdblib/tui/__init__.py b/pwndbg/gdblib/tui/__init__.py index 636b7b9cd..a2fa8d555 100644 --- a/pwndbg/gdblib/tui/__init__.py +++ b/pwndbg/gdblib/tui/__init__.py @@ -18,7 +18,7 @@ def setup() -> None: " { -horizontal pwndbg_legend 8 pwndbg_control 2 } 0 pwndbg_regs 1 pwndbg_stack 1 " " } 3 " " } 7 cmd 3 " - " } 3 { pwndbg_backtrace 2 pwndbg_threads 1 pwndbg_expressions 2 } 1 " + " } 3 { pwndbg_backtrace 2 pwndbg_expressions 2 pwndbg_threads 1 } 1 " "} 1 status 1" ), ( @@ -31,7 +31,7 @@ def setup() -> None: " { -horizontal pwndbg_legend 8 pwndbg_control 2 } 0 pwndbg_regs 1 pwndbg_stack 1 " " } 3 " " } 7 cmd 3 " - " } 3 { pwndbg_backtrace 2 pwndbg_threads 1 pwndbg_expressions 2 } 1 " + " } 3 { pwndbg_backtrace 2 pwndbg_expressions 2 pwndbg_threads 1 } 1 " "} 1 status 1" ), ]