public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
From: Larry Smith <larry@smith-house.org>
To: tromey@cygnus.com
Cc: insight@sources.redhat.com
Subject: Re: Source Window - pop-up over array elements
Date: Tue, 07 Nov 2000 17:43:00 -0000	[thread overview]
Message-ID: <3A08AFA2.A4F1D0F3@smith-house.org> (raw)
In-Reply-To: <8766lzcsnn.fsf@creche.cygnus.com>

Tom Tromey wrote:

> >>>>> "Larry" == Larry Smith <larry@smith-house.org> writes:

> Larry> One bug report we have here says that highlighting "argv[0]"
> Larry> and adding it to the watchlist results in adding "argv", not
> Larry> "argv[0]" and that the latter should be correct.
> 
> Larry> Trying to add it sounds like a poorly-considered can of worms.
> Larry> Should I quash this report, or can someone suggest a generic
> Larry> and non-hacky way for the gdbtk code to magically become aware
> Larry> of arrays in all supported languages?

> gdb understands me if I type `p argv[0]'.

gdb does, yes.  However, this information does not
appear in the tcl code that drives the GUI.

> It seems to me that if I highlight some text in gdbtk and ask it to
> display it, it ought to do the right thing in a language-sensitive way.

The problem is that one doesn't "highlight" - one "clicks
on" - and it's up to gdbtk's tcl code to scan back and
forth and figure out what variable it is looking at.  And
the highlighting code, which _could_ bypass this, instead
just drops into the same validator and so has the same
limitations.

This is done in srctextwin.itb in the GetVariable method.  It
just uses a regular expression scan out a string consisting
of upper and lower case letters, digits, and any of "_", "-",
"." and (I wonder about this) ">".  It can't actually parse
the source code and pull out a genuine variable complete with
specifiers, array selections, and the like.  This is basically
the same deal as with comments which we discussed earlier,
to gdbtk, this is just text, and it doesn't know C, Fortran,
Ada, Pascal, Java, or whatever...

> The utility of watching is greatly reduced if I can only watch things
> that are in the subset of all languages gdbtk understands.  Probably
> that amounts to raw variables and nothing else.

If I understand this code, that does seem to be the limit,
yes.

> Or do I misunderstand?

Well, one of us does.  ;)

regards,
-- 
 .-.    .-. .---. .---. .-..-. | "Bill Gates is just a monocle
 | |__ / | \| |-< | |-<  >  /  | and a Persian Cat away from
 `----'`-^-'`-'`-'`-'`-' `-'   | being one of the bad guys in a
       My opinions only.       | James Bond movie." -- D Miller

  reply	other threads:[~2000-11-07 17:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-11-07 13:45 Larry Smith
2000-11-07 14:06 ` Syd Polk
2000-11-07 14:25 ` Tom Tromey
2000-11-07 17:43   ` Larry Smith [this message]
2000-11-07 17:46     ` Larry Smith
2000-11-08 12:49     ` Larry Smith
2000-11-08 13:00       ` Fernando Nasser

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=3A08AFA2.A4F1D0F3@smith-house.org \
    --to=larry@smith-house.org \
    --cc=insight@sources.redhat.com \
    --cc=tromey@cygnus.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).