Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Keith Seitz <keiths@redhat.com>
To: Doug Evans <dje@google.com>, Yao Qi <qiyaoltc@gmail.com>
Cc: gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [RFC] Unset tcl variable addr to avoid clashing
Date: Fri, 10 Apr 2015 17:55:00 -0000	[thread overview]
Message-ID: <55280E9A.1020204@redhat.com> (raw)
In-Reply-To: <CADPb22TpwGMD1CPKodSCPmeRWaiqdKe+_1WYVT+poxH+c7hODg@mail.gmail.com>

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.

It proved a bit problematic, and I ended up with the namespace approach. 
It was far less risky/invasive. If there is any interest, I could dig 
that up and play with it some more.

Keith


  reply	other threads:[~2015-04-10 17:55 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 [this message]
2015-04-10 18:08     ` Doug Evans
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=55280E9A.1020204@redhat.com \
    --to=keiths@redhat.com \
    --cc=dje@google.com \
    --cc=gdb-patches@sourceware.org \
    --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