diff options
author | Andrew Burgess <aburgess@redhat.com> | 2025-02-17 10:51:30 +0000 |
---|---|---|
committer | Andrew Burgess <aburgess@redhat.com> | 2025-02-24 16:57:24 +0000 |
commit | dbfac07a71613288529d4b40c9a48ad76c19b360 (patch) | |
tree | 5a40c3da1238ebdceb742f30821a5058f428444e /gdb/testsuite/lib | |
parent | 4fd9516e3300249a9fe90d5c7ba6b63ba3058857 (diff) | |
download | binutils-dbfac07a71613288529d4b40c9a48ad76c19b360.zip binutils-dbfac07a71613288529d4b40c9a48ad76c19b360.tar.gz binutils-dbfac07a71613288529d4b40c9a48ad76c19b360.tar.bz2 |
gdb/tui: use correct setting to control asm window styling
Currently the TUI's asm window uses `source_styling` to control
styling. This setting is supposed to be for styling of source files
though, and the asm window displays disassembler output.
We have a different setting for this `disassemble_styling`, which is
controlled with 'set style disassembler enabled on|off'.
Switch to use the correct control variable.
I've written a new test for this, but this required some additions to
the tuiterm library in order to grab character attributes for a screen
region.
Approved-By: Tom Tromey <tom@tromey.com>
Diffstat (limited to 'gdb/testsuite/lib')
-rw-r--r-- | gdb/testsuite/lib/tuiterm.exp | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/gdb/testsuite/lib/tuiterm.exp b/gdb/testsuite/lib/tuiterm.exp index 0c4e3d1..4aa1ea2 100644 --- a/gdb/testsuite/lib/tuiterm.exp +++ b/gdb/testsuite/lib/tuiterm.exp @@ -1133,11 +1133,16 @@ namespace eval Term { gdb_assert {![regexp -- $regexp $contents]} $test_name } - # Get the region of the screen described by X, Y, WIDTH, - # and HEIGHT, and separate the lines using SEP. - proc get_region { x y width height sep } { + # Get the region of the screen described by X, Y, WIDTH, and + # HEIGHT, and separate the lines using SEP. If ATTRS is true then + # include attribute information in the output. + proc get_region { x y width height sep { attrs false } } { variable _chars + if { $attrs } { + _reset_attrs region_attrs + } + # Grab the contents of the box, join each line together # using $sep. set result "" @@ -1148,9 +1153,19 @@ namespace eval Term { append result $sep } for {set xx $x} {$xx < [expr {$x + $width}]} {incr xx} { - append result [lindex $_chars($xx,$yy) 0] + if { $attrs } { + set char_attrs [lindex $_chars($xx,$yy) 1] + append result [apply_attrs region_attrs $char_attrs] + } + + append result [get_char $xx $yy] } } + if { $attrs } { + _reset_attrs zero_attrs + set char_attrs [array get zero_attrs] + append result [apply_attrs region_attrs $char_attrs] + } return $result } |