diff options
author | Tom Tromey <tromey@adacore.com> | 2019-05-13 09:35:19 -0600 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2019-05-14 07:43:38 -0600 |
commit | e7bd7fba34ae1f892acf1e13ac86fca55b68026d (patch) | |
tree | b1135d9729888763958d69420a735d78210b8ac5 /gdb/testsuite/gdb.base | |
parent | 35015cd193be5e603ed31c14472d2d9d17e14e7a (diff) | |
download | gdb-e7bd7fba34ae1f892acf1e13ac86fca55b68026d.zip gdb-e7bd7fba34ae1f892acf1e13ac86fca55b68026d.tar.gz gdb-e7bd7fba34ae1f892acf1e13ac86fca55b68026d.tar.bz2 |
Add file name styling to "info sharedlibrary"
This changes "info sharedlibrary" to add styling to the file name.
Tested on x86-64 Fedora 29.
gdb/ChangeLog
2019-05-14 Tom Tromey <tromey@adacore.com>
* solib.c (info_sharedlibrary_command): Style the file name.
gdb/testsuite/ChangeLog
2019-05-14 Tom Tromey <tromey@adacore.com>
* gdb.base/info-shared.exp (check_info_shared): Add "info shared"
styling test.
Diffstat (limited to 'gdb/testsuite/gdb.base')
-rw-r--r-- | gdb/testsuite/gdb.base/info-shared.exp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.base/info-shared.exp b/gdb/testsuite/gdb.base/info-shared.exp index eb5ee95..e1314bf 100644 --- a/gdb/testsuite/gdb.base/info-shared.exp +++ b/gdb/testsuite/gdb.base/info-shared.exp @@ -144,3 +144,27 @@ check_info_shared "info sharedlibrary #7" 0 1 # Run to the last stop and check that both libraries are gone. gdb_continue_to_breakpoint "library unload #2" "\\.?stop .*" check_info_shared "info sharedlibrary #8" 0 0 + +with_test_prefix styled { + save_vars { env(TERM) } { + # We need an ANSI-capable terminal to get the output. + setenv TERM ansi + + clean_restart $testfile + + gdb_test_no_output "set style enabled off" + if {![runto_main]} { + return 0 + } + gdb_breakpoint "stop" + gdb_continue_to_breakpoint "library load #1" "\\.?stop .*" + + # Simple test for "info sharedlibrary" styling. Look for styled + # addresses and file name. + set addr "\033\\\[34m${hex}\033\\\[m" + set sofile "\033\\\[32m\[^\033\]+\033\\\[m" + gdb_test_no_output "set style enabled on" + gdb_test "info sharedlibrary" \ + "$addr\[ \t\]+$addr.*$sofile\r\n.*" + } +} |