Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@codesourcery.com>
To: gdb-patches@sourceware.org
Cc: Keith Seitz <keiths@redhat.com>
Subject: Re: [RFA] Add parsing support for C++ operators
Date: Sat, 21 Nov 2009 05:17:00 -0000	[thread overview]
Message-ID: <200911210515.59072.pedro@codesourcery.com> (raw)
In-Reply-To: <4AFA0A93.7040709@redhat.com>

On Wednesday 11 November 2009 00:51:31, Keith Seitz wrote:
> +    set expected [regsub {\(void\)} $name {()}]

> +    set demangled [regsub {\\\(void\\\)} $demangled {\(\)}]

This syntax doesn't work on older tcl's:

ERROR: tcl error sourcing ../../../src/gdb/testsuite/gdb.cp/cplusfuncs.exp.
ERROR: wrong # args: should be "regsub ?switches? exp string subSpec varName"
    while executing
"regsub {\(void\)} $name {()}"
    (procedure "print_addr" line 2)
    invoked from within
"print_addr "overload1arg($dm_type_void)""
:

I'm applying the fix below to use the old regsub syntax.
(this patch doesn't conflict with your pending patches)

Keith, I've found a similar issue in your new cpexprs.exp test.
I'm using this local change on top of your patch:

Index: src/gdb/testsuite/gdb.cp/cpexprs.exp
===================================================================
--- src.orig/gdb/testsuite/gdb.cp/cpexprs.exp   2009-11-21 01:26:00.000000000 +0000
+++ src/gdb/testsuite/gdb.cp/cpexprs.exp        2009-11-21 01:26:13.000000000 +0000
@@ -73,7 +73,7 @@ proc add {func type print lst} {

     # An exception: since gdb canonicalizes C++ output,
     # "(void)" must be mutated to "()".
-    set print [regsub {\(void\)} $print {()}]
+    regsub {\(void\)} $print {()} print

-- 
Pedro Alves


2009-11-21  Pedro Alves  <pedro@codesourcery.com>

	* gdb.cp/cplusfuncs.exp (info_func_regexp, print_addr): Don't
	assume new `regsub' syntax available.

---
 gdb/testsuite/gdb.cp/cplusfuncs.exp |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: src/gdb/testsuite/gdb.cp/cplusfuncs.exp
===================================================================
--- src.orig/gdb/testsuite/gdb.cp/cplusfuncs.exp	2009-11-21 01:42:01.000000000 +0000
+++ src/gdb/testsuite/gdb.cp/cplusfuncs.exp	2009-11-21 01:43:25.000000000 +0000
@@ -241,7 +241,7 @@ proc info_func_regexp { name demangled }
     global gdb_prompt
 
     send_gdb "info function $name\n"
-    set demangled [regsub {\\\(void\\\)} $demangled {\(\)}]
+    regsub {\\\(void\\\)} $demangled {\(\)} demangled
     gdb_expect {
 	-re ".*File .*:\r\n(class |)$demangled\r\n.*$gdb_prompt $" {
 	    pass "info function for \"$name\""
@@ -328,7 +328,7 @@ proc print_addr_2_kfail { name good bad 
 #
 
 proc print_addr { name } {
-    set expected [regsub {\(void\)} $name {()}]
+    regsub {\(void\)} $name {()} expected
     if {[string first "::" $name] == -1} {
 	# C function -- must be qutoed
 	set name "'$name'"


  parent reply	other threads:[~2009-11-21  5:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-11  0:51 Keith Seitz
2009-11-11 15:12 ` Tom Tromey
2009-11-11 16:47   ` Keith Seitz
2009-11-21  5:17 ` Pedro Alves [this message]
2009-11-21 19:05   ` Keith Seitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200911210515.59072.pedro@codesourcery.com \
    --to=pedro@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    --cc=keiths@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox