This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFH] Cygwin (EXEEXT) fix.


Hi all,

(I know this is a bit offtopic here, since it has mostly to do with my lack of tcl knowledge.)

There is a fail on gdb.base/annota3.exp on Cygwin related to a missing EXEEXT that
I need help in fixing.


Where is reads '.*annota3' in:

gdb_expect_list "run until main breakpoint" "$gdb_prompt$" {
   "\r\n\032\032post-prompt\r\n"
   "Starting program: .*annota3 \r\n"
   "\r\n\032\032starting\r\n"
   "\r\n\032\032breakpoint 1\r\n"
(...)

My first approach was:
-    "Starting program: .*annota3 \r\n"
+    "Starting program: .*annota3${EXEEXT} \r\n"

But that doesn't work: The variable doesn't get expanded.

Doing:
-    "Starting program: .*annota3 \r\n"
+    "Starting program: .*annota3" [$EXEEXT] " \r\n"

... also doesn't work, much to my surprise, since I copied the syntax from gdb.arch/altivec-regs.exp :

(...)
gdb_expect_list "info vector" ".*$gdb_prompt $" {
[$pattern0]
[$pattern1]
(...)

I see that uppercase/lowercase makes a difference, since, if I do a:

+ set exeext ".exe"

-    "Starting program: .*annota3 \r\n"
+    "Starting program: .*annota3" [$exeext] " \r\n"

The regex always passes, no matter what I put in $exeext, even if I put something like "asdfad".

How does one go about fixing this?

Cheers,
Pedro Alves

Index: gdb.base/annota3.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/annota3.exp,v
retrieving revision 1.9
diff -u -p -r1.9 annota3.exp
--- gdb.base/annota3.exp	10 Aug 2006 05:27:20 -0000	1.9
+++ gdb.base/annota3.exp	10 Dec 2006 14:16:17 -0000
@@ -39,7 +39,7 @@ set bug_id 0
 
 set testfile "annota3"
 set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+set binfile ${objdir}/${subdir}/${testfile}$EXEEXT
 
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug nowarnings}] != "" } {
     untested annota3.exp
@@ -118,7 +118,7 @@ gdb_expect_list "breakpoint info" "$gdb_
 send_gdb "run\n"
 gdb_expect_list "run until main breakpoint" "$gdb_prompt$" {
     "\r\n\032\032post-prompt\r\n"
-    "Starting program: .*annota3 \r\n"
+    "Starting program: .*annota3" [$EXEEXT] " \r\n"
     "\r\n\032\032starting\r\n"
     "\r\n\032\032breakpoint 1\r\n"
     "\r\n"

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]