This is the mail archive of the insight@sources.redhat.com mailing list for the Insight project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [RFA] Insight fix for missing tick marks.




On Wed, 28 Mar 2001, Keith Seitz wrote:

> On Wed, 28 Mar 2001, John R. Moore wrote:
>
> > Index: gdb/gdbtk/generic/gdbtk-cmds.c
> > ===================================================================
> > RCS file: /cvs/cvsfiles/devo/gdb/gdbtk/generic/gdbtk-cmds.c,v
> > retrieving revision 1.17
> > diff -p -u -r1.17 gdbtk-cmds.c
> > --- gdb/gdbtk/generic/gdbtk-cmds.c	2001/03/26 19:55:12	1.17
> > +++ gdb/gdbtk/generic/gdbtk-cmds.c	2001/03/28 17:27:25
> > @@ -4696,7 +4696,7 @@ full_lookup_symtab (file)
> >  	else
> >  	  fullname = st->fullname;
> >
> > -	if (!strcmp (file, fullname))
> > +	if (st->linetable->nitems > 0 && !strcmp (file, fullname))
> >  	  return st;
>
> Can you add a comment explaining why we need to check for the linetable?
> It is not obvious at all why this should be done.
>

It's pretty obvious once you see what's going on. The whole reason
for getting the symtab is to find the lines where one can stop the
debugger. The symtabs are in a link-list and it just so happens that
a fullname appears in two of them, one with nitems > 0 and one without.

The latter meant that sometimes insight worked and sometimes it didn't
(with respect to tick marks) and seemed to have this problem only wth the
main() source file.

If the nitems are 0, then we have no tick marks and thus the bug.
Should there be a case where nitems really is zero, nothing is lost.

> Also, you should use gdb's accessor macros/functions when possible:
>
>    if (LINETABLE (st)->nitems > 0 && ...)

I didn't see this, I'll certainly add the change.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]