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]
Other format: [Raw text]

Re: Problem with "finish" command in insight.


On Mon, Aug 25, 2003 at 10:39:27AM -0700, Keith Seitz wrote:
> [Moved to correct list]

[ Cc:'d to gdb list since I am no more sure that this is Insoght specific ]

> On Fri, 2003-08-22 at 15:39, Josef Wolf wrote:

> > I have noticed a problem with the "finish" command when insight is used.
> > The finish command sets an invisible breakpoint in the calling function.
> > For some reason this invisible breakpoint is not removed afterwards.
> > Therefore all consecutive "continue" commands stumble over this invisible
> > breakpoint.
> > 
> > I can't reproduce this with plain gdb. When using insight, it doesn't make
> > any difference whether the "finish"-button or the "finish" command from the
> > console window is used.
> > 
> > Have anyone seen such an effect? Or maybe someone can reproduce it?
> > Maybe someone could give me a hint where I should dig for the bug?
> 
> You must be using an older version of insight.

It is insight-5.3. Your patch seems not to be included in 5.3

> I remember checking in a patch for this...
> 
> 2002-11-06  Keith Seitz  <keiths@redhat.com>
>         * generic/gdbtk-hooks.c (gdbtk_call_command): Make a null
>         cleanup and run it after every issued gdb command. Apparently
>         some commands depend on this. [This should really be part of
>         main gdb...]

In the meantime I have located the problem. It is in main gdb.
This patch seems to fix it:

--- gdb.orig/infcmd.c   2002-09-25 22:43:21.000000000 +0200
+++ gdb/infcmd.c    2003-08-25 19:45:58.000000000 +0200
@@ -1337,8 +1337,10 @@
                            "finish_command: function has no target type");

          /* FIXME: Shouldn't we do the cleanups before returning? */
-         if (TYPE_CODE (value_type) == TYPE_CODE_VOID)
+         if (TYPE_CODE (value_type) == TYPE_CODE_VOID) {
+           do_cleanups (old_chain);
            return;
+         }

          funcaddr = BLOCK_START (SYMBOL_BLOCK_VALUE (function));

I have no idea why original gdb-5.3 omitted the cleanups on TYPE_CODE_VOID.
The FIXME indicates that the original autor was unsure about this, too ;-).
This is exactly what triggered my problem. And it seems to exist in the
main gdb program (although I could not trigger it in main gdb, but this might
be by accident). Your patch seem to be more general, but it fixes only
insight and not main gdb. So which patch would be the correct one? Or should
both patches be included? Or better your patch and a similar (generic) patch
for main gdb in addition?

Thanks!

-- 
Please visit and sign http://petition-eurolinux.org and http://www.ffii.org
-- Josef Wolf -- jw@raven.inka.de --


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