public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Fernando Nasser <fnasser@cygnus.com>
To: jtc@redback.com
Cc: gdb@sources.redhat.com
Subject: Re: RFC: gdbglobals.[ch]
Date: Wed, 13 Dec 2000 12:00:00 -0000	[thread overview]
Message-ID: <3A37D538.85BA2E37@cygnus.com> (raw)
In-Reply-To: <5mhf48ku7v.fsf@jtc.redback.com>

"J.T. Conklin" wrote:
> 
> Some things that are currently set/show variables would be convient to
> access from GDB scripts.  It appears that this proposal would compound
> that mistake by having yet another set of variables that cannot be
> accessed by GDB's scripting language.
> 

I agree that all the script languages should be able to use the $ variables for
use in expressions and such.  The MI provides this access already, and 
corresponding gdblib calls should also be available.  But  we are talking
about something else here.  Se, for instance, the "inferior_args" thread.   

We are not keeping the set/show variables, which are just variables
(exactly of the same types as the proposed gdbglobals) that have their
addresses exported to the CLI by a function call to the CLI (like add_set_cmd).
We also share other variables by making them globals and turning gdb into a maze.

We are just generalizing the mechanism to *reduce* the ways of doing things. 
The idea is that all set/show variables turn into gdbglobals, as well as all
other global variables.


> Why not make these regular GDB $ variables?  Then alternate scripting
> languages and user interfaces would only need one mechanism to access
> GDB variables instead of the two (or three, if this proposal is
> adopted) used today.
> 
> One problem would be ensuring a clean namespace so that user's scripts
> wouldn't break when new variables are exported from GDB.  I think this
> is solvable, and would result in a more coherent GDB/scripting language/
> UI layering.
> 

Using the gdb convenience ($) variables would be considerably slower as we would
have to search the symbolic space at each use.  Not to mention the type conversion.
Some of the variables we are talking about are used frequently and repeatedly.

Also, some of the values shared may not mean to be accessible by users
(the set/show ones are, but we have other globals).  Making them a $ variable
we would be exposing them to any user.

The gdbglobals also have some special types that can make handling things like
a set of possible values easier.  And we can add more types if necessary.
Compare this with the untyped $ variables...



I think the main reason not to use GDB convenience variables to substitute globals
is that we are talking about two different levels of abstraction.  The gdbglobals is
at the implementation level, while the convenience variables are at the use level.





-- 
Fernando Nasser
Red Hat - Toronto                       E-Mail:  fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario   M4P 2C9

      reply	other threads:[~2000-12-13 12:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-12-12 11:49 Fernando Nasser
2000-12-13  3:41 ` Eli Zaretskii
2000-12-13  6:38   ` Fernando Nasser
2000-12-13 10:50     ` Eli Zaretskii
2000-12-13 11:15       ` Fernando Nasser
2000-12-13 11:16 ` J.T. Conklin
2000-12-13 12:00   ` Fernando Nasser [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=3A37D538.85BA2E37@cygnus.com \
    --to=fnasser@cygnus.com \
    --cc=gdb@sources.redhat.com \
    --cc=jtc@redback.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).