Split struct symtab into two: struct symtab and compunit_symtab.
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / maint.exp
index 3093aae32c752ed66028b2112607e59008c1edde..edf7ff3678ba4c438ff6d2edc18487fce6ce42c7 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1998-2013 Free Software Foundation, Inc.
+# Copyright 1998-2014 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -72,7 +72,7 @@ gdb_test "maint print registers" "Name.*Nr.*Rel.*Offset.*Size.*Type.*"
 gdb_test_no_output "mt set per on" "mt set per on for expand-symtabs"
 gdb_test_multiple "mt expand-symtabs $subdir/break\[.\]c$" \
     "mt expand-symtabs" {
-       -re "#primary symtabs: (1|2) \\(\[+\](0|1|2)\\),.*$gdb_prompt $" {
+       -re "#compunits: (1|2) \\(\[+\](0|1|2)\\),.*$gdb_prompt $" {
            # This should expand at most two primary symtabs.
            # "Normally" it will not expand any, because the symtab
            # holding "main" will already have been expanded, but if the
@@ -130,10 +130,11 @@ gdb_expect  {
 # tests here!!
 gdb_test_no_output "maint check-symtabs"
 
+# Test per-command stats.
 gdb_test_no_output "maint set per-command on"
-
-gdb_test "maint set per-command off" \
-    "Command execution time: \[0-9.\]+ \\(cpu\\), \[0-9.\]+ \\(wall\\)\[\r\n\]+Space used: $decimal \\(\\+$decimal for this command\\)\[\r\n\]+#symtabs: $decimal \\(\\+$decimal\\), #primary symtabs: $decimal \\(\\+$decimal\\), #blocks: $decimal \\(\\+$decimal\\)"
+gdb_test "pwd" \
+    "Command execution time: \[0-9.\]+ \\(cpu\\), \[0-9.\]+ \\(wall\\)\[\r\n\]+Space used: $decimal \\(\\+$decimal for this command\\)\[\r\n\]+#symtabs: $decimal \\(\\+$decimal\\), #compunits: $decimal \\(\\+$decimal\\), #blocks: $decimal \\(\\+$decimal\\)"
+gdb_test_no_output "maint set per-command off"
 
 gdb_test "maint demangle" \
     "\"maintenance demangle\" takes an argument to demangle\\."
@@ -181,9 +182,18 @@ set keep_looking 1
 while {$keep_looking} {
     gdb_expect  {
 
-       -re ".*Object file.*maint($EXEEXT)?:  Objfile at $hex, bfd at $hex, \[0-9\]* minsyms\[\r\t \]+\n" { set header 1 }
-       -re ".*Psymtabs:\[\r\t \]+\n" { set psymtabs 1 }
-       -re ".*Symtabs:\[\r\t \]+\n" { set symtabs 1 }
+       -re "\r\n" {
+           set output $expect_out(buffer)
+           if {[regexp ".*Object file.*maint($EXEEXT)?:  Objfile at ${hex}" $output]} {
+               set header 1
+           }
+           if {[regexp ".*Psymtabs:\[\r\t \]+\n" $output]} {
+               set psymtabs 1
+           }
+           if {[regexp ".*Symtabs:\[\r\t \]+\n" $output]} {
+               set symtabs 1
+           }
+       }
 
        -re ".*$gdb_prompt $" { 
            set keep_looking 0
@@ -278,11 +288,11 @@ gdb_expect  {
 
 # Check that maint print msymbols allows relative pathnames
 set mydir [pwd]
-gdb_test "cd ${objdir}" \
-    "Working directory [string_to_regexp ${objdir}]\..*" \
+gdb_test "cd [standard_output_file {}]" \
+    "Working directory .*\..*" \
     "cd to objdir"
 
-gdb_test_multiple "maint print msymbols msymbols_output2 ${subdir}/${testfile}" "maint print msymbols" {
+gdb_test_multiple "maint print msymbols msymbols_output2 ${testfile}" "maint print msymbols" {
     -re "^maint print msymbols msymbols_output2 \[^\n\]*\r\n$gdb_prompt $" {
        gdb_test_multiple "shell ls msymbols_output2" "maint print msymbols" {
            -re "msymbols_output2\r\n$gdb_prompt $" {
This page took 0.027801 seconds and 4 git commands to generate.