aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/testsuite/ChangeLog7
-rw-r--r--gdb/testsuite/gdb.mi/mi-sym-info-2.c5
-rw-r--r--gdb/testsuite/gdb.mi/mi-sym-info.exp13
3 files changed, 20 insertions, 5 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index de419eb..145e1e4 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,12 @@
2020-03-13 Tom de Vries <tdevries@suse.de>
+ * gdb.mi/mi-sym-info-2.c (another_char_t, another_short_t): New typedef.
+ (var1, var2): New variable.
+ * gdb.mi/mi-sym-info.exp: Add --name to various commands to restrict
+ matching symbols.
+
+2020-03-13 Tom de Vries <tdevries@suse.de>
+
* lib/tuiterm.exp (Term::command_no_prompt_prefix): New proc.
(Term::command): Use prompt prefix.
(Term::enter_tui): Use command_no_prompt_prefix instead of prefix.
diff --git a/gdb/testsuite/gdb.mi/mi-sym-info-2.c b/gdb/testsuite/gdb.mi/mi-sym-info-2.c
index a63d888..f514e42 100644
--- a/gdb/testsuite/gdb.mi/mi-sym-info-2.c
+++ b/gdb/testsuite/gdb.mi/mi-sym-info-2.c
@@ -41,3 +41,8 @@ f3 (another_int_t arg)
return arg + 2;
}
+typedef char another_char_t;
+typedef short another_short_t;
+
+static another_char_t var1;
+static another_short_t var2;
diff --git a/gdb/testsuite/gdb.mi/mi-sym-info.exp b/gdb/testsuite/gdb.mi/mi-sym-info.exp
index c07f3e8..7f8cf22 100644
--- a/gdb/testsuite/gdb.mi/mi-sym-info.exp
+++ b/gdb/testsuite/gdb.mi/mi-sym-info.exp
@@ -107,7 +107,7 @@ mi_gdb_test "116-symbol-info-functions --name f3" \
"List all functions matching pattern f3"
set lineno [gdb_get_line_number "f4 (int *arg)" ${srcfile}]
-mi_gdb_test "117-symbol-info-functions --type void" \
+mi_gdb_test "117-symbol-info-functions --type void --name ^\[^_\]" \
"117\\^done,symbols=\{debug=\\\[\{filename=\"\[^\"\]+$srcfile\",fullname=\"\[^\"\]+$srcfile\",symbols=\\\[\{line=\"36\",name=\"f4\",type=\"void \\(int \\*\\)\",description=\"void f4\\(int \\*\\);\"\}\\\]\}\\\]\}" \
"List all functions matching type void"
@@ -143,10 +143,13 @@ mi_gdb_test "123-symbol-info-functions --max-results 2" \
"123\\^done,symbols=\{debug=\\\[\{filename=\"\[^\"\]+$srcfile2\",fullname=\"\[^\"\]+$srcfile2\",symbols=\\\[\{line=\"33\",name=\"f2\",type=\"float \\(another_float_t\\)\",description=\"float f2\\(another_float_t\\);\"\},\{line=\"39\",name=\"f3\",type=\"int \\(another_int_t\\)\",description=\"int f3\\(another_int_t\\);\"\}\\\]\}\\\]\}" \
"-symbol-info-functions --max-results 2"
-mi_gdb_test "124-symbol-info-variables --max-results 3" \
+mi_gdb_test "124-symbol-info-variables --max-results 3 --name ^\[^_\]" \
"124\\^done,symbols=\{debug=\\\[\{filename=\"\[^\"\]+$srcfile2\",fullname=\"\[^\"\]+$srcfile2\",symbols=\\\[\{line=\"21\",name=\"global_f2\",type=\"int\",description=\"int global_f2;\"\},\{line=\"20\",name=\"global_i2\",type=\"int\",description=\"int global_i2;\"\},\{line=\"19\",name=\"global_f1\",type=\"float\",description=\"static float global_f1;\"\}\\\]\}\\\]\}" \
- "-symbol-info-variables --max-results 3"
-mi_gdb_test "125-symbol-info-types --max-results 4" \
- "125\\^done,symbols=\{debug=\\\[\{filename=\"\[^\"\]+$srcfile2\",fullname=\"\[^\"\]+$srcfile2\",symbols=\\\[\{line=\"24\",name=\"another_float_t\"\},\{line=\"23\",name=\"another_int_t\"\},\{name=\"float\"\},\{name=\"int\"\}\\\]\}\\\]\}" \
+set s1 "\{line=\"44\",name=\"another_char_t\"\}"
+set s2 "\{line=\"24\",name=\"another_float_t\"\}"
+set s3 "\{line=\"23\",name=\"another_int_t\"\}"
+set s4 "\{line=\"45\",name=\"another_short_t\"\}"
+mi_gdb_test "125-symbol-info-types --max-results 4 --name another_" \
+ "125\\^done,symbols=\{debug=\\\[\{filename=\"\[^\"\]+$srcfile2\",fullname=\"\[^\"\]+$srcfile2\",symbols=\\\[$s1,$s2,$s3,$s4\\\]\}\\\]\}" \
"-symbol-info-types --max-results 4"