public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
* Source Window - pop-up over array elements
@ 2000-11-07 13:45 Larry Smith
  2000-11-07 14:06 ` Syd Polk
  2000-11-07 14:25 ` Tom Tromey
  0 siblings, 2 replies; 7+ messages in thread
From: Larry Smith @ 2000-11-07 13:45 UTC (permalink / raw)
  To: insight; +Cc: lsmith

One bug report we have here says that highlighting "argv[0]"
and adding it to the watchlist results in adding "argv", not
"argv[0]" and that the latter should be correct.

However, this seems to me to be another example of a C-ish
orientation.  Gdbtk has no notion of a "type", such as an
array, nor code to parse array element notation - in C, or
any other supported language.  Trying to add it sounds like
a poorly-considered can of worms.  Should I quash this report,
or can someone suggest a generic and non-hacky way for the
gdbtk code to magically become aware of arrays in all supported
languages?

Or...does someone want to see "argv[0]" special-cased?

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Source Window - pop-up over array elements
  2000-11-07 13:45 Source Window - pop-up over array elements Larry Smith
@ 2000-11-07 14:06 ` Syd Polk
  2000-11-07 14:25 ` Tom Tromey
  1 sibling, 0 replies; 7+ messages in thread
From: Syd Polk @ 2000-11-07 14:06 UTC (permalink / raw)
  To: lsmith, insight; +Cc: lsmith

At 04:44 PM 11/7/00 -0500, Larry Smith wrote:

>One bug report we have here says that highlighting "argv[0]"
>and adding it to the watchlist results in adding "argv", not
>"argv[0]" and that the latter should be correct.
>
>However, this seems to me to be another example of a C-ish
>orientation.  Gdbtk has no notion of a "type", such as an
>array, nor code to parse array element notation - in C, or
>any other supported language.  Trying to add it sounds like
>a poorly-considered can of worms.  Should I quash this report,
>or can someone suggest a generic and non-hacky way for the
>gdbtk code to magically become aware of arrays in all supported
>languages?
>
>Or...does someone want to see "argv[0]" special-cased?

I don't think that we should special case argv[0] like this.


Syd Polk		spolk@redhat.com
Engineering Manager	+1 415 777 9810 x 241
Red Hat, Inc.



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Source Window - pop-up over array elements
  2000-11-07 13:45 Source Window - pop-up over array elements Larry Smith
  2000-11-07 14:06 ` Syd Polk
@ 2000-11-07 14:25 ` Tom Tromey
  2000-11-07 17:43   ` Larry Smith
  1 sibling, 1 reply; 7+ messages in thread
From: Tom Tromey @ 2000-11-07 14:25 UTC (permalink / raw)
  To: lsmith; +Cc: insight

>>>>> "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]'.
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 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.

Or do I misunderstand?

Tom

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Source Window - pop-up over array elements
  2000-11-07 14:25 ` Tom Tromey
@ 2000-11-07 17:43   ` Larry Smith
  2000-11-07 17:46     ` Larry Smith
  2000-11-08 12:49     ` Larry Smith
  0 siblings, 2 replies; 7+ messages in thread
From: Larry Smith @ 2000-11-07 17:43 UTC (permalink / raw)
  To: tromey; +Cc: insight

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Source Window - pop-up over array elements
  2000-11-07 17:43   ` Larry Smith
@ 2000-11-07 17:46     ` Larry Smith
  2000-11-08 12:49     ` Larry Smith
  1 sibling, 0 replies; 7+ messages in thread
From: Larry Smith @ 2000-11-07 17:46 UTC (permalink / raw)
  To: tromey; +Cc: insight

Larry Smith wrote:

> 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.

Umm...strike that - checked the wrong window (the editor
in SN does this, insight does not, it simply passes the
highlighted string, so it will work properly.  However,
just clicking without highlighting is still the problem.

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Source Window - pop-up over array elements
  2000-11-07 17:43   ` Larry Smith
  2000-11-07 17:46     ` Larry Smith
@ 2000-11-08 12:49     ` Larry Smith
  2000-11-08 13:00       ` Fernando Nasser
  1 sibling, 1 reply; 7+ messages in thread
From: Larry Smith @ 2000-11-08 12:49 UTC (permalink / raw)
  To: tromey; +Cc: insight

Larry Smith wrote:

> 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.

> 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...

I haven't gotten any responses pro or con except from
Tom, aside from Syd's comment not to special-case anything.
Absent any more feedback, I'm going to close/reject this
at COB today.

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Source Window - pop-up over array elements
  2000-11-08 12:49     ` Larry Smith
@ 2000-11-08 13:00       ` Fernando Nasser
  0 siblings, 0 replies; 7+ messages in thread
From: Fernando Nasser @ 2000-11-08 13:00 UTC (permalink / raw)
  To: lsmith; +Cc: tromey, insight

Larry Smith wrote:
> 
> Larry Smith wrote:
> 
> > 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.
> 
> > 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...
> 
> I haven't gotten any responses pro or con except from
> Tom, aside from Syd's comment not to special-case anything.
> Absent any more feedback, I'm going to close/reject this
> at COB today.
> 

IMO, the correct behavior is the current one.  If we add the array to the
Watch Window, the language specific code in there will make sure the user
can access whichever elements he/she wants.  It may have been the opinion 
of the author as well.

I would close it with as "expected behavior".

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2000-11-08 13:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-11-07 13:45 Source Window - pop-up over array elements Larry Smith
2000-11-07 14:06 ` Syd Polk
2000-11-07 14:25 ` Tom Tromey
2000-11-07 17:43   ` Larry Smith
2000-11-07 17:46     ` Larry Smith
2000-11-08 12:49     ` Larry Smith
2000-11-08 13:00       ` Fernando Nasser

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).