public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
* Two small insight (gdb?) bugs
@ 2011-07-13  4:32 Gene Smith
  2011-07-24 18:46 ` Keith Seitz
  0 siblings, 1 reply; 5+ messages in thread
From: Gene Smith @ 2011-07-13  4:32 UTC (permalink / raw)
  To: insight

For the record I want to report two minor bugs I have been seeing with a 
recent cvs snapshot build using insight in embedded ARM environment:

1. In console I can set a breakpoint like this:

b main

But if I make a typo and enter an invalid symbol such as:

b mai

It hangs insight and I have to kill -9 it.

2. If I have a watch point window active with watches present and I 
reload or reset my program, I get an error dialog when trying to 
re-establish the watchpoints since they are lost after a reset or reload 
(watch window comes up blank). The only way to re-define the watches is 
to restart insight but at least it is not locked up like in 1. above.
Workaround: Try to remember to close watch window before reloading or 
resetting.
Note: Memory, register, breakpoint window are fine after a reset/reload 
(except possibly breakpoints are stranded due to code differences on 
reload). Not sure why watch window comes back blank.

-gene


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

* Re: Two small insight (gdb?) bugs
  2011-07-13  4:32 Two small insight (gdb?) bugs Gene Smith
@ 2011-07-24 18:46 ` Keith Seitz
  2011-07-24 19:32   ` Keith Seitz
  2011-07-25  3:36   ` Gene Smith
  0 siblings, 2 replies; 5+ messages in thread
From: Keith Seitz @ 2011-07-24 18:46 UTC (permalink / raw)
  To: Gene Smith; +Cc: insight

On 07/12/2011 09:32 PM, Gene Smith wrote:
> 1. In console I can set a breakpoint like this:
>
> b main
>
> But if I make a typo and enter an invalid symbol such as:
>
> b mai
>
> It hangs insight and I have to kill -9 it.

I am using CVS HEAD, and I cannot reproduce this problem. It brings up a 
dialog asking, "Make pending breakpoint based on future shared library 
load?"

What happens if you use insight in non-windowing mode ("-nw" flag) and 
make the typo? Does it still lock-up?

> 2. If I have a watch point window active with watches present and I
> reload or reset my program, I get an error dialog when trying to
> re-establish the watchpoints since they are lost after a reset or reload
> (watch window comes up blank). The only way to re-define the watches is
> to restart insight but at least it is not locked up like in 1. above.
> Workaround: Try to remember to close watch window before reloading or
> resetting.

I don't know if your procedure is the same as mine, but I am 
experiencing  crash when re-running after the executable is recompiled, 
e.g., "insight foo", run, set watches, touch some sourcefile and 
recompile foo, "run" in the console.

This is happening because the varobjs are left in an unknown state, with 
stale pointers to memory. I will work on a fix for this, but this 
doesn't sound like your problem...

What does the error dialog say?

Keith

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

