aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2019-02-08 01:28:53 -0700
committerTom Tromey <tom@tromey.com>2019-02-17 16:28:38 -0700
commit6506371f0671dd5ca11127fee4db8d8d7fec157f (patch)
treeda1e7c3598fd16e86fa307feacca5fd0a4b747b0 /gdb/testsuite/gdb.base
parent0c820d679358aa1ec7cd9e33c4bc23a7db964ea1 (diff)
downloadbinutils-6506371f0671dd5ca11127fee4db8d8d7fec157f.zip
binutils-6506371f0671dd5ca11127fee4db8d8d7fec157f.tar.gz
binutils-6506371f0671dd5ca11127fee4db8d8d7fec157f.tar.bz2
Add styling to macro commands
This adds filename styling to "info macro". gdb/ChangeLog 2019-02-17 Tom Tromey <tom@tromey.com> * macrocmd.c (show_pp_source_pos): Style the file names. gdb/testsuite/ChangeLog 2019-02-17 Tom Tromey <tom@tromey.com> * gdb.base/style.exp: Use -g3 to compile when possible. Add test for macro styling. * gdb.base/style.c (SOME_MACRO): New macro.
Diffstat (limited to 'gdb/testsuite/gdb.base')
-rw-r--r--gdb/testsuite/gdb.base/style.c2
-rw-r--r--gdb/testsuite/gdb.base/style.exp16
2 files changed, 17 insertions, 1 deletions
diff --git a/gdb/testsuite/gdb.base/style.c b/gdb/testsuite/gdb.base/style.c
index 53f6596..a44936e 100644
--- a/gdb/testsuite/gdb.base/style.c
+++ b/gdb/testsuite/gdb.base/style.c
@@ -13,6 +13,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+#define SOME_MACRO 23
+
int
main (int argc, char **argv)
{
diff --git a/gdb/testsuite/gdb.base/style.exp b/gdb/testsuite/gdb.base/style.exp
index 010d959..2778001 100644
--- a/gdb/testsuite/gdb.base/style.exp
+++ b/gdb/testsuite/gdb.base/style.exp
@@ -21,7 +21,16 @@ save_vars { env(TERM) } {
# We need an ANSI-capable terminal to get the output.
setenv TERM ansi
- if {[prepare_for_testing "failed to prepare" $testfile $srcfile]} {
+ set test_macros 0
+ set options debug
+ get_compiler_info
+ if { [test_compiler_info "gcc-*"] || [test_compiler_info "clang-*"] } {
+ lappend options additional_flags=-g3
+ set test_macros 1
+ }
+
+ if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
+ $options]} {
return -1
}
@@ -63,6 +72,11 @@ save_vars { env(TERM) } {
"frame when width=$width"
}
+ if {$test_macros} {
+ gdb_test "info macro SOME_MACRO" \
+ "Defined at $base_file_expr:16\r\n#define SOME_MACRO 23"
+ }
+
gdb_exit
gdb_spawn