Patchwork [3/3] gdb/fortran: Improve output pattern in gdb.mi/mi-fortran-modules.exp

login
register
mail settings
Submitter Andrew Burgess
Date Dec. 4, 2019, 11:41 a.m.
Message ID <b21d7c53498568ca6722ce1a77301b07f6b7933d.1575457286.git.andrew.burgess@embecosm.com>
Download mbox | patch
Permalink /patch/36498/
State New
Headers show

Comments

Andrew Burgess - Dec. 4, 2019, 11:41 a.m.
Extend the output pattern in mi-fortran-modules.exp to skip some
system modules that appear with versions of GFortran after 7.x.x.

gdb/testsuite/ChangeLog:

	* gdb.mi/mi-fortran-modules.exp: Add pattern to skip system
	modules.

Change-Id: I64aaa395e554a32e8267ffa096faee53c19c0b9e
---
 gdb/testsuite/ChangeLog                     | 5 +++++
 gdb/testsuite/gdb.mi/mi-fortran-modules.exp | 6 +++++-
 2 files changed, 10 insertions(+), 1 deletion(-)
Pedro Alves - Dec. 6, 2019, 7:49 p.m.
On 12/4/19 11:41 AM, Andrew Burgess wrote:
> Extend the output pattern in mi-fortran-modules.exp to skip some
> system modules that appear with versions of GFortran after 7.x.x.
> 
> gdb/testsuite/ChangeLog:
> 
> 	* gdb.mi/mi-fortran-modules.exp: Add pattern to skip system
> 	modules.

OK.

Thanks,
Pedro Alves

Patch

diff --git a/gdb/testsuite/gdb.mi/mi-fortran-modules.exp b/gdb/testsuite/gdb.mi/mi-fortran-modules.exp
index 640bb12642d..eec2fe75da8 100644
--- a/gdb/testsuite/gdb.mi/mi-fortran-modules.exp
+++ b/gdb/testsuite/gdb.mi/mi-fortran-modules.exp
@@ -33,8 +33,12 @@  if {[mi_gdb_start]} {
 
 mi_run_to_main
 
+
+# Pattern to skip optional system modules that appear with later versions of GFortran.
+set system_modules_pattern "\{filename=\"\[^\"\]+/ieee/\[^/\]+\.F90\",fullname=\"\[^\"\]+\",symbols=\\\[(\[^\]\]+)\\\]\},"
+
 mi_gdb_test "101-symbol-info-modules" \
-    "101\\^done,symbols=\{debug=\\\[\{filename=\"\[^\"\]+$srcfile2\",fullname=\"\[^\"\]+$srcfile2\",symbols=\\\[\{line=\"16\",name=\"mod1\"\},\{line=\"27\",name=\"mod2\"\}\\\]\},\{filename=\"\[^\"\]+$srcfile\",fullname=\"\[^\"\]+$srcfile\",symbols=\\\[\{line=\"16\",name=\"mod3\"\},\{line=\"32\",name=\"modmany\"\},\{line=\"41\",name=\"moduse\"\}\\\]\}\\\]\}" \
+    "101\\^done,symbols=\{debug=\\\[($system_modules_pattern)*\{filename=\"\[^\"\]+$srcfile2\",fullname=\"\[^\"\]+$srcfile2\",symbols=\\\[\{line=\"16\",name=\"mod1\"\},\{line=\"27\",name=\"mod2\"\}\\\]\},\{filename=\"\[^\"\]+$srcfile\",fullname=\"\[^\"\]+$srcfile\",symbols=\\\[\{line=\"16\",name=\"mod3\"\},\{line=\"32\",name=\"modmany\"\},\{line=\"41\",name=\"moduse\"\}\\\]\}\\\]\}" \
     "-symbol-info-modules"
 
 mi_gdb_test "102-symbol-info-modules --name mod\[123\]" \