Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Re: RFA: patch to fix gdb/1680
@ 2004-06-18 23:38 Michael Elizabeth Chastain
  0 siblings, 0 replies; 21+ messages in thread
From: Michael Elizabeth Chastain @ 2004-06-18 23:38 UTC (permalink / raw)
  To: drow, jimb; +Cc: cagney, gdb-patches, keiths, mec.gnu

> Ahh.  Here is a revision of my patch.  It is tested under the same
> configuration as the original patch.

It works for me, too, with the stock released TCL+Expect+Dejagnu.

You gotta update the ChangeLog entry to match the patch.
With that update, this patch is approved.

I'm still futzing with a patched TCL+Expect+Dejagnu to get to the
bottom of '{' processing.  One thing I can say: tcl/generic/regcomp.c
is nearly identical between sourceware TCL and released TCL.
So it's something else in the call stack.  Whee.

Michael C

===

2004-06-17  Jim Blandy  <jimb@redhat.com>

        Fix PR testsuite/1680.
	* gdb.arch/i386-sse.exp: Don't use curly braces in regular
	expressions.


^ permalink raw reply	[flat|nested] 21+ messages in thread
* Re: RFA: patch to fix gdb/1680
@ 2004-06-21  2:44 Michael Elizabeth Chastain
  0 siblings, 0 replies; 21+ messages in thread
From: Michael Elizabeth Chastain @ 2004-06-21  2:44 UTC (permalink / raw)
  To: jingham; +Cc: gdb-patches

> Note, this duplication of the regexp engine is what I wrote about a 
> couple of weeks ago when removing expect first came up...

I found your message again after I posted mine ... now I feel dumb.
"Three months in the lab can often save thirty minutes in the library."

We're in pretty good shape with gdb because I've been using
stock TCL 8.4.6 + Expect 5.41 for a long time, years now.
So I've already swept the minefield, as it were.

> Finally, note that if you need to see the result regexp as it ACTUALLY 
> gets to dejagnu, pass the --debug flag in RUNTESTFLAGS, and it will 
> spit out a file named dbg.log in build/gdb/testsuite which shows among 
> much other stuff the actual regexp that dejagnu is trying to match.

Wow, I didn't know about that.  That will help me in the future.

Michael C


^ permalink raw reply	[flat|nested] 21+ messages in thread
[parent not found: <1087626323.4926.ezmlm@sources.redhat.com>]
* Re: RFA: patch to fix gdb/1680
@ 2004-06-19  6:31 Michael Elizabeth Chastain
  2004-06-21  5:00 ` Jim Blandy
  0 siblings, 1 reply; 21+ messages in thread
From: Michael Elizabeth Chastain @ 2004-06-19  6:31 UTC (permalink / raw)
  To: jimb, schwab; +Cc: cagney, drow, gdb-patches, keiths, mec.gnu

Approved.

(Not sure if you're asking for approval for just the ChangeLog change,
but hey, I like saying it).

Michael C

===

2004-06-17  Jim Blandy  <jimb@redhat.com>

        Fix PR testsuite/1680.
	* gdb.arch/i386-sse.exp: Properly quote curly braces in
	regular expressions.


^ permalink raw reply	[flat|nested] 21+ messages in thread
* Re: RFA: patch to fix gdb/1680
@ 2004-06-19  2:44 Michael Elizabeth Chastain
  2004-06-19  6:25 ` Joel Brobecker
  0 siblings, 1 reply; 21+ messages in thread
From: Michael Elizabeth Chastain @ 2004-06-19  2:44 UTC (permalink / raw)
  To: drow, mec.gnu; +Cc: cagney, gdb-patches, jimb, keiths

The problem is not with tcl, but with expect.

I built two stacks of tcl+expect+dejagnu:

  'released stack' -- all the packages from their ftp sites.
  This is what I normally use.

  'sourceware stack' -- the versions from sourceware.
  This is what Jim B normally uses.

Here is a version table:

	    released  sourceware
  tcl       8.4.6     8.4.1 (nearly)
  expect    5.41      5.26 + patches, dated 1998-06-15
  dejagnu   1.4.4     1.4.3 (nearly)

