aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.rocm/fork-exec-non-gpu-to-gpu-execer.cpp
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2023-04-13 00:18:12 +0200
committerTom de Vries <tdevries@suse.de>2023-04-13 00:18:12 +0200
commit5479c4c7c9e7179d95c6520cdef98ae175874cab (patch)
tree8b0f369879a504d0d1384f5211ea5d452239ae2c /gdb/testsuite/gdb.rocm/fork-exec-non-gpu-to-gpu-execer.cpp
parent58b77c6af2ed391b263460ef37285ee5cfebc69f (diff)
downloadbinutils-5479c4c7c9e7179d95c6520cdef98ae175874cab.zip
binutils-5479c4c7c9e7179d95c6520cdef98ae175874cab.tar.gz
binutils-5479c4c7c9e7179d95c6520cdef98ae175874cab.tar.bz2
[gdb/tui] Fix left margin in disassembly window
With a hello world a.out, and maint set tui-left-margin-verbose on, we have this disassembly window: ... ┌───────────────────────────────────────────────────────────┐ │___ 0x555555555149 <main> endbr64 │ │___ 0x55555555514d <main+4> push %rbp │ │___ 0x55555555514e <main+5> mov %rsp,%rbp │ │B+> 0x555555555151 <main+8> lea 0xeac(%rip),%rax│ │___ 0x555555555158 <main+15> mov %rax,%rdi │ ... Note the space between "B+>" and 0x555555555151. The space shows that a bit of the left margin is not written, which is a problem because that location is showing a character previously written, which happens to be a space, but also may be something else, for instance a '[' as reported in PR tui/30325. The problem is caused by confusion about the meaning of: ... #define TUI_EXECINFO_SIZE 4 ... There's the meaning of defining the size of this zero-terminated char array: ... char element[TUI_EXECINFO_SIZE]; ... which is used to print the "B+>" bit, which is 3 chars wide. And there's the meaning of defining part of the size of the left margin: ... int left_margin () const { return 1 + TUI_EXECINFO_SIZE + extra_margin (); } ... where it represents 4 chars. The discrepancy between the two causes the space between "B+>" and "0x555555555151". Fix this by redefining TUI_EXECINFO_SIZE to 3, and using: ... char element[TUI_EXECINFO_SIZE + 1]; ... such that we have: ... |B+>0x555555555151 <main+8> lea 0xeac(%rip),%rax │ ... This changes the layout of the disassembly window back to what it was before commit 9e820dec13e ("Use a curses pad for source and disassembly windows"), the commit that introduced the PR30325 regression. This also changes the source window from: ... │___000005__{ | ... to: ... │___000005_{ | ... Tested on x86_64-linux. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30325 Approved-By: Tom Tromey <tom@tromey.com>
Diffstat (limited to 'gdb/testsuite/gdb.rocm/fork-exec-non-gpu-to-gpu-execer.cpp')
0 files changed, 0 insertions, 0 deletions