[patch] testsuite: Fix gdb.mi/* regression on RHEL-6 [Re: [RFA, doc RFA] New option set use-deprecated-index-sections]

Jan Kratochvil
2012-07-25T14:33:34Z

On Fri, 20 Jul 2012 20:01:18 +0200, dje@google.com wrote:
> And I committed this to the 7.5 branch.

c3a09919048a2dcd937655d12acdb000d905841b is the first bad commit
commit c3a09919048a2dcd937655d12acdb000d905841b
Author: Doug Evans <dje@google.com>
Date: Fri Jul 20 17:38:00 2012 +0000

* NEWS: Document new options "set/show use-deprecated-index-sections",
[...]

-&"warning: Skipping deprecated .gdb_index section in /usr/lib/debug/lib64/ld-2.12.so.debug, pass --use-deprecated-index-sections to use them anyway\n"^M
+&"warning: Skipping deprecated .gdb_index section in /usr/lib/debug/lib64/ld-2.12.so.debug.\nDo \"set use-deprecated-index-sections on\" before the file is read\nto use the section anyway."^M
+&"\n"^M
(gdb) ^M
[...]
+ERROR: Unable to start target

This affects mostly any gdb.mi/*.exp testcase on RHEL-6.

I will check it in today; in two parts (the "\.gdb_index" regex fix is
unrelated).

Regards,
Jan

gdb/testsuite/
2012-07-25 Jan Kratochvil <jan.kratochvil@redhat.com>

Fix testsuite regression after --use-deprecated-index-sections removal.
* lib/mi-support.exp (gdbindex_warning_re): Update the expect string.

diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp
index 401565d..5235944 100644
--- a/gdb/testsuite/lib/mi-support.exp
+++ b/gdb/testsuite/lib/mi-support.exp
@@ -31,7 +31,7 @@ global mi_inferior_tty_name
set MIFLAGS "-i=mi"

set thread_selected_re "=thread-selected,id=\"\[0-9\]+\"\r\n"
-set gdbindex_warning_re "&\"warning: Skipping \[^\r\n\]+ \.gdb_index section in \[^\"\]+\"\r\n"
+set gdbindex_warning_re "&\"warning: Skipping \[^\r\n\]+ \\.gdb_index section in \[^\r\n\]+\"\r\n(?:&\"\\\\n\"\r\n)?"
set library_loaded_re "=library-loaded\[^\n\]+\"\r\n(?:$gdbindex_warning_re)?"
set breakpoint_re "=(?:breakpoint-created|breakpoint-deleted)\[^\n\]+\"\r\n"