Both TCL and Expect have their own copies of the Henry Spencer regular
expression code ("HSREC" for short).  You can see this coming: "re-usable
code re-used to hell".

When I use the 'released' stack, the regular expressions in question
get interpreted by TCL's copy of HSREC.  This is a modern
R.E. compiler with support for braces like "[abc]{1,2}".  It chokes on:

	".. = {0, 0.25, 0.5, 0.75}.*" \

The TCL 8.4.6 and TCL 8.4.1 versions of HSREC are nearly identical,
(they better be because they are both 8.4.X).  They both choke on this.

However, with the sourceware stack, the TCL 8.4.1 HSREC is not even
used!  Instead, expect 5.26 uses its own HSREC.  This is from 1998,
and does not implement '{1,2}' count modifiers.

So we have to write r.e.'s that work with both versions of HSREC.  We
must be doing this right most of the time, because I don't see huge
ERROR blotches in the files I've sampled from gdb-testers@ .

Another question.  How about all those r.e's in gdb.cp such as:

  # gdb.cp/userdef.exp
  \\$[0-9]* = {x = -2, y = -2}

As Daniel J surmised, the HSREC lexer really does have code to
distinguish between "{0,2}" and "{x=0,y=2}".  I watched this code
getting called:

  case CHR('{'):
    ...
    if (ATEOS() || !iscdigit(*v->now)) {
      NOTE(REG_UBRACES);
      NOTE(REG_UUNSPEC);
      RETV(PLAIN,c);
    } else {
      NOTE(REG_UBOUNDS);
      INTOCON(L_EBND);
      RET('{');
    }

So I predict that this regular expression in i386-sse.exp would work fine
with both T+E+D stacks, because it will fool the lexer:

  ".. = {\[$r\], $r.25, $r.5, $r.75}."

And indeed this code works with both sourceware T+E+D and released T+E+D.
Of course, I don't want to see that code in the actual test script;
that was just a test.

I guess it's my job to write doco on "how to write a test script",
including all these quirks of regular expressions.  Sigh.

And finally, this patch is still approved:

  ".. = \\{$r, $r.25, $r.5, $r.75\\}."

Michael C


