mirror of https://github.com/pwndbg/pwndbg.git
Improve TUI handling and documentation (#2446)
* Fix ansi color truncation in TUI windows All remaining ansi escape codes after the substring of real characters weren't printed. This caused some colors to linger over to the next line. * Add two default TUI layouts One including the sourcecode section and one without. The allows to try the TUI quickly by selecting one of the layouts: `layout pwndbg` or `layout pwndbg_code`. * Don't use \t tabs in context threads section Horizontal scroll in TUI mode would jump around causing visual glitches. Use spaces instead. * Add warning when section is in TUI layout but not in 'context-sections' The section won't be updated automatically on stop. * Update FEATURES docs including screenshot * Don't create TUI windows when GDB is compiled without it Don't stop pwndbg from loading on gdb without tui integration. * Fix redraw of all windows after toggling TUI mode When switching back to TUI mode, the contextoutput would be sent before a TUI window's `render` function was called. This caused some sections to be printed normally in the cmd window instead of being sent to their TUI window. Keep a list of all open context TUI windows and redirect contextoutput for all of them once the first window is rerendered instead of waiting for them to be rendered too. Also fix the _static_enabled class variable usage.pull/2453/head
parent
88c363a65e
commit
3506114d5c
|
After Width: | Height: | Size: 232 KiB |
@ -1,4 +1,42 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import gdb
|
||||||
|
|
||||||
import pwndbg.gdblib.tui.context
|
import pwndbg.gdblib.tui.context
|
||||||
import pwndbg.gdblib.tui.control
|
import pwndbg.gdblib.tui.control
|
||||||
|
|
||||||
|
|
||||||
|
def setup() -> None:
|
||||||
|
tui_layouts = [
|
||||||
|
(
|
||||||
|
"tui new-layout pwndbg "
|
||||||
|
"{-horizontal "
|
||||||
|
" { "
|
||||||
|
" { -horizontal "
|
||||||
|
" { pwndbg_disasm 1 } 2 "
|
||||||
|
" { "
|
||||||
|
" { -horizontal pwndbg_legend 8 pwndbg_control 2 } 1 pwndbg_regs 6 pwndbg_stack 6 "
|
||||||
|
" } 3 "
|
||||||
|
" } 7 cmd 3 "
|
||||||
|
" } 3 { pwndbg_backtrace 2 pwndbg_threads 1 pwndbg_expressions 2 } 1 "
|
||||||
|
"} 1 status 1"
|
||||||
|
),
|
||||||
|
(
|
||||||
|
"tui new-layout pwndbg_code "
|
||||||
|
"{-horizontal "
|
||||||
|
" { "
|
||||||
|
" { -horizontal "
|
||||||
|
" { pwndbg_code 1 pwndbg_disasm 1 } 2 "
|
||||||
|
" { "
|
||||||
|
" { -horizontal pwndbg_legend 8 pwndbg_control 2 } 1 pwndbg_regs 6 pwndbg_stack 6 "
|
||||||
|
" } 3 "
|
||||||
|
" } 7 cmd 3 "
|
||||||
|
" } 3 { pwndbg_backtrace 2 pwndbg_threads 1 pwndbg_expressions 2 } 1 "
|
||||||
|
"} 1 status 1"
|
||||||
|
),
|
||||||
|
]
|
||||||
|
for layout in tui_layouts:
|
||||||
|
try:
|
||||||
|
gdb.execute(layout)
|
||||||
|
except gdb.error:
|
||||||
|
pass
|
||||||
|
|||||||
Loading…
Reference in new issue