Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Ulrich Weigand <uweigand@de.ibm.com>,
		Thiago Jung Bauermann <bauerman@br.ibm.com>,
		gdb-patches@sourceware.org
Subject: Re: [RFC/RFA] add struct parse_context to all command functions
Date: Wed, 22 Oct 2008 01:40:00 -0000	[thread overview]
Message-ID: <20081022014000.GA3638@adacore.com> (raw)
In-Reply-To: <20081021181739.GA10391@caradoc.them.org>

> Listening to Tom talk about this I've started to wonder if it's
> necessary... do we have a unified vision on where the global state
> accesses are OK?

I think it will depend on each global. For the current_language and
the input_radix, my goal is to have it used only from the command line
loop that calls the command functions.

> GDB is single threaded.  I anticipate it will remain so.  So, having
> the functions which implement user interface commands read global
> state doesn't seem like a big problem - unlike the expression parser.

I initially thought that it would be OK to have the command functions
that need it access current_language.  But I quickly realized that
this was actually pretty confusing. In order to audit the use of
a current_language, you'd have to check what the function using it
is used for - in particular, make sure that it's used as a command
function. When you have zillions of them spread everywhere in
the code, it's nearly impossible to avoid re-introducing incorrect
uses of the global.

With the approach that I suggest where I add the parameter, I should
be able to never increase the number of references to current_language
(and input_radix). And eventually, I should be able to eliminate them
all, save a couple of places where we know it's OK.

I will wait another couple of days to see how people react, but it
seems at this point that everyone was OK with approach (1), where
I do the transition all in one go. And since Tom was the lead
"questioner" of this change, I'd like to mention that my understanding
is that Tom understands the benefits of adding the extra parameter,
given the above explaination. Tom, please yell if I misunderstood you!
If all is well, I hope to be able to start looking into this sometime
late this week or maybe early next week.

-- 
Joel


  reply	other threads:[~2008-10-22  1:40 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-09 14:05 Joel Brobecker
2008-10-09 16:13 ` Tom Tromey
2008-10-09 22:20   ` Joel Brobecker
2008-10-20 16:16 ` Joel Brobecker
2008-10-20 19:03   ` Thiago Jung Bauermann
2008-10-21  0:47     ` Daniel Jacobowitz
2008-10-21 18:06       ` Ulrich Weigand
2008-10-21 18:18         ` Daniel Jacobowitz
2008-10-22  1:40           ` Joel Brobecker [this message]
2008-10-22 20:15             ` Tom Tromey
2008-10-22 20:36               ` Joel Brobecker
2008-10-21  1:22   ` Tom Tromey
2008-10-21  7:07     ` Joel Brobecker
2008-10-21 18:12     ` Ulrich Weigand
2008-10-21 18:58       ` Tom Tromey
2008-10-21 19:33       ` Tom Tromey
2008-10-22 18:03         ` Ulrich Weigand
2008-10-22 18:54           ` Tom Tromey
2008-10-22 22:24             ` Ulrich Weigand
2008-10-23  1:02               ` Tom Tromey
2008-10-23 19:50                 ` Ulrich Weigand
2008-10-23 21:29                   ` Tom Tromey
2008-10-24 13:01                     ` Ulrich Weigand
2008-10-25 16:05                       ` Tom Tromey
2008-10-27 17:07                       ` Tom Tromey
2008-10-28 16:27                         ` Ulrich Weigand
2008-10-28 18:17                           ` Tom Tromey
2008-10-28 20:00                             ` Ulrich Weigand
2008-10-25 16:25                     ` Joel Brobecker
2008-10-25 16:46                       ` Tom Tromey
2008-10-26 15:19                         ` Joel Brobecker
2008-10-21 18:05 ` Ulrich Weigand

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=20081022014000.GA3638@adacore.com \
    --to=brobecker@adacore.com \
    --cc=bauerman@br.ibm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=uweigand@de.ibm.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