From: Doug Evans <dje@google.com>
To: Keith Seitz <keiths@redhat.com>
Cc: Yao Qi <qiyaoltc@gmail.com>, gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [RFC] Unset tcl variable addr to avoid clashing
Date: Fri, 10 Apr 2015 18:08:00 -0000 [thread overview]
Message-ID: <CADPb22QH8SbtTj+KNZAghuydLLTCPJGCBgY5ZuW6aUzsRQcj9Q@mail.gmail.com> (raw)
In-Reply-To: <55280E9A.1020204@redhat.com>
On Fri, Apr 10, 2015 at 10:55 AM, Keith Seitz <keiths@redhat.com> wrote:
> On 04/10/2015 09:53 AM, Doug Evans wrote:
>>
>> Bleah. :-)
>> The first thing that comes to mind is of course a convention that
>> array globals must be prefixed with the name of the test.
>> OTOH gdb_base_coredump_filter_addr is painful.
>
>
> I've had to do this in several places, too, with my big locations patchset.
>
> In the end, I felt the path-of-least-resistance was to encapsulate the whole
> test in its own namespace and then declare variables:
>
> namespace eval $testfile {
> variable addr
> variable linespec
> variable location
>
> # do all test stuff
> }
>
> namespace delete $testfile
>
> This is rather inconvenient, so I played for a short while with trying to
> automate this in some way. The only solution that I could devise that didn't
> involve modifying dejagnu was to track the global variable list in
> standard_testfile or prepare_for_testing, unset'ing "new" globals every time
> the procedure was called.
Tucking the thing away in a namespace works too.
[for a definition of "works" that recognizes we have to be pragmatic here :-)]
next prev parent reply other threads:[~2015-04-10 18:08 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-10 11:51 Yao Qi
2015-04-10 16:53 ` Doug Evans
2015-04-10 17:55 ` Keith Seitz
2015-04-10 18:08 ` Doug Evans [this message]
2015-04-11 17:03 ` Sergio Durigan Junior
2015-04-12 17:22 ` Doug Evans
2015-04-13 6:47 ` Sergio Durigan Junior
2015-04-13 8:26 ` Pedro Alves
2015-04-14 19:12 ` Sergio Durigan Junior
2015-04-26 19:44 ` Sergio Durigan Junior
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=CADPb22QH8SbtTj+KNZAghuydLLTCPJGCBgY5ZuW6aUzsRQcj9Q@mail.gmail.com \
--to=dje@google.com \
--cc=gdb-patches@sourceware.org \
--cc=keiths@redhat.com \
--cc=qiyaoltc@gmail.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