^ permalink raw reply	[flat|nested] 21+ messages in thread
* Re: RFA: patch to fix gdb/1680
@ 2004-06-18 20:25 Michael Elizabeth Chastain
  2004-06-18 20:33 ` Daniel Jacobowitz
  0 siblings, 1 reply; 21+ messages in thread
From: Michael Elizabeth Chastain @ 2004-06-18 20:25 UTC (permalink / raw)
  To: drow, mec.gnu; +Cc: cagney, gdb-patches, jimb, keiths

drow> I prefer to solve the mystery instead.

We can do both.  I don't want to have 16 ERROR's in my face while
we are figuring this out.

drow> Presumably this version of TCL does not put special meaning on
drow> {string}, but does on {NUMBER}, as has become fashionable for regex
drow> engines.

Aw, foo!  That's what's different about gdb.cp/*.exp.  All the examples
in gdb.cp/*.exp are like:

  { x = 100, y = 101 }

Both the sourceware version of TCL (which is based on 8.4.1) and
the version I use of TCL (8.4.6) have code for {NUMBER} and
{NUMBER, NUMBER} modifiers.

I suspect there's some difference happening at the expect level
(5.26 versus 5.41).

Time to dive into the TCL source and throw in some fprintf's and stuff.

Michael C


^ permalink raw reply	[flat|nested] 21+ messages in thread
* Re: RFA: patch to fix gdb/1680
@ 2004-06-18 19:43 Michael Elizabeth Chastain
  0 siblings, 0 replies; 21+ messages in thread
From: Michael Elizabeth Chastain @ 2004-06-18 19:43 UTC (permalink / raw)
  To: cagney, keiths, mec.gnu; +Cc: drow, gdb-patches, jimb

Literally, the test that blows up is:

  foreach r {0 1 2 3 4 5 6 7} {
      gdb_test "print \$xmm$r.v4_float" \
	  ".. = {$r, $r.25, $r.5, $r.75}.*" \
	  "check contents of %xmm$r"
  }

I ripped out most of the other meta-characters and this still blows up:

    gdb_test "print xmm0.v4_float" \
	".. = {0, 0.25, 0.5, 0.75}.*" \
	"check contents of xmm0"

"blows up" means:

  ERROR: Process no longer exists

What Daniel is saying, and I'm agreeing, is that gdb.cp/*.exp
has a lot of similar tests.  And they are not blowing up.

Michael C


^ permalink raw reply	[flat|nested] 21+ messages in thread
* Re: RFA: patch to fix gdb/1680
@ 2004-06-18 19:18 Michael Elizabeth Chastain
  2004-06-18 19:35 ` Andrew Cagney
  2004-06-18 19:42 ` Daniel Jacobowitz
  0 siblings, 2 replies; 21+ messages in thread
From: Michael Elizabeth Chastain @ 2004-06-18 19:18 UTC (permalink / raw)
  To: drow, jimb; +Cc: gdb-patches

drow> Does it work if you put a backslash in front of them instead?  That's
drow> clearer to read, IMO.

On my machine (expect 5.41):

  "{...}"      ERROR: Process no longer exists
  "\{...\}"    ERROR: Process no longer exists
  "\\{...\\}"  Works fine

> This had better work, or the entire C++ testsuite is in trouble.

Something freaky is going on, indeed.

Empirically, the C++ test suite is working fine.  For example,
these tests:

  # gdb.cp/class2.exp

    # Access the "A" object.

    gdb_test "print alpha" \
	"= {.*a1 = 100.*}" \
	"print alpha at marker return 0"

    # Access the "B" object.

    gdb_test "print beta" \
	"= {.*a1 = 200.*b1 = 201.*b2 = 202}" \
	"print beta at marker return 0"

  # gdb.cp/derivation.exp

    gdb_test "print a_instance" "\\$\[0-9\]+ = \{a = 1, aa = 2\}" "print value of a_instance"

  # gdb.cp/userdef.exp

    gdb_test "print one - two" "\\\$\[0-9\]* = {x = -2, y = -2}"
    gdb_test "print one * two" "\\\$\[0-9\]* = {x = 8, y = 15}"
    gdb_test "print one / two" "\\\$\[0-9\]* = {x = 0, y = 0}"
    gdb_test "print one % two" "\\\$\[0-9\]* = {x = 2, y = 3}"

I spent about two hours playing with the braces in i386-sse.exp.
I truly don't understand why the code i386-sse.exp barfs out when
all that code in gdb.cp/*.exp works.  But I'm sure it works on
my systems (native i686-pc-linux-gnu and native hppa2.0w-hp-hpux11.11),
with expect 5.41.  And it's working on other people's systems in
gdb-testers@ ; I presume most of those results are with the sourceware
version of expect (based on expect 5.26).

I definitely want Jim's patch so that i386-sse.exp does its job.
If you insist, we could make PR gdb/1680 suspended instead of
closing it, to remind us of this unsolved mystery.

Michael C


^ permalink raw reply	[flat|nested] 21+ messages in thread
* Re: RFA: patch to fix gdb/1680
@ 2004-06-18 18:25 Michael Elizabeth Chastain
  0 siblings, 0 replies; 21+ messages in thread
From: Michael Elizabeth Chastain @ 2004-06-18 18:25 UTC (permalink / raw)
  To: gdb-patches, jimb

Approved.

It works for me, too, with tcl 8.4.6, expect 5.41, dejagnu 1.4.4.
native i686-pc-linux-gnu, gcc 3.3.3, dwarf-2 and stabs+.

Err --- in the ChangeLog entry, add this line:

      Fix PR testsuite/1680.

Michael C

===

2004-06-17  Jim Blandy  <jimb@redhat.com>

	Fix PR testsuite/1680.
	* gdb.arch/i386-sse.exp: Don't use curly braces in regular
	expressions.


^ permalink raw reply	[flat|nested] 21+ messages in thread
* RFA: patch to fix gdb/1680
@ 2004-06-18 18:10 Jim Blandy
  2004-06-18 18:42 ` Daniel Jacobowitz
  0 siblings, 1 reply; 21+ messages in thread