* Re: Two small insight (gdb?) bugs
  2011-07-24 18:46 ` Keith Seitz
@ 2011-07-24 19:32   ` Keith Seitz
  2011-07-25  3:36   ` Gene Smith
  1 sibling, 0 replies; 5+ messages in thread
From: Keith Seitz @ 2011-07-24 19:32 UTC (permalink / raw)
  To: Gene Smith; +Cc: insight

[-- Attachment #1: Type: text/plain, Size: 312 bytes --]

On 07/24/2011 11:45 AM, Keith Seitz wrote:
> This is happening because the varobjs are left in an unknown state, with
> stale pointers to memory. I will work on a fix for this, but this
> doesn't sound like your problem...

Ha, well, the patch is trivial. Give this a try and see if that helps at 
all...

Keith

[-- Attachment #2: clear-watchlist.patch --]
[-- Type: text/plain, Size: 711 bytes --]

Index: watch.tcl
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/library/watch.tcl,v
retrieving revision 1.11
diff -u -p -r1.11 watch.tcl
--- watch.tcl	1 Dec 2006 03:34:39 -0000	1.11
+++ watch.tcl	24 Jul 2011 19:28:45 -0000
@@ -1,5 +1,5 @@
 # Watch window for Insight.
-# Copyright (C) 2002, 2003, 2006 Red Hat
+# Copyright (C) 2002, 2003, 2006, 2011 Red Hat
 #
 # This program is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License (GPL) as published by
@@ -62,6 +62,7 @@ itcl::class WatchWin {
     foreach var $Watched {
       $var delete
     }
+    set Watched {}
     $tree remove all
   }
   

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

* Re: Two small insight (gdb?) bugs
  2011-07-24 18:46 ` Keith Seitz
  2011-07-24 19:32   ` Keith Seitz
@ 2011-07-25  3:36   ` Gene Smith
  2011-08-01 22:32     ` Keith Seitz
  1 sibling, 1 reply; 5+ messages in thread
From: Gene Smith @ 2011-07-25  3:36 UTC (permalink / raw)
  To: insight

Keith Seitz wrote, On 07/24/2011 02:45 PM:
> On 07/12/2011 09:32 PM, Gene Smith wrote:
>> 1. In console I can set a breakpoint like this:
>>
>> b main
>>
>> But if I make a typo and enter an invalid symbol such as:
>>
>> b mai
>>
>> It hangs insight and I have to kill -9 it.
>
> I am using CVS HEAD, and I cannot reproduce this problem. It brings up a
> dialog asking, "Make pending breakpoint based on future shared library
> load?"
>
> What happens if you use insight in non-windowing mode ("-nw" flag) and
> make the typo? Does it still lock-up?

No lock-up with -nw. I see the message you describe like this:

(gdb) b iain
Function "iain" not defined.
Make breakpoint pending on future shared library load? (y or [n]) n
(gdb)



>
>> 2. If I have a watch point window active with watches present and I
>> reload or reset my program, I get an error dialog when trying to
>> re-establish the watchpoints since they are lost after a reset or reload
>> (watch window comes up blank). The only way to re-define the watches is
>> to restart insight but at least it is not locked up like in 1. above.
>> Workaround: Try to remember to close watch window before reloading or
>> resetting.
>
> I don't know if your procedure is the same as mine, but I am
> experiencing crash when re-running after the executable is recompiled,
> e.g., "insight foo", run, set watches, touch some sourcefile and
> recompile foo, "run" in the console.
>
> This is happening because the varobjs are left in an unknown state, with
> stale pointers to memory. I will work on a fix for this, but this
> doesn't sound like your problem...
>
> What does the error dialog say?

I seem to mainly see the dialog after reloading my program to flash with 
watches present (none called var6). When finished reloading the watch 
window comes back empty and then when I try to add the watches back it says:

Title: Application Error
Large red "X": Error: invalid command name "var6"
Buttons: OK	Skip Messages	Details>>

Clicking on "Details>>" I see this:
invalid command name "var6"
invalid command name "var6"
     while executing
"$var delete"
     while deleting object "::.watchwin0.watchwin" in 
::WatchWin::destructor (body line 11)
     invoked from within
"itcl::delete object ::.watchwin0.watchwin"
     (command bound to event)

Any attempt to add watches results in this same dialog. Also, I may have 
seen it crash if I continue on for a while but usually I just restart 
since I probably need the watches back. Haven't tried your patch yet.
Also, it might be considered a bug in that the watchpoints are not 
remembered between insight restarts or after a reload of flash, at least 
for me. (At least BPs are remembered which is handy.)


>
> Keith
>


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

* Re: Two small insight (gdb?) bugs
  2011-07-25  3:36   ` Gene Smith
@ 2011-08-01 22:32     ` Keith Seitz
  0 siblings, 0 replies; 5+ messages in thread
From: Keith Seitz @ 2011-08-01 22:32 UTC (permalink / raw)
  To: Gene Smith; +Cc: insight

On 07/24/2011 08:35 PM, Gene Smith wrote:
> Keith Seitz wrote, On 07/24/2011 02:45 PM:
>> On 07/12/2011 09:32 PM, Gene Smith wrote:
>>> 1. In console I can set a breakpoint like this:
>>>
>>> b main
>>>
>>> But if I make a typo and enter an invalid symbol such as:
>>>
>>> b mai
>>>
>>> It hangs insight and I have to kill -9 it.

Since I cannot reproduce this, is there any chance you can attach a 
debugger to this running instance and get me a backtrace?

> Clicking on "Details>>" I see this:
> invalid command name "var6"
> invalid command name "var6"
> while executing
> "$var delete"
> while deleting object "::.watchwin0.watchwin" in ::WatchWin::destructor
> (body line 11)
> invoked from within
> "itcl::delete object ::.watchwin0.watchwin"
> (command bound to event)

The varobjs are destroyed by the callback, but when the window is closed 
and the dtor is called, it tried to delete the varobjs again because the 
callback did not clear the list. This should be fixed by my patch.

> Also, it might be considered a bug in that the watchpoints are not
> remembered between insight restarts or after a reload of flash, at least
> for me. (At least BPs are remembered which is handy.)

I don't know why they were omitted. Maybe it is a little trickier than 
breakpoints because of possible context restrictions. I might be able to 
work up a patch for this.

Keith

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

end of thread, other threads:[~2011-08-01 22:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-13  4:32 Two small insight (gdb?) bugs Gene Smith
2011-07-24 18:46 ` Keith Seitz
2011-07-24 19:32   ` Keith Seitz
2011-07-25  3:36   ` Gene Smith
2011-08-01 22:32     ` Keith Seitz

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