Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom de Vries via Gdb-patches <gdb-patches@sourceware.org>
To: Tom Tromey <tom@tromey.com>,
	Tom de Vries via Gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH][gdb/testsuite] Add label option to proc cu
Date: Fri, 27 Aug 2021 16:13:03 +0200	[thread overview]
Message-ID: <c2ee4124-aa62-04aa-7c88-ee9625a64e83@suse.de> (raw)
In-Reply-To: <87ilzrowaz.fsf@tromey.com>

On 8/27/21 3:24 PM, Tom Tromey wrote:
>>>>>> "Tom" == Tom de Vries via Gdb-patches <gdb-patches@sourceware.org> writes:
> 
> Tom> +	upvar $label my_label
> Tom> +	set my_label $_cu_label
> 
> Maybe this should be conditional on $label != ""

It should indeed.

I tried to understand why I didn't run into an error with this, and:
...
$ cat test.tcl
#!/usr/bin/tclsh

proc foo { } {
    set label ""
    upvar $label my_label
    set my_label "bla"
}

foo
puts ${}
$ ./test.tcl
bla
...
apparently it's possible to create a variable with the empty string as
variable name.

Thanks,
- Tom

      reply	other threads:[~2021-08-27 14:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-26 11:56 Tom de Vries via Gdb-patches
2021-08-26 13:38 ` Simon Marchi via Gdb-patches
2021-08-26 15:16   ` Tom de Vries via Gdb-patches
2021-08-27 13:24     ` Tom Tromey
2021-08-27 14:13       ` Tom de Vries via Gdb-patches [this message]

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=c2ee4124-aa62-04aa-7c88-ee9625a64e83@suse.de \
    --to=gdb-patches@sourceware.org \
    --cc=tdevries@suse.de \
    --cc=tom@tromey.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