From: Jim Blandy @ 2004-06-18 18:10 UTC (permalink / raw)
  To: gdb-patches


I tested it on my machine.  i686-pc-linux-gnu, gcc 3.3, dwarf-2 and
stabs+.

Expect version is       5.26
Tcl version is          8.4
Framework version is    1.4.2.x

2004-06-17  Jim Blandy  <jimb@redhat.com>

	* gdb.arch/i386-sse.exp: Don't use curly braces in regular
	expressions.

Index: gdb/testsuite/gdb.arch/i386-sse.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.arch/i386-sse.exp,v
retrieving revision 1.1
diff -c -p -r1.1 i386-sse.exp
*** gdb/testsuite/gdb.arch/i386-sse.exp	7 Jun 2004 15:38:52 -0000	1.1
--- gdb/testsuite/gdb.arch/i386-sse.exp	17 Jun 2004 22:55:22 -0000
*************** gdb_test "break [gdb_get_line_number "fi
*** 70,77 ****
  gdb_continue_to_breakpoint "continue to first breakpoint in main"
  
  foreach r {0 1 2 3 4 5 6 7} {
      gdb_test "print \$xmm$r.v4_float" \
!         ".. = {$r, $r.25, $r.5, $r.75}.*" \
          "check contents of %xmm$r"
  }
  
--- 70,79 ----
  gdb_continue_to_breakpoint "continue to first breakpoint in main"
  
  foreach r {0 1 2 3 4 5 6 7} {
+     # Avoid using curly braces in regular expressions; different
+     # versions of Tcl treat them differently.
      gdb_test "print \$xmm$r.v4_float" \
!         ".. = .$r, $r.25, $r.5, $r.75..*" \
          "check contents of %xmm$r"
  }
  
*************** gdb_test "break [gdb_get_line_number "se
*** 85,91 ****
  gdb_continue_to_breakpoint "continue to second breakpoint in main"
  
  foreach r {0 1 2 3 4 5 6 7} {
      gdb_test "print data\[$r\]" \
!         ".. = {f = {[expr $r + 10], $r.25, $r.5, $r.75}}.*" \
          "check contents of data\[$r\]"
  }
--- 87,95 ----
  gdb_continue_to_breakpoint "continue to second breakpoint in main"
  
  foreach r {0 1 2 3 4 5 6 7} {
+     # Avoid using curly braces in regular expressions; different
+     # versions of Tcl treat them differently.
      gdb_test "print data\[$r\]" \
!         ".. = .f = .[expr $r + 10], $r.25, $r.5, $r.75...*" \
          "check contents of data\[$r\]"
  }


^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2004-06-21  5:00 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-18 23:38 RFA: patch to fix gdb/1680 Michael Elizabeth Chastain
  -- strict thread matches above, loose matches on Subject: below --
2004-06-21  2:44 Michael Elizabeth Chastain
     [not found] <1087626323.4926.ezmlm@sources.redhat.com>
2004-06-20 22:37 ` Jim Ingham
2004-06-19  6:31 Michael Elizabeth Chastain
2004-06-21  5:00 ` Jim Blandy
2004-06-19  2:44 Michael Elizabeth Chastain
2004-06-19  6:25 ` Joel Brobecker
2004-06-18 20:25 Michael Elizabeth Chastain
2004-06-18 20:33 ` Daniel Jacobowitz
2004-06-18 19:43 Michael Elizabeth Chastain
2004-06-18 19:18 Michael Elizabeth Chastain
2004-06-18 19:35 ` Andrew Cagney
2004-06-18 19:42 ` Daniel Jacobowitz
2004-06-18 19:56   ` Andrew Cagney
2004-06-18 20:00     ` Daniel Jacobowitz
2004-06-18 22:20   ` Jim Blandy
2004-06-18 22:51     ` Andreas Schwab
2004-06-19  6:15       ` Jim Blandy
2004-06-18 18:25 Michael Elizabeth Chastain
2004-06-18 18:10 Jim Blandy
2004-06-18 18:42 ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox