public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
* Re: No step button using insight w/ remote target.
  2001-11-07 15:19 No step button using insight w/ remote target Grant Edwards
@ 2001-10-01  8:25 ` Fernando Nasser
  2001-10-02 14:22   ` Grant Edwards
                     ` (2 more replies)
  2001-10-02 16:10 ` Keith Seitz
  1 sibling, 3 replies; 31+ messages in thread
From: Fernando Nasser @ 2001-10-01  8:25 UTC (permalink / raw)
  To: Grant Edwards; +Cc: insight, Keith Seitz

Grant Edwards wrote:
> 
> I'm using 5.0.92 from the development snapshot ftp directory
> configured for arm-elf target Linux RH6.2 host.  The target is
> an ARM7 single-board computer running RedBoot w/ GDB stubs.
> 
> Evertying works swimmingly in -nw mode.
> 
> Without the -nw option I run into a couple of problems:
> 
>  1) Doing a "target remote /dev/ttyS1" command in the console
>     hangs gdb completely.
> 
>  2) Downloading with the "target" menu using the "continue" run
>     method and "set breakpoint" works OK, but when the
>     breakpoint is hit, none of the step, next, continue,
>     buttons are enabled.
> 
>     Doing "step" or "next" from the console works fine, and I
>     can set breakpoints by clicking in the source window, but
>     the button-bar seems to be stuck in the wrong state.
> 

It seems that the notification that the target has stopped is not
reaching the menu and toolbar objects...

Grant, can you please start the Debug Window before you connect
and let us know what is in there?

If you set:
GDBTK_DEBUG
to 1, you'll have a Debug Window option in your View menu.  You can
open it before you connect.

I am not sure what is in your version.  Maybe you can also have a
log written by setting 
GDBTK_DEBUGFILE
to a file and setting the GDBTK_DEBUG to 1.

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

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

* Re: No step button using insight w/ remote target.
  2001-10-01  8:25 ` Fernando Nasser
@ 2001-10-02 14:22   ` Grant Edwards
  2001-11-15 15:46     ` Grant Edwards
  2001-10-02 15:40   ` Grant Edwards
  2001-11-12  7:13   ` Fernando Nasser
  2 siblings, 1 reply; 31+ messages in thread
From: Grant Edwards @ 2001-10-02 14:22 UTC (permalink / raw)
  To: Fernando Nasser; +Cc: insight, Keith Seitz

On Mon, Nov 12, 2001 at 10:13:33AM -0500, Fernando Nasser wrote:

> >  2) Downloading with the "target" menu using the "continue" run
> >     method and "set breakpoint" works OK, but when the
> >     breakpoint is hit, none of the step, next, continue,
> >     buttons are enabled.
> > 
> >     Doing "step" or "next" from the console works fine, and I
> >     can set breakpoints by clicking in the source window, but
> >     the button-bar seems to be stuck in the wrong state.
>
> It seems that the notification that the target has stopped is not
> reaching the menu and toolbar objects...

There's a status message at both bottom that says something like "Program
terminated, 'Run' to restart".  I'm guessing the wrong "signal" value is
being seen somewhere.

> Grant, can you please start the Debug Window before you connect
> and let us know what is in there?
> 
> If you set: GDBTK_DEBUG to 1, you'll have a Debug Window option in your
> View menu.  You can open it before you connect.
> 
> I am not sure what is in your version.  Maybe you can also have a log
> written by setting GDBTK_DEBUGFILE to a file and setting the GDBTK_DEBUG to
> 1.

I'll try that tomorrow.  Is tracing the remote protocol packets a useful
thing to do or is the problem more likely to be elsewhere?

-- 
Grant Edwards
grante@visi.com

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

* Re: No step button using insight w/ remote target.
  2001-10-01  8:25 ` Fernando Nasser
  2001-10-02 14:22   ` Grant Edwards
@ 2001-10-02 15:40   ` Grant Edwards
  2001-11-19  8:32     ` Grant Edwards
  2001-11-12  7:13   ` Fernando Nasser
  2 siblings, 1 reply; 31+ messages in thread
From: Grant Edwards @ 2001-10-02 15:40 UTC (permalink / raw)
  To: Fernando Nasser; +Cc: insight, Keith Seitz

On Mon, Nov 12, 2001 at 10:13:33AM -0500, Fernando Nasser wrote:
> Grant Edwards wrote:

> > I'm using 5.0.92 from the development snapshot ftp directory
> > configured for arm-elf target Linux RH6.2 host.  The target is
> > an ARM7 single-board computer running RedBoot w/ GDB stubs.
[...]
> >  2) Downloading with the "target" menu using the "continue" run
> >     method and "set breakpoint" works OK, but when the
> >     breakpoint is hit, none of the step, next, continue,
> >     buttons are enabled.

> It seems that the notification that the target has stopped is not
> reaching the menu and toolbar objects...
> 
> Grant, can you please start the Debug Window before you connect
> and let us know what is in there?

Here it is.  

I deleted about 400 lines of Download:: lines.  If there's
anything else I can try, let me know (I'm really bad at Tcl, so
aim low).  This trace was started before I connected to the
target.  At the end of the trace the breakpoint at
"cyg_user_start" has been hit and execution stopped.  The
source window shows the correct file, with the correct line
hightlighted and the breakpoint is indicated. The status line
at the bottom says "Program terminated. 'Run' will restart."
The 'Run' button is enabled, and the step/next/cont/finish
buttons are disbaled.  Everything under the Control meny is
disabled.

----------------------------------------------------------------------

(SrcWin::_set_state) gdb_running l=0 d=0 r=0
(global::gdbtk_clear_file) 
(SrcTextWin::clear_file) In clear_file
(SrcWin::_set_state) gdb_running l=0 d=0 r=0
(SrcWin::_set_state) gdb_downloading l=0 d=0 r=0
(SrcWin::_set_state) gdb_loaded l=0 d=0 r=0
(SrcWin::_set_state) gdb_running l=0 d=0 r=0
(ManagedWin::find) SrcWin
(global::gdbtk_locate_main) Searching MAIN___ MAIN__ main
(GDBEventHandler::GDBEventHandler::dispatch) posting event "update" to "::.srcwin0.srcwin.container.pane2.childsite.con"
(GDBEventHandler::GDBEventHandler::dispatch) posting event "update" to "::.srcwin0.srcwin.container.pane0.childsite.con"
(GDBEventHandler::GDBEventHandler::dispatch) posting event "update" to "::.srcwin0.srcwin"
(SrcWin::choose_and_update) chose window ::.srcwin0.srcwin
(SrcWin::_update) loc={} {} {} 0 0x0 0x0 {}
(SrcWin::fillNameCB) gdb_listfiles returned 
(SrcWin::location) running=0 tag= linespec={} {} {} 0 0x0 0x0 {}
(SrcWin::location) not running: name= funcname= line=0
(global::gdbtk_locate_main) Searching MAIN___ MAIN__ main
(SrcWin::_name) .srcwin0.srcwin.container.pane1.childsite.con.name 
(SrcWin::point_to_main) could not find main
(GDBEventHandler::GDBEventHandler::dispatch) posting event "busy" to "::.srcwin0.srcwin.container.pane2.childsite.con"
(GDBEventHandler::GDBEventHandler::dispatch) posting event "busy" to "::.srcwin0.srcwin.container.pane0.childsite.con"
(SrcBar::enable_ui) 0 - Browsing=0
(GDBMenuBar::set_class_state) Enable list is: Control disabled  Other disabled  Trace disabled  Attach disabled  Detach disabled
(GDBToolBar::set_class_state) Enable list is: Control disabled  Other disabled  Trace disabled  Attach disabled  Detach disabled
(GDBEventHandler::GDBEventHandler::dispatch) posting event "busy" to "::.srcwin0.srcwin"
(SrcBar) configuring runstop running
(SrcBar::_set_runstop) running
(ManagedWin::find) SrcWin
(ManagedWin::find) SrcWin
(SrcWin::fillNameCB) gdb_listfiles returned _exit.cxx aiopic.c atexit.cxx boot.s clock.cxx cnt_sem.cxx cstartup.cxx delete.cxx diag.cxx dlmalloc.cxx dmrts_ether.c dp-bit.c dummy.c errno.cxx eth_drv.c except.cxx exit.cxx fflush.cxx flag.cxx fp-bit.c hal_diag.c hal_if.c hal_misc.c haldiag.c if.c if_ether.c if_ethersubr.c if_loop.c igmp.c in.c in_cksum.c in_pcb.c in_proto.c init.cxx intr.cxx invokemain.cxx io_file.c ioinit.cxx iosys.c ip_icmp.c ip_id.c ip_input.c ip_output.c kapi.cxx kern_subr.c libgcc2.c main.cxx mainthread.cxx malloc.cxx mbox.cxx memchr.cxx memcmp.cxx memcpy.c memfixed.cxx memset.c memvar.cxx mlqueue.cxx mutex.cxx pkgstart.cxx prestart.cxx radix.c raw_cb.c raw_ip.c raw_usrreq.c route.c rtsock.c s_modf.c sched.cxx select.c serecho.c serial.c sprintf.cxx startup.cxx stdiofiles.cxx strcmp.cxx stream.cxx streambuf.cxx strerror.cxx strlen.cxx strncpy.cxx strsuppt.cxx support.c synch.c tcdiag.cxx tcp_debug.c tcp_input.c tcp_output.c tcp_subr.c tcp_timer.c tcp_usrreq.c thread.cxx timeout.c udp_usrreq.c uipc_domain.c uipc_mbuf.c uipc_socket.c uipc_socket2.c vfnprintf.cxx vsnprintf.cxx
(GDBEventHandler::GDBEventHandler::dispatch) posting event "idle" to "::.srcwin0.srcwin.container.pane2.childsite.con"
(GDBEventHandler::GDBEventHandler::dispatch) posting event "idle" to "::.srcwin0.srcwin.container.pane0.childsite.con"
(SrcBar::enable_ui) 1 - Browsing=0
(GDBMenuBar::set_class_state) Enable list is: Trace disabled  Control normal  Other normal  Attach disabled  Detach normal 
(GDBToolBar::set_class_state) Enable list is: Trace disabled  Control normal  Other normal  Attach disabled  Detach normal 
(GDBEventHandler::GDBEventHandler::dispatch) posting event "idle" to "::.srcwin0.srcwin"
(SrcBar) configuring runstop normal
(SrcBar::_set_runstop) normal
(SrcBar::enable_ui) 2 - Browsing=0
(GDBMenuBar::set_class_state) Enable list is: Control disabled  Trace disabled  Other normal  Attach normal  Detach disabled 
(GDBToolBar::set_class_state) Enable list is: Control disabled  Trace disabled  Other normal  Attach normal  Detach disabled 
(ManagedWin::find) SrcWin
(global::gdbtk_locate_main) Searching MAIN___ MAIN__ main
(SrcWin::location) running=0 tag=BROWSE_TAG linespec={/opt/ecos/ecos-cvs/ecos/packages/language/c/libc/startup/current/src/main.cxx main /opt/ecos/ecos-cvs/ecos/packages/language/c/libc/startup/current/src/main.cxx 100 0x1ee8c 0x0 {}}
(SrcWin::location) not running: name= funcname= line=
(global::gdbtk_locate_main) Searching MAIN___ MAIN__ main
(SrcWin::location) new linespec=/opt/ecos/ecos-cvs/ecos/packages/language/c/libc/startup/current/src/main.cxx main /opt/ecos/ecos-cvs/ecos/packages/language/c/libc/startup/current/src/main.cxx 100 0x1ee8c 0x0 {}
(SrcTextWin::_mtime_changed) no mtime. resetting to zero
(SrcTextWin::LoadFile) /opt/ecos/ecos-cvs/ecos/packages/language/c/libc/startup/current/src/main.cxx  SOURCE
(SrcTextWin::LoadFromCache) LoadFromCache t /opt/ecos/ecos-cvs/ecos/packages/language/c/libc/startup/current/src/main.cxx S
(SrcTextWin::LoadFromCache) name=/opt/ecos/ecos-cvs/ecos/packages/language/c/libc/startup/current/src/main.cxx
(SrcTextWin::LoadFromCache) pane=pane1
(SrcTextWin::LoadFile) READING /opt/ecos/ecos-cvs/ecos/packages/language/c/libc/startup/current/src/main.cxx
(SrcWin::_set_state) gdb_loaded l=0 d=0 r=0
(SrcWin::_set_state) gdb_running l=0 d=0 r=0
(global::gdbtk_attach_remote) Attaching....
(ManagedWin::find) SrcWin
(SrcBar::enable_ui) 2 - Browsing=0
(GDBMenuBar::set_class_state) Enable list is: Control disabled  Trace disabled  Other normal  Attach normal  Detach disabled 
(GDBToolBar::set_class_state) Enable list is: Control disabled  Trace disabled  Other normal  Attach normal  Detach disabled 
(global::set_target) CONNECTING TO TARGET: remote /dev/ttyS1 
(SrcWin::_set_state) gdb_loaded l=0 d=0 r=0
(global::run_executable) Downloading...
(SrcWin::_set_state) gdb_loaded l=0 d=0 r=0
(Download::download_it) exe=/home/grante/demo/demo/serecho.elf downloading=0
(Download::download_it)     loaded=0 target=remote running=0
(SrcWin::_set_state) gdb_downloading l=0 d=1 r=0
(SrcWin::_set_state) gdb_loaded l=0 d=1 r=0
(GDBEventHandler::GDBEventHandler::dispatch) posting event "busy" to "::.srcwin0.srcwin.container.pane2.childsite.con"
(GDBEventHandler::GDBEventHandler::dispatch) posting event "busy" to "::.srcwin0.srcwin.container.pane0.childsite.con"
(SrcBar::enable_ui) 0 - Browsing=0
(GDBMenuBar::set_class_state) Enable list is: Control disabled  Other disabled  Trace disabled  Attach disabled  Detach disabled
(GDBToolBar::set_class_state) Enable list is: Control disabled  Other disabled  Trace disabled  Attach disabled  Detach disabled
(GDBEventHandler::GDBEventHandler::dispatch) posting event "busy" to "::.srcwin0.srcwin"
(SrcBar) configuring runstop running
(SrcBar::_set_runstop) running
(Download::download_it) downloading /home/grante/demo/demo/serecho.elf
(ManagedWin::find) SrcWin
(SrcBar) configuring runstop downloading
(SrcBar::_set_runstop) downloading
(Download::download_it) starting load
(Download::download_hash) sec=.rom_vectors num=68 tot=174787 ok=0
(Download::download_hash) sec=.text num=305 tot=174787 ok=0
[...]
(Download::download_hash) sec=.boot num=4 tot=174787 ok=0
(Download::download_it) Done loading
(SrcWin::_set_state) gdb_downloading l=0 d=0 r=0
(SrcWin::_set_state) gdb_loaded l=1 d=0 r=0
(ManagedWin::find) SrcWin
(SrcBar) configuring runstop normal
(SrcBar::_set_runstop) normal
(GDBEventHandler::GDBEventHandler::dispatch) posting event "idle" to "::.srcwin0.srcwin.container.pane2.childsite.con"
(GDBEventHandler::GDBEventHandler::dispatch) posting event "idle" to "::.srcwin0.srcwin.container.pane0.childsite.con"
(SrcBar::enable_ui) 1 - Browsing=0
(GDBMenuBar::set_class_state) Enable list is: Trace disabled  Control normal  Other normal  Attach disabled  Detach normal 
(GDBToolBar::set_class_state) Enable list is: Trace disabled  Control normal  Other normal  Attach disabled  Detach normal 
(GDBEventHandler::GDBEventHandler::dispatch) posting event "idle" to "::.srcwin0.srcwin"
(SrcBar) configuring runstop normal
(SrcBar::_set_runstop) normal
(SrcBar::enable_ui) 2 - Browsing=0
(GDBMenuBar::set_class_state) Enable list is: Control disabled  Trace disabled  Other normal  Attach normal  Detach disabled 
(GDBToolBar::set_class_state) Enable list is: Control disabled  Trace disabled  Other normal  Attach normal  Detach disabled 
(SrcWin::_set_state) gdb_running l=1 d=0 r=1
(global::run_executable) Setting BP at cyg_user_start
(GDBEventHandler::GDBEventHandler::dispatch) posting event "breakpoint" to "::.srcwin0.srcwin.container.pane2.childsite.con"
(GDBEventHandler::GDBEventHandler::dispatch) posting event "breakpoint" to "::.srcwin0.srcwin.container.pane0.childsite.con"
(GDBEventHandler::GDBEventHandler::dispatch) posting event "breakpoint" to "::.srcwin0.srcwin"
(global::run_executable) Continuing target...
(GDBEventHandler::GDBEventHandler::dispatch) posting event "busy" to "::.srcwin0.srcwin.container.pane2.childsite.con"
(GDBEventHandler::GDBEventHandler::dispatch) posting event "busy" to "::.srcwin0.srcwin.container.pane0.childsite.con"
(SrcBar::enable_ui) 0 - Browsing=0
(GDBMenuBar::set_class_state) Enable list is: Control disabled  Other disabled  Trace disabled  Attach disabled  Detach disabled
(GDBToolBar::set_class_state) Enable list is: Control disabled  Other disabled  Trace disabled  Attach disabled  Detach disabled
(GDBEventHandler::GDBEventHandler::dispatch) posting event "busy" to "::.srcwin0.srcwin"
(SrcBar) configuring runstop running
(SrcBar::_set_runstop) running
(GDBEventHandler::GDBEventHandler::dispatch) posting event "update" to "::.srcwin0.srcwin.container.pane2.childsite.con"
(GDBEventHandler::GDBEventHandler::dispatch) posting event "update" to "::.srcwin0.srcwin.container.pane0.childsite.con"
(GDBEventHandler::GDBEventHandler::dispatch) posting event "update" to "::.srcwin0.srcwin"
(SrcWin::choose_and_update) chose window ::.srcwin0.srcwin
(SrcWin::_update) loc=serecho.c cyg_user_start /home/grante/demo/demo/serecho.c 72 0x99c 0x99c {}
(SrcWin::location) running=1 tag= linespec=serecho.c cyg_user_start /home/grante/demo/demo/serecho.c 72 0x99c 0x99c {}
(SrcWin::_set_state) gdb_running l=1 d=0 r=0
(SrcWin::_set_state) gdb_running l=1 d=0 r=0
(SrcWin::location) not running: name=/home/grante/demo/demo/serecho.c funcname=cyg_user_start line=72
(SrcTextWin::_mtime_changed) no mtime. resetting to zero
(SrcTextWin::LoadFile) /home/grante/demo/demo/serecho.c /opt/ecos/ecos-cvs/ecos/packages/language/c/libc/startup/current/src/main.cxx SOURCE
(SrcTextWin::LoadFromCache) LoadFromCache t /home/grante/demo/demo/serecho.c S
(SrcTextWin::LoadFromCache) name=/home/grante/demo/demo/serecho.c
(SrcTextWin::LoadFromCache) pane=pane2
(SrcTextWin::LoadFile) READING /home/grante/demo/demo/serecho.c
(GDBEventHandler::GDBEventHandler::dispatch) posting event "idle" to "::.srcwin0.srcwin.container.pane2.childsite.con"
(GDBEventHandler::GDBEventHandler::dispatch) posting event "idle" to "::.srcwin0.srcwin.container.pane0.childsite.con"
(SrcBar::enable_ui) 1 - Browsing=0
(GDBMenuBar::set_class_state) Enable list is: Trace disabled  Control normal  Other normal  Attach disabled  Detach normal 
(GDBToolBar::set_class_state) Enable list is: Trace disabled  Control normal  Other normal  Attach disabled  Detach normal 
(GDBEventHandler::GDBEventHandler::dispatch) posting event "idle" to "::.srcwin0.srcwin"
(SrcBar) configuring runstop normal
(SrcBar::_set_runstop) normal
(SrcBar::enable_ui) 2 - Browsing=0
(GDBMenuBar::set_class_state) Enable list is: Control disabled  Trace disabled  Other normal  Attach normal  Detach disabled 
(GDBToolBar::set_class_state) Enable list is: Control disabled  Trace disabled  Other normal  Attach normal  Detach disabled 
(SrcWin::_set_state) gdb_running l=1 d=0 r=0
(global::run_executable) RUNNING
(SrcWin::_set_state) gdb_running l=1 d=0 r=1
(GDBEventHandler::GDBEventHandler::dispatch) posting event "update" to "::.srcwin0.srcwin.container.pane2.childsite.con"
(GDBEventHandler::GDBEventHandler::dispatch) posting event "update" to "::.srcwin0.srcwin.container.pane0.childsite.con"
(GDBEventHandler::GDBEventHandler::dispatch) posting event "update" to "::.srcwin0.srcwin"
(SrcWin::choose_and_update) chose window ::.srcwin0.srcwin
(SrcWin::_update) loc=serecho.c cyg_user_start /home/grante/demo/demo/serecho.c 72 0x99c 0x99c {}
(SrcWin::location) running=1 tag= linespec=serecho.c cyg_user_start /home/grante/demo/demo/serecho.c 72 0x99c 0x99c {}
(SrcWin::_set_state) gdb_running l=1 d=0 r=0
(SrcWin::_set_state) gdb_running l=1 d=0 r=0
(SrcWin::location) not running: name=/home/grante/demo/demo/serecho.c funcname=cyg_user_start line=72
(GDBEventHandler::GDBEventHandler::dispatch) posting event "idle" to "::.srcwin0.srcwin.container.pane2.childsite.con"
(GDBEventHandler::GDBEventHandler::dispatch) posting event "idle" to "::.srcwin0.srcwin.container.pane0.childsite.con"
(SrcBar::enable_ui) 1 - Browsing=0
(GDBMenuBar::set_class_state) Enable list is: Trace disabled  Control normal  Other normal  Attach disabled  Detach normal 
(GDBToolBar::set_class_state) Enable list is: Trace disabled  Control normal  Other normal  Attach disabled  Detach normal 
(GDBEventHandler::GDBEventHandler::dispatch) posting event "idle" to "::.srcwin0.srcwin"
(SrcBar) configuring runstop normal
(SrcBar::_set_runstop) normal
(SrcBar::enable_ui) 2 - Browsing=0
(GDBMenuBar::set_class_state) Enable list is: Control disabled  Trace disabled  Other normal  Attach normal  Detach disabled 
(GDBToolBar::set_class_state) Enable list is: Control disabled  Trace disabled  Other normal  Attach normal  Detach disabled 
(SrcWin::_set_state) gdb_running l=1 d=0 r=0


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

* Re: No step button using insight w/ remote target.
  2001-11-07 15:19 No step button using insight w/ remote target Grant Edwards
  2001-10-01  8:25 ` Fernando Nasser
@ 2001-10-02 16:10 ` Keith Seitz
  2001-10-02 20:18   ` Grant Edwards
  2001-11-19 12:00   ` Keith Seitz
  1 sibling, 2 replies; 31+ messages in thread
From: Keith Seitz @ 2001-10-02 16:10 UTC (permalink / raw)
  To: Grant Edwards; +Cc: insight

On Wed, 7 Nov 2001, Grant Edwards wrote:

> Without the -nw option I run into a couple of problems:
>
>  1) Doing a "target remote /dev/ttyS1" command in the console
>     hangs gdb completely.

Hmm.. I cannot imagine why this happens. Is the baudrate set?

If you're on windows, you might try lowering the remote timeout. By
default, it is set to some fairly normal number, like 30. But as I recall
(maybe incorrectly now), the real timeout was HUGE on cygwin. Try setting
it to something like 1 and see if it at least times out.

>  2) Downloading with the "target" menu using the "continue" run
>     method and "set breakpoint" works OK, but when the
>     breakpoint is hit, none of the step, next, continue,
>     buttons are enabled.

This is usually symptomatic of pid/ptid problems in gdb. When your
attached (and the Control items on the toolbar are disabled), what do the
following commands return? (In Insight's console window)

(gdb) tk set ::gdb_running
(gdb) tk gdb_target_has_execution

Keith


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

* Re: No step button using insight w/ remote target.
  2001-10-02 16:10 ` Keith Seitz
@ 2001-10-02 20:18   ` Grant Edwards
  2001-10-03  9:37     ` Keith Seitz
  2001-11-19 12:06     ` Grant Edwards
  2001-11-19 12:00   ` Keith Seitz
  1 sibling, 2 replies; 31+ messages in thread
From: Grant Edwards @ 2001-10-02 20:18 UTC (permalink / raw)
  To: Keith Seitz; +Cc: insight

On Mon, Nov 19, 2001 at 11:59:56AM -0800, Keith Seitz wrote:

> >  2) Downloading with the "target" menu using the "continue" run
> >     method and "set breakpoint" works OK, but when the
> >     breakpoint is hit, none of the step, next, continue,
> >     buttons are enabled.
> 
> This is usually symptomatic of pid/ptid problems in gdb. When
> your attached (and the Control items on the toolbar are
> disabled), what do the following commands return? (In Insight's
> console window)
> 
> (gdb) tk set ::gdb_running
> (gdb) tk gdb_target_has_execution


(gdb) tk set ::gdb_running
0

(gdb) tk gdb_target_has_execution
0

-- 
Grant Edwards
grante@visi.com

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

* Re: No step button using insight w/ remote target.
  2001-10-02 20:18   ` Grant Edwards
@ 2001-10-03  9:37     ` Keith Seitz
  2001-10-03 10:54       ` Grant Edwards
  2001-11-19 12:17       ` Keith Seitz
  2001-11-19 12:06     ` Grant Edwards
  1 sibling, 2 replies; 31+ messages in thread
From: Keith Seitz @ 2001-10-03  9:37 UTC (permalink / raw)
  To: Grant Edwards; +Cc: insight

On Mon, 19 Nov 2001, Grant Edwards wrote:

> (gdb) tk set ::gdb_running
> 0

Of course. This is the problem of the problem. The toolbar buttons get
activated when gdb_running is non-zero...

> (gdb) tk gdb_target_has_execution
> 0

A ha! So this is the cause of your problems. gdb_target_has_execution does
not think that the inferior is running...

static int
gdb_target_has_execution_command (clientData, interp, objc, objv)
     ClientData clientData;
     Tcl_Interp *interp;
     int objc;
     Tcl_Obj *CONST objv[];
{
  int result = 0;

  if (target_has_execution && ! ptid_equal (inferior_ptid, null_ptid))
    result = 1;

  Tcl_SetBooleanObj (result_ptr->obj_ptr, result);
  return TCL_OK;
}

So we've got: target_has_execution is 0 and/or inferior_ptid is null_ptid.

Can you break in this function and find out what the case is?

Keith


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

* Re: No step button using insight w/ remote target.
  2001-10-03  9:37     ` Keith Seitz
@ 2001-10-03 10:54       ` Grant Edwards
  2001-10-03 11:09         ` Keith Seitz
  2001-11-19 12:49         ` Grant Edwards
  2001-11-19 12:17       ` Keith Seitz
  1 sibling, 2 replies; 31+ messages in thread
From: Grant Edwards @ 2001-10-03 10:54 UTC (permalink / raw)
  To: Keith Seitz; +Cc: insight

On Mon, Nov 19, 2001 at 12:17:35PM -0800, Keith Seitz wrote:

> > (gdb) tk gdb_target_has_execution
> > 0
> 
> A ha! So this is the cause of your problems. gdb_target_has_execution does
> not think that the inferior is running...
> 
> static int
> gdb_target_has_execution_command (clientData, interp, objc, objv)
>      ClientData clientData;
>      Tcl_Interp *interp;
>      int objc;
>      Tcl_Obj *CONST objv[];
> {
>   int result = 0;
> 
>   if (target_has_execution && ! ptid_equal (inferior_ptid, null_ptid))
>     result = 1;
> 
>   Tcl_SetBooleanObj (result_ptr->obj_ptr, result);
>   return TCL_OK;
> }
> 
> So we've got: target_has_execution is 0 and/or inferior_ptid is null_ptid.

829       if (target_has_execution && ! ptid_equal (inferior_ptid, null_ptid))
Value returned is $3 = 1
(gdb) print inferior_ptid
$4 = {pid = 0, lwp = 0, tid = 0}
(gdb) print null_ptid
$5 = {pid = 0, lwp = 0, tid = 0}
(gdb) print target_has_execution
No symbol "target_has_execution" in current context.
(gdb) 

"target_has_execution" is presumably a macro?

Anyway, inferior_ptid _is_ null_ptid, so that's probably the
issue.  The "value returned" bit is from which I did a "finish"
to get back from ptid_equal(), IOW, ptid_equal() returned 1.

I have this nagging feeling that there might be something wrong
with my GDB stubs, so I traced the remote packets and here's
the trailing end of that (starting with the last few download
packets).  I can't really see anything wrong, and it seems to
work fine in non-window mode.  But, I'm not much of a remote
protocol guru...


Sending packet: $X2ad8d,73:\002¥0\000\000\020\000\000\002\204À\000\000\000\000\000\002\231ð\000\000\026Ì\000\000\026¸\000\000\000\000\000\000\020\000\000\002\205x\000\000\022h\000\002\230ì\000\000\000\000\000\002\005\214\000\000F´\000\000\200¼\000\002I\230\000\001î\004\000\000G\f\000\000jÜ\000\001ìì\000\000kÐ\000\000tø\000\000\\\024\000\000\200Ü\000\002I¸\000\001î}\004\000\000jü\000\001í\f#89...Ack
Packet received: OKLoading section .boot, size 0x4 lma 0x0

Sending packet: $X0,4:ê\000\000ß#eb...Ack
Packet received: OKStart address 0x384, load size 174787

Sending packet: $Pf=00000384#82...Ack
Packet received: OKTransfer rate: 2807 bits/sec, 306 bytes/write.

Sending packet: $Z0,99c,4#eb...Ack
Packet received: 
Packet Z0 (software-breakpoint) is NOT supported
Sending packet: $m99c,4#a2...Ack
Packet received: e59f00c8
Sending packet: $X99c,4:çÿÞþ#89...Ack
Packet received: OK
Sending packet: $Hc0#db...Ack
Packet received: OK
Sending packet: $c#63...Ack
Packet received: T05thread:00000000;0f:0000099c;0d:0002c15c;[New Thread 0]

Sending packet: $g#67...Ack
Packet received: 001af0bc00000001000000000000000100008000007d65180000000000000013007d6510fffffffd007d7ab00002c17c0002c1800002c15c0000531c0000099c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000d3[Switching to Thread 0]

Sending packet: $m98c,4#a1...Ack
Packet received: e1a0c00d
Sending packet: $m990,4#6f...Ack
Packet received: e92dd800
Sending packet: $m994,4#73...Ack
Packet received: e24cb004
Sending packet: $m998,4#77...Ack
Packet received: e24dd014
Sending packet: $m99c,4#a2...Ack
Packet received: e7ffdefe
Sending packet: $m9a0,4#97...Ack
Packet received: eb001422
Sending packet: $m9a4,4#9b...Ack
Packet received: e59f00c4
Sending packet: $m9a8,4#9f...Ack
Packet received: eb0015e0
Sending packet: $m9ac,4#ca...Ack
Packet received: e3a03000
Sending packet: $m9b0,4#98...Ack
Packet received: e50b3010
Sending packet: $m9b4,4#9c...Ack
Packet received: e51b3010
Sending packet: $m9b8,4#a0...Ack
Packet received: e353000f
Sending packet: $m9bc,4#cb...Ack
Packet received: da000000
Sending packet: $X99c,4:å\237\000È#13...Ack
Packet received: OK
Breakpoint 1, cyg_user_start () at serecho.c:72
Current language:  auto; currently c



-- 
Grant Edwards
grante@visi.com

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

* Re: No step button using insight w/ remote target.
  2001-10-03 10:54       ` Grant Edwards
@ 2001-10-03 11:09         ` Keith Seitz
  2001-10-03 11:20           ` Grant Edwards
  2001-11-19 12:55           ` Keith Seitz
  2001-11-19 12:49         ` Grant Edwards
  1 sibling, 2 replies; 31+ messages in thread
From: Keith Seitz @ 2001-10-03 11:09 UTC (permalink / raw)
  To: Grant Edwards; +Cc: insight

On Mon, 19 Nov 2001, Grant Edwards wrote:

> 829       if (target_has_execution && ! ptid_equal (inferior_ptid, null_ptid))
> Value returned is $3 = 1
> (gdb) print inferior_ptid
> $4 = {pid = 0, lwp = 0, tid = 0}
> (gdb) print null_ptid
> $5 = {pid = 0, lwp = 0, tid = 0}
> (gdb) print target_has_execution
> No symbol "target_has_execution" in current context.
> (gdb)
>
> "target_has_execution" is presumably a macro?

Yes:
#define target_has_execution    \
     (current_target.to_has_execution)

> Anyway, inferior_ptid _is_ null_ptid, so that's probably the
> issue.  The "value returned" bit is from which I did a "finish"
> to get back from ptid_equal(), IOW, ptid_equal() returned 1.

I'm not so certain that there is something wrong with your stub. Let's
back up a little and see if the ptid is ever created...

If you step through remote_open_1, does the following line ever get
executed?


  /* Without this, some commands which require an active target (such
     as kill) won't work.  This variable serves (at least) double duty
     as both the pid of the target process (if it has such), and as a
     flag indicating that a target is active.  These functions should
     be split out into seperate variables, especially since GDB will
     someday have a notion of debugging several processes.  */

  inferior_ptid = pid_to_ptid (MAGIC_NULL_PID);

Keith


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

* Re: No step button using insight w/ remote target.
  2001-10-03 11:09         ` Keith Seitz
@ 2001-10-03 11:20           ` Grant Edwards
  2001-10-03 11:47             ` Keith Seitz
  2001-11-19 13:03             ` Grant Edwards
  2001-11-19 12:55           ` Keith Seitz
  1 sibling, 2 replies; 31+ messages in thread
From: Grant Edwards @ 2001-10-03 11:20 UTC (permalink / raw)
  To: Keith Seitz; +Cc: insight

On Mon, Nov 19, 2001 at 12:55:28PM -0800, Keith Seitz wrote:

> I'm not so certain that there is something wrong with your stub. Let's
> back up a little and see if the ptid is ever created...
> 
> If you step through remote_open_1, does the following line ever get
> executed?
[...]
>   inferior_ptid = pid_to_ptid (MAGIC_NULL_PID);

Yes.   After that line has been executed:

(gdb) print inferior_ptid
$1 = {pid = 42000, lwp = 0, tid = 0}

-- 
Grant Edwards
grante@visi.com

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

* Re: No step button using insight w/ remote target.
  2001-10-03 11:20           ` Grant Edwards
@ 2001-10-03 11:47             ` Keith Seitz
  2001-10-03 13:22               ` Grant Edwards
                                 ` (2 more replies)
  2001-11-19 13:03             ` Grant Edwards
  1 sibling, 3 replies; 31+ messages in thread
From: Keith Seitz @ 2001-10-03 11:47 UTC (permalink / raw)
  To: Grant Edwards; +Cc: insight

On Mon, 19 Nov 2001, Grant Edwards wrote:

> Yes.   After that line has been executed:
>
> (gdb) print inferior_ptid
> $1 = {pid = 42000, lwp = 0, tid = 0}

Ok, so someone is resetting it somewhere... Can you find out who that is?

Keith


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

* Re: No step button using insight w/ remote target.
  2001-10-03 11:47             ` Keith Seitz
@ 2001-10-03 13:22               ` Grant Edwards
  2001-10-03 14:03                 ` Keith Seitz
  2001-11-19 13:19                 ` Grant Edwards
  2001-10-03 16:31               ` Grant Edwards
  2001-11-19 13:05               ` Keith Seitz
  2 siblings, 2 replies; 31+ messages in thread
From: Grant Edwards @ 2001-10-03 13:22 UTC (permalink / raw)
  To: Keith Seitz; +Cc: insight

On Mon, Nov 19, 2001 at 01:05:19PM -0800, Keith Seitz wrote:
> On Mon, 19 Nov 2001, Grant Edwards wrote:
> 
> > Yes.   After that line has been executed:
> >
> > (gdb) print inferior_ptid
> > $1 = {pid = 42000, lwp = 0, tid = 0}
> 
> Ok, so someone is resetting it somewhere... Can you find out
> who that is?

Maybe...  

I tried setting a watchpoint after it was initialized by
remote_open_1, but execution is so slow, I don't know if the
serial protocol is going to work.  It doesn't look like it, but
I'm going to give it a while longer.

If you've got some suggestions for likely suspects, I could set
some breakpoints instead of using a watchpoint.

-- 
Grant Edwards
grante@visi.com

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

* Re: No step button using insight w/ remote target.
  2001-10-03 13:22               ` Grant Edwards
@ 2001-10-03 14:03                 ` Keith Seitz
  2001-10-03 15:50                   ` Grant Edwards
  2001-11-19 13:28                   ` Keith Seitz
  2001-11-19 13:19                 ` Grant Edwards
  1 sibling, 2 replies; 31+ messages in thread
From: Keith Seitz @ 2001-10-03 14:03 UTC (permalink / raw)
  To: Grant Edwards; +Cc: insight

On Mon, 19 Nov 2001, Grant Edwards wrote:

> Maybe...
>
> I tried setting a watchpoint after it was initialized by
> remote_open_1, but execution is so slow, I don't know if the
> serial protocol is going to work.  It doesn't look like it, but
> I'm going to give it a while longer.

Let me guess: you're not using an x86 with hardware watchpoints?

> If you've got some suggestions for likely suspects, I could set
> some breakpoints instead of using a watchpoint.

Well, you could grep fro places where inferior_ptid is set and break at
those...

$ grep -n "inferior_ptid =" *.c | awk -F: '{printf "break %s:%d\n", $1, $2}' > breaks

Then source this file into gdb...

Ok, this sucks, but I don't know what else to do right now.

Keith


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

* Re: No step button using insight w/ remote target.
  2001-10-03 14:03                 ` Keith Seitz
@ 2001-10-03 15:50                   ` Grant Edwards
  2001-11-19 14:12                     ` Grant Edwards
  2001-11-19 13:28                   ` Keith Seitz
  1 sibling, 1 reply; 31+ messages in thread
From: Grant Edwards @ 2001-10-03 15:50 UTC (permalink / raw)
  To: Keith Seitz; +Cc: insight

On Mon, Nov 19, 2001 at 01:28:00PM -0800, Keith Seitz wrote:
> On Mon, 19 Nov 2001, Grant Edwards wrote:

> > I tried setting a watchpoint after it was initialized by
> > remote_open_1, but execution is so slow, I don't know if the
> > serial protocol is going to work.  It doesn't look like it, but
> > I'm going to give it a while longer.
> 
> Let me guess: you're not using an x86 with hardware watchpoints?

Dunno. It's an AMD K6-400. The "watch" command didn't reply
with a "hardware watchpoint" reply, so I guess not.  Maybe I'll
try on my PIII machine.

-- 
Grant Edwards
grante@visi.com

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

* Re: No step button using insight w/ remote target.
  2001-10-03 11:47             ` Keith Seitz
  2001-10-03 13:22               ` Grant Edwards
@ 2001-10-03 16:31               ` Grant Edwards
  2001-10-04 11:28                 ` Grant Edwards
  2001-11-19 14:39                 ` Grant Edwards
  2001-11-19 13:05               ` Keith Seitz
  2 siblings, 2 replies; 31+ messages in thread
From: Grant Edwards @ 2001-10-03 16:31 UTC (permalink / raw)
  To: Keith Seitz; +Cc: insight

On Mon, Nov 19, 2001 at 01:05:19PM -0800, Keith Seitz wrote:
> On Mon, 19 Nov 2001, Grant Edwards wrote:
> 
> > Yes.   After that line has been executed:
> >
> > (gdb) print inferior_ptid
> > $1 = {pid = 42000, lwp = 0, tid = 0}
> 
> Ok, so someone is resetting it somewhere... Can you find out who that is?

It's being changed from {42000,0,0} to {0,0,0} in
infrun.c:contect_switch() at the last line in the function.
The condition (in_thread_list ...) condition is false. Neither
save_infrun_state() nor load_infrun_state() is called.

Here's the parameter to context_switch() at entry:

(gdb) print/x *ecs
$5 = {
  ws = {
    kind = 0x1, 
    value = {
      integer = 0x5, 
      sig = 0x5, 
      related_pid = 0x5, 
      execd_pathname = 0x5, 
      syscall_id = 0x5
    }
  }, 
  wp = 0xbfffafb0, 
  another_trap = 0x80d7f55, 
  random_signal = 0x0, 
  stop_func_start = 0x0, 
  stop_func_end = 0x0, 
  stop_func_name = 0x0, 
  sal = {
    symtab = 0x0, 
    section = 0x0, 
    line = 0x0, 
    pc = 0x7c6a68, 
    end = 0x0
  }, 
  remove_breakpoints_on_following_step = 0x0, 
  current_line = 0x0, 
  current_symtab = 0x0, 
  handling_longjmp = 0x0, 
  ptid = {
    pid = 0x0, 
    lwp = 0x0, 
    tid = 0x0
  }, 
  saved_inferior_ptid = {
    pid = 0x0, 
    lwp = 0xffffffff, 
    tid = 0xbfffb048
  }, 
  update_step_sp = 0x0, 
  stepping_through_solib_after_catch = 0x0, 
  stepping_through_solib_catchpoints = 0x0, 
  enable_hw_watchpoints_after_wait = 0x0, 
  stepping_through_sigtramp = 0x0, 
  new_thread_event = 0x0, 
  tmpstatus = {
    kind = 0x0, 
    value = {
      integer = 0x0, 
      sig = 0x0, 
      related_pid = 0x0, 
      execd_pathname = 0x0, 
      syscall_id = 0x0
    }
  }, 
  infwait_state = 0x0, 
  waiton_ptid = {
    pid = 0xffffffff, 
    lwp = 0x0, 
    tid = 0x0
  }, 
  wait_some_more = 0x0
}


-- 
Grant Edwards
grante@visi.com

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

* Re: No step button using insight w/ remote target.
  2001-10-03 16:31               ` Grant Edwards
@ 2001-10-04 11:28                 ` Grant Edwards
  2001-11-20 16:16                   ` Grant Edwards
  2001-11-19 14:39                 ` Grant Edwards
  1 sibling, 1 reply; 31+ messages in thread
From: Grant Edwards @ 2001-10-04 11:28 UTC (permalink / raw)
  To: Keith Seitz; +Cc: insight

On Mon, Nov 19, 2001 at 04:44:13PM -0600, Grant Edwards wrote:
> On Mon, Nov 19, 2001 at 01:05:19PM -0800, Keith Seitz wrote:

> > > (gdb) print inferior_ptid
> > > $1 = {pid = 42000, lwp = 0, tid = 0}
> > 
> > Ok, so someone is resetting it somewhere... Can you find out who that is?
> 
> It's being changed from {42000,0,0} to {0,0,0} in
> infrun.c:contect_switch() at the last line in the function.

Moving that assignment into the inside of the "then" part of
the "if (in_thread_list...)" makes things work, but I doubt
that's the right way to fix the problem.

-- 
Grant Edwards
grante@visi.com

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

* No step button using insight w/ remote target.
@ 2001-11-07 15:19 Grant Edwards
  2001-10-01  8:25 ` Fernando Nasser
  2001-10-02 16:10 ` Keith Seitz
  0 siblings, 2 replies; 31+ messages in thread
From: Grant Edwards @ 2001-11-07 15:19 UTC (permalink / raw)
  To: insight

I'm using 5.0.92 from the development snapshot ftp directory
configured for arm-elf target Linux RH6.2 host.  The target is
an ARM7 single-board computer running RedBoot w/ GDB stubs.

Evertying works swimmingly in -nw mode.

Without the -nw option I run into a couple of problems:

 1) Doing a "target remote /dev/ttyS1" command in the console
    hangs gdb completely.

 2) Downloading with the "target" menu using the "continue" run
    method and "set breakpoint" works OK, but when the
    breakpoint is hit, none of the step, next, continue,
    buttons are enabled.

    Doing "step" or "next" from the console works fine, and I
    can set breakpoints by clicking in the source window, but
    the button-bar seems to be stuck in the wrong state.

-- 
Grant Edwards
grante@visi.com

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

* Re: No step button using insight w/ remote target.
  2001-10-01  8:25 ` Fernando Nasser
  2001-10-02 14:22   ` Grant Edwards
  2001-10-02 15:40   ` Grant Edwards
@ 2001-11-12  7:13   ` Fernando Nasser
  2 siblings, 0 replies; 31+ messages in thread
From: Fernando Nasser @ 2001-11-12  7:13 UTC (permalink / raw)
  To: Grant Edwards; +Cc: insight, Keith Seitz

Grant Edwards wrote:
> 
> I'm using 5.0.92 from the development snapshot ftp directory
> configured for arm-elf target Linux RH6.2 host.  The target is
> an ARM7 single-board computer running RedBoot w/ GDB stubs.
> 
> Evertying works swimmingly in -nw mode.
> 
> Without the -nw option I run into a couple of problems:
> 
>  1) Doing a "target remote /dev/ttyS1" command in the console
>     hangs gdb completely.
> 
>  2) Downloading with the "target" menu using the "continue" run
>     method and "set breakpoint" works OK, but when the
>     breakpoint is hit, none of the step, next, continue,
>     buttons are enabled.
> 
>     Doing "step" or "next" from the console works fine, and I
>     can set breakpoints by clicking in the source window, but
>     the button-bar seems to be stuck in the wrong state.
> 

It seems that the notification that the target has stopped is not
reaching the menu and toolbar objects...

Grant, can you please start the Debug Window before you connect
and let us know what is in there?

If you set:
GDBTK_DEBUG
to 1, you'll have a Debug Window option in your View menu.  You can
open it before you connect.

I am not sure what is in your version.  Maybe you can also have a
log written by setting 
GDBTK_DEBUGFILE
to a file and setting the GDBTK_DEBUG to 1.

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

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

* Re: No step button using insight w/ remote target.
  2001-10-02 14:22   ` Grant Edwards
@ 2001-11-15 15:46     ` Grant Edwards
  0 siblings, 0 replies; 31+ messages in thread
From: Grant Edwards @ 2001-11-15 15:46 UTC (permalink / raw)
  To: Fernando Nasser; +Cc: insight, Keith Seitz

On Mon, Nov 12, 2001 at 10:13:33AM -0500, Fernando Nasser wrote:

> >  2) Downloading with the "target" menu using the "continue" run
> >     method and "set breakpoint" works OK, but when the
> >     breakpoint is hit, none of the step, next, continue,
> >     buttons are enabled.
> > 
> >     Doing "step" or "next" from the console works fine, and I
> >     can set breakpoints by clicking in the source window, but
> >     the button-bar seems to be stuck in the wrong state.
>
> It seems that the notification that the target has stopped is not
> reaching the menu and toolbar objects...

There's a status message at both bottom that says something like "Program
terminated, 'Run' to restart".  I'm guessing the wrong "signal" value is
being seen somewhere.

> Grant, can you please start the Debug Window before you connect
> and let us know what is in there?
> 
> If you set: GDBTK_DEBUG to 1, you'll have a Debug Window option in your
> View menu.  You can open it before you connect.
> 
> I am not sure what is in your version.  Maybe you can also have a log
> written by setting GDBTK_DEBUGFILE to a file and setting the GDBTK_DEBUG to
> 1.

I'll try that tomorrow.  Is tracing the remote protocol packets a useful
thing to do or is the problem more likely to be elsewhere?

-- 
Grant Edwards
grante@visi.com

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

* Re: No step button using insight w/ remote target.
  2001-10-02 15:40   ` Grant Edwards
@ 2001-11-19  8:32     ` Grant Edwards
  0 siblings, 0 replies; 31+ messages in thread
From: Grant Edwards @ 2001-11-19  8:32 UTC (permalink / raw)
  To: Fernando Nasser; +Cc: insight, Keith Seitz

On Mon, Nov 12, 2001 at 10:13:33AM -0500, Fernando Nasser wrote:
> Grant Edwards wrote:

> > I'm using 5.0.92 from the development snapshot ftp directory
> > configured for arm-elf target Linux RH6.2 host.  The target is
> > an ARM7 single-board computer running RedBoot w/ GDB stubs.
[...]
> >  2) Downloading with the "target" menu using the "continue" run
> >     method and "set breakpoint" works OK, but when the
> >     breakpoint is hit, none of the step, next, continue,
> >     buttons are enabled.

> It seems that the notification that the target has stopped is not
> reaching the menu and toolbar objects...
> 
> Grant, can you please start the Debug Window before you connect
> and let us know what is in there?

Here it is.  

I deleted about 400 lines of Download:: lines.  If there's
anything else I can try, let me know (I'm really bad at Tcl, so
aim low).  This trace was started before I connected to the
target.  At the end of the trace the breakpoint at
"cyg_user_start" has been hit and execution stopped.  The
source window shows the correct file, with the correct line
hightlighted and the breakpoint is indicated. The status line
at the bottom says "Program terminated. 'Run' will restart."
The 'Run' button is enabled, and the step/next/cont/finish
buttons are disbaled.  Everything under the Control meny is
disabled.

----------------------------------------------------------------------

(SrcWin::_set_state) gdb_running l=0 d=0 r=0
(global::gdbtk_clear_file) 
(SrcTextWin::clear_file) In clear_file
(SrcWin::_set_state) gdb_running l=0 d=0 r=0
(SrcWin::_set_state) gdb_downloading l=0 d=0 r=0
(SrcWin::_set_state) gdb_loaded l=0 d=0 r=0
(SrcWin::_set_state) gdb_running l=0 d=0 r=0
(ManagedWin::find) SrcWin
(global::gdbtk_locate_main) Searching MAIN___ MAIN__ main
(GDBEventHandler::GDBEventHandler::dispatch) posting event "update" to "::.srcwin0.srcwin.container.pane2.childsite.con"
(GDBEventHandler::GDBEventHandler::dispatch) posting event "update" to "::.srcwin0.srcwin.container.pane0.childsite.con"
(GDBEventHandler::GDBEventHandler::dispatch) posting event "update" to "::.srcwin0.srcwin"
(SrcWin::choose_and_update) chose window ::.srcwin0.srcwin
(SrcWin::_update) loc={} {} {} 0 0x0 0x0 {}
(SrcWin::fillNameCB) gdb_listfiles returned 
(SrcWin::location) running=0 tag= linespec={} {} {} 0 0x0 0x0 {}
(SrcWin::location) not running: name= funcname= line=0
(global::gdbtk_locate_main) Searching MAIN___ MAIN__ main
(SrcWin::_name) .srcwin0.srcwin.container.pane1.childsite.con.name 
(SrcWin::point_to_main) could not find main
(GDBEventHandler::GDBEventHandler::dispatch) posting event "busy" to "::.srcwin0.srcwin.container.pane2.childsite.con"
(GDBEventHandler::GDBEventHandler::dispatch) posting event "busy" to "::.srcwin0.srcwin.container.pane0.childsite.con"
(SrcBar::enable_ui) 0 - Browsing=0
(GDBMenuBar::set_class_state) Enable list is: Control disabled  Other disabled  Trace disabled  Attach disabled  Detach disabled
(GDBToolBar::set_class_state) Enable list is: Control disabled  Other disabled  Trace disabled  Attach disabled  Detach disabled
(GDBEventHandler::GDBEventHandler::dispatch) posting event "busy" to "::.srcwin0.srcwin"
(SrcBar) configuring runstop running
(SrcBar::_set_runstop) running
(ManagedWin::find) SrcWin
(ManagedWin::find) SrcWin
(SrcWin::fillNameCB) gdb_listfiles returned _exit.cxx aiopic.c atexit.cxx boot.s clock.cxx cnt_sem.cxx cstartup.cxx delete.cxx diag.cxx dlmalloc.cxx dmrts_ether.c dp-bit.c dummy.c errno.cxx eth_drv.c except.cxx exit.cxx fflush.cxx flag.cxx fp-bit.c hal_diag.c hal_if.c hal_misc.c haldiag.c if.c if_ether.c if_ethersubr.c if_loop.c igmp.c in.c in_cksum.c in_pcb.c in_proto.c init.cxx intr.cxx invokemain.cxx io_file.c ioinit.cxx iosys.c ip_icmp.c ip_id.c ip_input.c ip_output.c kapi.cxx kern_subr.c libgcc2.c main.cxx mainthread.cxx malloc.cxx mbox.cxx memchr.cxx memcmp.cxx memcpy.c memfixed.cxx memset.c memvar.cxx mlqueue.cxx mutex.cxx pkgstart.cxx prestart.cxx radix.c raw_cb.c raw_ip.c raw_usrreq.c route.c rtsock.c s_modf.c sched.cxx select.c serecho.c serial.c sprintf.cxx startup.cxx stdiofiles.cxx strcmp.cxx stream.cxx streambuf.cxx strerror.cxx strlen.cxx strncpy.cxx strsuppt.cxx support.c synch.c tcdiag.cxx tcp_debug.c tcp_input.c tcp_output.c tcp_subr.c tcp_timer.c tcp_usrreq.c thread.cxx timeout.c udp_usrreq.c uipc_domain.c uipc_mbuf.c uipc_socket.c uipc_socket2.c vfnprintf.cxx vsnprintf.cxx
(GDBEventHandler::GDBEventHandler::dispatch) posting event "idle" to "::.srcwin0.srcwin.container.pane2.childsite.con"
(GDBEventHandler::GDBEventHandler::dispatch) posting event "idle" to "::.srcwin0.srcwin.container.pane0.childsite.con"
(SrcBar::enable_ui) 1 - Browsing=0
(GDBMenuBar::set_class_state) Enable list is: Trace disabled  Control normal  Other normal  Attach disabled  Detach normal 
(GDBToolBar::set_class_state) Enable list is: Trace disabled  Control normal  Other normal  Attach disabled  Detach normal 
(GDBEventHandler::GDBEventHandler::dispatch) posting event "idle" to "::.srcwin0.srcwin"
(SrcBar) configuring runstop normal
(SrcBar::_set_runstop) normal
(SrcBar::enable_ui) 2 - Browsing=0
(GDBMenuBar::set_class_state) Enable list is: Control disabled  Trace disabled  Other normal  Attach normal  Detach disabled 
(GDBToolBar::set_class_state) Enable list is: Control disabled  Trace disabled  Other normal  Attach normal  Detach disabled 
(ManagedWin::find) SrcWin
(global::gdbtk_locate_main) Searching MAIN___ MAIN__ main
(SrcWin::location) running=0 tag=BROWSE_TAG linespec={/opt/ecos/ecos-cvs/ecos/packages/language/c/libc/startup/current/src/main.cxx main /opt/ecos/ecos-cvs/ecos/packages/language/c/libc/startup/current/src/main.cxx 100 0x1ee8c 0x0 {}}
(SrcWin::location) not running: name= funcname= line=
(global::gdbtk_locate_main) Searching MAIN___ MAIN__ main
(SrcWin::location) new linespec=/opt/ecos/ecos-cvs/ecos/packages/language/c/libc/startup/current/src/main.cxx main /opt/ecos/ecos-cvs/ecos/packages/language/c/libc/startup/current/src/main.cxx 100 0x1ee8c 0x0 {}
(SrcTextWin::_mtime_changed) no mtime. resetting to zero
(SrcTextWin::LoadFile) /opt/ecos/ecos-cvs/ecos/packages/language/c/libc/startup/current/src/main.cxx  SOURCE
(SrcTextWin::LoadFromCache) LoadFromCache t /opt/ecos/ecos-cvs/ecos/packages/language/c/libc/startup/current/src/main.cxx S
(SrcTextWin::LoadFromCache) name=/opt/ecos/ecos-cvs/ecos/packages/language/c/libc/startup/current/src/main.cxx
(SrcTextWin::LoadFromCache) pane=pane1
(SrcTextWin::LoadFile) READING /opt/ecos/ecos-cvs/ecos/packages/language/c/libc/startup/current/src/main.cxx
(SrcWin::_set_state) gdb_loaded l=0 d=0 r=0
(SrcWin::_set_state) gdb_running l=0 d=0 r=0
(global::gdbtk_attach_remote) Attaching....
(ManagedWin::find) SrcWin
(SrcBar::enable_ui) 2 - Browsing=0
(GDBMenuBar::set_class_state) Enable list is: Control disabled  Trace disabled  Other normal  Attach normal  Detach disabled 
(GDBToolBar::set_class_state) Enable list is: Control disabled  Trace disabled  Other normal  Attach normal  Detach disabled 
(global::set_target) CONNECTING TO TARGET: remote /dev/ttyS1 
(SrcWin::_set_state) gdb_loaded l=0 d=0 r=0
(global::run_executable) Downloading...
(SrcWin::_set_state) gdb_loaded l=0 d=0 r=0
(Download::download_it) exe=/home/grante/demo/demo/serecho.elf downloading=0
(Download::download_it)     loaded=0 target=remote running=0
(SrcWin::_set_state) gdb_downloading l=0 d=1 r=0
(SrcWin::_set_state) gdb_loaded l=0 d=1 r=0
(GDBEventHandler::GDBEventHandler::dispatch) posting event "busy" to "::.srcwin0.srcwin.container.pane2.childsite.con"
(GDBEventHandler::GDBEventHandler::dispatch) posting event "busy" to "::.srcwin0.srcwin.container.pane0.childsite.con"
(SrcBar::enable_ui) 0 - Browsing=0
(GDBMenuBar::set_class_state) Enable list is: Control disabled  Other disabled  Trace disabled  Attach disabled  Detach disabled
(GDBToolBar::set_class_state) Enable list is: Control disabled  Other disabled  Trace disabled  Attach disabled  Detach disabled
(GDBEventHandler::GDBEventHandler::dispatch) posting event "busy" to "::.srcwin0.srcwin"
(SrcBar) configuring runstop running
(SrcBar::_set_runstop) running
(Download::download_it) downloading /home/grante/demo/demo/serecho.elf
(ManagedWin::find) SrcWin
(SrcBar) configuring runstop downloading
(SrcBar::_set_runstop) downloading
(Download::download_it) starting load
(Download::download_hash) sec=.rom_vectors num=68 tot=174787 ok=0
(Download::download_hash) sec=.text num=305 tot=174787 ok=0
[...]
(Download::download_hash) sec=.boot num=4 tot=174787 ok=0
(Download::download_it) Done loading
(SrcWin::_set_state) gdb_downloading l=0 d=0 r=0
(SrcWin::_set_state) gdb_loaded l=1 d=0 r=0
(ManagedWin::find) SrcWin
(SrcBar) configuring runstop normal
(SrcBar::_set_runstop) normal
(GDBEventHandler::GDBEventHandler::dispatch) posting event "idle" to "::.srcwin0.srcwin.container.pane2.childsite.con"
(GDBEventHandler::GDBEventHandler::dispatch) posting event "idle" to "::.srcwin0.srcwin.container.pane0.childsite.con"
(SrcBar::enable_ui) 1 - Browsing=0
(GDBMenuBar::set_class_state) Enable list is: Trace disabled  Control normal  Other normal  Attach disabled  Detach normal 
(GDBToolBar::set_class_state) Enable list is: Trace disabled  Control normal  Other normal  Attach disabled  Detach normal 
(GDBEventHandler::GDBEventHandler::dispatch) posting event "idle" to "::.srcwin0.srcwin"
(SrcBar) configuring runstop normal
(SrcBar::_set_runstop) normal
(SrcBar::enable_ui) 2 - Browsing=0
(GDBMenuBar::set_class_state) Enable list is: Control disabled  Trace disabled  Other normal  Attach normal  Detach disabled 
(GDBToolBar::set_class_state) Enable list is: Control disabled  Trace disabled  Other normal  Attach normal  Detach disabled 
(SrcWin::_set_state) gdb_running l=1 d=0 r=1
(global::run_executable) Setting BP at cyg_user_start
(GDBEventHandler::GDBEventHandler::dispatch) posting event "breakpoint" to "::.srcwin0.srcwin.container.pane2.childsite.con"
(GDBEventHandler::GDBEventHandler::dispatch) posting event "breakpoint" to "::.srcwin0.srcwin.container.pane0.childsite.con"
(GDBEventHandler::GDBEventHandler::dispatch) posting event "breakpoint" to "::.srcwin0.srcwin"
(global::run_executable) Continuing target...
(GDBEventHandler::GDBEventHandler::dispatch) posting event "busy" to "::.srcwin0.srcwin.container.pane2.childsite.con"
(GDBEventHandler::GDBEventHandler::dispatch) posting event "busy" to "::.srcwin0.srcwin.container.pane0.childsite.con"
(SrcBar::enable_ui) 0 - Browsing=0
(GDBMenuBar::set_class_state) Enable list is: Control disabled  Other disabled  Trace disabled  Attach disabled  Detach disabled
(GDBToolBar::set_class_state) Enable list is: Control disabled  Other disabled  Trace disabled  Attach disabled  Detach disabled
(GDBEventHandler::GDBEventHandler::dispatch) posting event "busy" to "::.srcwin0.srcwin"
(SrcBar) configuring runstop running
(SrcBar::_set_runstop) running
(GDBEventHandler::GDBEventHandler::dispatch) posting event "update" to "::.srcwin0.srcwin.container.pane2.childsite.con"
(GDBEventHandler::GDBEventHandler::dispatch) posting event "update" to "::.srcwin0.srcwin.container.pane0.childsite.con"
(GDBEventHandler::GDBEventHandler::dispatch) posting event "update" to "::.srcwin0.srcwin"
(SrcWin::choose_and_update) chose window ::.srcwin0.srcwin
(SrcWin::_update) loc=serecho.c cyg_user_start /home/grante/demo/demo/serecho.c 72 0x99c 0x99c {}
(SrcWin::location) running=1 tag= linespec=serecho.c cyg_user_start /home/grante/demo/demo/serecho.c 72 0x99c 0x99c {}
(SrcWin::_set_state) gdb_running l=1 d=0 r=0
(SrcWin::_set_state) gdb_running l=1 d=0 r=0
(SrcWin::location) not running: name=/home/grante/demo/demo/serecho.c funcname=cyg_user_start line=72
(SrcTextWin::_mtime_changed) no mtime. resetting to zero
(SrcTextWin::LoadFile) /home/grante/demo/demo/serecho.c /opt/ecos/ecos-cvs/ecos/packages/language/c/libc/startup/current/src/main.cxx SOURCE
(SrcTextWin::LoadFromCache) LoadFromCache t /home/grante/demo/demo/serecho.c S
(SrcTextWin::LoadFromCache) name=/home/grante/demo/demo/serecho.c
(SrcTextWin::LoadFromCache) pane=pane2
(SrcTextWin::LoadFile) READING /home/grante/demo/demo/serecho.c
(GDBEventHandler::GDBEventHandler::dispatch) posting event "idle" to "::.srcwin0.srcwin.container.pane2.childsite.con"
(GDBEventHandler::GDBEventHandler::dispatch) posting event "idle" to "::.srcwin0.srcwin.container.pane0.childsite.con"
(SrcBar::enable_ui) 1 - Browsing=0
(GDBMenuBar::set_class_state) Enable list is: Trace disabled  Control normal  Other normal  Attach disabled  Detach normal 
(GDBToolBar::set_class_state) Enable list is: Trace disabled  Control normal  Other normal  Attach disabled  Detach normal 
(GDBEventHandler::GDBEventHandler::dispatch) posting event "idle" to "::.srcwin0.srcwin"
(SrcBar) configuring runstop normal
(SrcBar::_set_runstop) normal
(SrcBar::enable_ui) 2 - Browsing=0
(GDBMenuBar::set_class_state) Enable list is: Control disabled  Trace disabled  Other normal  Attach normal  Detach disabled 
(GDBToolBar::set_class_state) Enable list is: Control disabled  Trace disabled  Other normal  Attach normal  Detach disabled 
(SrcWin::_set_state) gdb_running l=1 d=0 r=0
(global::run_executable) RUNNING
(SrcWin::_set_state) gdb_running l=1 d=0 r=1
(GDBEventHandler::GDBEventHandler::dispatch) posting event "update" to "::.srcwin0.srcwin.container.pane2.childsite.con"
(GDBEventHandler::GDBEventHandler::dispatch) posting event "update" to "::.srcwin0.srcwin.container.pane0.childsite.con"
(GDBEventHandler::GDBEventHandler::dispatch) posting event "update" to "::.srcwin0.srcwin"
(SrcWin::choose_and_update) chose window ::.srcwin0.srcwin
(SrcWin::_update) loc=serecho.c cyg_user_start /home/grante/demo/demo/serecho.c 72 0x99c 0x99c {}
(SrcWin::location) running=1 tag= linespec=serecho.c cyg_user_start /home/grante/demo/demo/serecho.c 72 0x99c 0x99c {}
(SrcWin::_set_state) gdb_running l=1 d=0 r=0
(SrcWin::_set_state) gdb_running l=1 d=0 r=0
(SrcWin::location) not running: name=/home/grante/demo/demo/serecho.c funcname=cyg_user_start line=72
(GDBEventHandler::GDBEventHandler::dispatch) posting event "idle" to "::.srcwin0.srcwin.container.pane2.childsite.con"
(GDBEventHandler::GDBEventHandler::dispatch) posting event "idle" to "::.srcwin0.srcwin.container.pane0.childsite.con"
(SrcBar::enable_ui) 1 - Browsing=0
(GDBMenuBar::set_class_state) Enable list is: Trace disabled  Control normal  Other normal  Attach disabled  Detach normal 
(GDBToolBar::set_class_state) Enable list is: Trace disabled  Control normal  Other normal  Attach disabled  Detach normal 
(GDBEventHandler::GDBEventHandler::dispatch) posting event "idle" to "::.srcwin0.srcwin"
(SrcBar) configuring runstop normal
(SrcBar::_set_runstop) normal
(SrcBar::enable_ui) 2 - Browsing=0
(GDBMenuBar::set_class_state) Enable list is: Control disabled  Trace disabled  Other normal  Attach normal  Detach disabled 
(GDBToolBar::set_class_state) Enable list is: Control disabled  Trace disabled  Other normal  Attach normal  Detach disabled 
(SrcWin::_set_state) gdb_running l=1 d=0 r=0


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

* Re: No step button using insight w/ remote target.
  2001-10-02 16:10 ` Keith Seitz
  2001-10-02 20:18   ` Grant Edwards
@ 2001-11-19 12:00   ` Keith Seitz
  1 sibling, 0 replies; 31+ messages in thread
From: Keith Seitz @ 2001-11-19 12:00 UTC (permalink / raw)
  To: Grant Edwards; +Cc: insight

On Wed, 7 Nov 2001, Grant Edwards wrote:

> Without the -nw option I run into a couple of problems:
>
>  1) Doing a "target remote /dev/ttyS1" command in the console
>     hangs gdb completely.

Hmm.. I cannot imagine why this happens. Is the baudrate set?

If you're on windows, you might try lowering the remote timeout. By
default, it is set to some fairly normal number, like 30. But as I recall
(maybe incorrectly now), the real timeout was HUGE on cygwin. Try setting
it to something like 1 and see if it at least times out.

>  2) Downloading with the "target" menu using the "continue" run
>     method and "set breakpoint" works OK, but when the
>     breakpoint is hit, none of the step, next, continue,
>     buttons are enabled.

This is usually symptomatic of pid/ptid problems in gdb. When your
attached (and the Control items on the toolbar are disabled), what do the
following commands return? (In Insight's console window)

(gdb) tk set ::gdb_running
(gdb) tk gdb_target_has_execution

Keith


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

* Re: No step button using insight w/ remote target.
  2001-10-02 20:18   ` Grant Edwards
  2001-10-03  9:37     ` Keith Seitz
@ 2001-11-19 12:06     ` Grant Edwards
  1 sibling, 0 replies; 31+ messages in thread
From: Grant Edwards @ 2001-11-19 12:06 UTC (permalink / raw)
  To: Keith Seitz; +Cc: insight

On Mon, Nov 19, 2001 at 11:59:56AM -0800, Keith Seitz wrote:

> >  2) Downloading with the "target" menu using the "continue" run
> >     method and "set breakpoint" works OK, but when the
> >     breakpoint is hit, none of the step, next, continue,
> >     buttons are enabled.
> 
> This is usually symptomatic of pid/ptid problems in gdb. When
> your attached (and the Control items on the toolbar are
> disabled), what do the following commands return? (In Insight's
> console window)
> 
> (gdb) tk set ::gdb_running
> (gdb) tk gdb_target_has_execution


(gdb) tk set ::gdb_running
0

(gdb) tk gdb_target_has_execution
0

-- 
Grant Edwards
grante@visi.com

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

* Re: No step button using insight w/ remote target.
  2001-10-03  9:37     ` Keith Seitz
  2001-10-03 10:54       ` Grant Edwards
@ 2001-11-19 12:17       ` Keith Seitz
  1 sibling, 0 replies; 31+ messages in thread
From: Keith Seitz @ 2001-11-19 12:17 UTC (permalink / raw)
  To: Grant Edwards; +Cc: insight

On Mon, 19 Nov 2001, Grant Edwards wrote:

> (gdb) tk set ::gdb_running
> 0

Of course. This is the problem of the problem. The toolbar buttons get
activated when gdb_running is non-zero...

> (gdb) tk gdb_target_has_execution
> 0

A ha! So this is the cause of your problems. gdb_target_has_execution does
not think that the inferior is running...

static int
gdb_target_has_execution_command (clientData, interp, objc, objv)
     ClientData clientData;
     Tcl_Interp *interp;
     int objc;
     Tcl_Obj *CONST objv[];
{
  int result = 0;

  if (target_has_execution && ! ptid_equal (inferior_ptid, null_ptid))
    result = 1;

  Tcl_SetBooleanObj (result_ptr->obj_ptr, result);
  return TCL_OK;
}

So we've got: target_has_execution is 0 and/or inferior_ptid is null_ptid.

Can you break in this function and find out what the case is?

Keith


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

* Re: No step button using insight w/ remote target.
  2001-10-03 10:54       ` Grant Edwards
  2001-10-03 11:09         ` Keith Seitz
@ 2001-11-19 12:49         ` Grant Edwards
  1 sibling, 0 replies; 31+ messages in thread
From: Grant Edwards @ 2001-11-19 12:49 UTC (permalink / raw)
  To: Keith Seitz; +Cc: insight

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 4051 bytes --]

On Mon, Nov 19, 2001 at 12:17:35PM -0800, Keith Seitz wrote:

> > (gdb) tk gdb_target_has_execution
> > 0
> 
> A ha! So this is the cause of your problems. gdb_target_has_execution does
> not think that the inferior is running...
> 
> static int
> gdb_target_has_execution_command (clientData, interp, objc, objv)
>      ClientData clientData;
>      Tcl_Interp *interp;
>      int objc;
>      Tcl_Obj *CONST objv[];
> {
>   int result = 0;
> 
>   if (target_has_execution && ! ptid_equal (inferior_ptid, null_ptid))
>     result = 1;
> 
>   Tcl_SetBooleanObj (result_ptr->obj_ptr, result);
>   return TCL_OK;
> }
> 
> So we've got: target_has_execution is 0 and/or inferior_ptid is null_ptid.

829       if (target_has_execution && ! ptid_equal (inferior_ptid, null_ptid))
Value returned is $3 = 1
(gdb) print inferior_ptid
$4 = {pid = 0, lwp = 0, tid = 0}
(gdb) print null_ptid
$5 = {pid = 0, lwp = 0, tid = 0}
(gdb) print target_has_execution
No symbol "target_has_execution" in current context.
(gdb) 

"target_has_execution" is presumably a macro?

Anyway, inferior_ptid _is_ null_ptid, so that's probably the
issue.  The "value returned" bit is from which I did a "finish"
to get back from ptid_equal(), IOW, ptid_equal() returned 1.

I have this nagging feeling that there might be something wrong
with my GDB stubs, so I traced the remote packets and here's
the trailing end of that (starting with the last few download
packets).  I can't really see anything wrong, and it seems to
work fine in non-window mode.  But, I'm not much of a remote
protocol guru...


Sending packet: $X2ad8d,73:\002¥0\000\000\020\000\000\002\204À\000\000\000\000\000\002\231ð\000\000\026Ì\000\000\026¸\000\000\000\000\000\000\020\000\000\002\205x\000\000\022h\000\002\230ì\000\000\000\000\000\002\005\214\000\000F´\000\000\200¼\000\002I\230\000\001î\004\000\000G\f\000\000jÜ\000\001ìì\000\000kÐ\000\000tø\000\000\\\024\000\000\200Ü\000\002I¸\000\001î}\004\000\000jü\000\001í\f#89...Ack
Packet received: OKLoading section .boot, size 0x4 lma 0x0

Sending packet: $X0,4:ê\000\000ß#eb...Ack
Packet received: OKStart address 0x384, load size 174787

Sending packet: $Pf=00000384#82...Ack
Packet received: OKTransfer rate: 2807 bits/sec, 306 bytes/write.

Sending packet: $Z0,99c,4#eb...Ack
Packet received: 
Packet Z0 (software-breakpoint) is NOT supported
Sending packet: $m99c,4#a2...Ack
Packet received: e59f00c8
Sending packet: $X99c,4:çÿÞþ#89...Ack
Packet received: OK
Sending packet: $Hc0#db...Ack
Packet received: OK
Sending packet: $c#63...Ack
Packet received: T05thread:00000000;0f:0000099c;0d:0002c15c;[New Thread 0]

Sending packet: $g#67...Ack
Packet received: 001af0bc00000001000000000000000100008000007d65180000000000000013007d6510fffffffd007d7ab00002c17c0002c1800002c15c0000531c0000099c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000d3[Switching to Thread 0]

Sending packet: $m98c,4#a1...Ack
Packet received: e1a0c00d
Sending packet: $m990,4#6f...Ack
Packet received: e92dd800
Sending packet: $m994,4#73...Ack
Packet received: e24cb004
Sending packet: $m998,4#77...Ack
Packet received: e24dd014
Sending packet: $m99c,4#a2...Ack
Packet received: e7ffdefe
Sending packet: $m9a0,4#97...Ack
Packet received: eb001422
Sending packet: $m9a4,4#9b...Ack
Packet received: e59f00c4
Sending packet: $m9a8,4#9f...Ack
Packet received: eb0015e0
Sending packet: $m9ac,4#ca...Ack
Packet received: e3a03000
Sending packet: $m9b0,4#98...Ack
Packet received: e50b3010
Sending packet: $m9b4,4#9c...Ack
Packet received: e51b3010
Sending packet: $m9b8,4#a0...Ack
Packet received: e353000f
Sending packet: $m9bc,4#cb...Ack
Packet received: da000000
Sending packet: $X99c,4:å\237\000È#13...Ack
Packet received: OK
Breakpoint 1, cyg_user_start () at serecho.c:72
Current language:  auto; currently c



-- 
Grant Edwards
grante@visi.com

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

* Re: No step button using insight w/ remote target.
  2001-10-03 11:09         ` Keith Seitz
  2001-10-03 11:20           ` Grant Edwards
@ 2001-11-19 12:55           ` Keith Seitz
  1 sibling, 0 replies; 31+ messages in thread
From: Keith Seitz @ 2001-11-19 12:55 UTC (permalink / raw)
  To: Grant Edwards; +Cc: insight

On Mon, 19 Nov 2001, Grant Edwards wrote:

> 829       if (target_has_execution && ! ptid_equal (inferior_ptid, null_ptid))
> Value returned is $3 = 1
> (gdb) print inferior_ptid
> $4 = {pid = 0, lwp = 0, tid = 0}
> (gdb) print null_ptid
> $5 = {pid = 0, lwp = 0, tid = 0}
> (gdb) print target_has_execution
> No symbol "target_has_execution" in current context.
> (gdb)
>
> "target_has_execution" is presumably a macro?

Yes:
#define target_has_execution    \
     (current_target.to_has_execution)

> Anyway, inferior_ptid _is_ null_ptid, so that's probably the
> issue.  The "value returned" bit is from which I did a "finish"
> to get back from ptid_equal(), IOW, ptid_equal() returned 1.

I'm not so certain that there is something wrong with your stub. Let's
back up a little and see if the ptid is ever created...

If you step through remote_open_1, does the following line ever get
executed?


  /* Without this, some commands which require an active target (such
     as kill) won't work.  This variable serves (at least) double duty
     as both the pid of the target process (if it has such), and as a
     flag indicating that a target is active.  These functions should
     be split out into seperate variables, especially since GDB will
     someday have a notion of debugging several processes.  */

  inferior_ptid = pid_to_ptid (MAGIC_NULL_PID);

Keith


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

* Re: No step button using insight w/ remote target.
  2001-10-03 11:20           ` Grant Edwards
  2001-10-03 11:47             ` Keith Seitz
@ 2001-11-19 13:03             ` Grant Edwards
  1 sibling, 0 replies; 31+ messages in thread
From: Grant Edwards @ 2001-11-19 13:03 UTC (permalink / raw)
  To: Keith Seitz; +Cc: insight

On Mon, Nov 19, 2001 at 12:55:28PM -0800, Keith Seitz wrote:

> I'm not so certain that there is something wrong with your stub. Let's
> back up a little and see if the ptid is ever created...
> 
> If you step through remote_open_1, does the following line ever get
> executed?
[...]
>   inferior_ptid = pid_to_ptid (MAGIC_NULL_PID);

Yes.   After that line has been executed:

(gdb) print inferior_ptid
$1 = {pid = 42000, lwp = 0, tid = 0}

-- 
Grant Edwards
grante@visi.com

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

* Re: No step button using insight w/ remote target.
  2001-10-03 11:47             ` Keith Seitz
  2001-10-03 13:22               ` Grant Edwards
  2001-10-03 16:31               ` Grant Edwards
@ 2001-11-19 13:05               ` Keith Seitz
  2 siblings, 0 replies; 31+ messages in thread
From: Keith Seitz @ 2001-11-19 13:05 UTC (permalink / raw)
  To: Grant Edwards; +Cc: insight

On Mon, 19 Nov 2001, Grant Edwards wrote:

> Yes.   After that line has been executed:
>
> (gdb) print inferior_ptid
> $1 = {pid = 42000, lwp = 0, tid = 0}

Ok, so someone is resetting it somewhere... Can you find out who that is?

Keith


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

* Re: No step button using insight w/ remote target.
  2001-10-03 13:22               ` Grant Edwards
  2001-10-03 14:03                 ` Keith Seitz
@ 2001-11-19 13:19                 ` Grant Edwards
  1 sibling, 0 replies; 31+ messages in thread
From: Grant Edwards @ 2001-11-19 13:19 UTC (permalink / raw)
  To: Keith Seitz; +Cc: insight

On Mon, Nov 19, 2001 at 01:05:19PM -0800, Keith Seitz wrote:
> On Mon, 19 Nov 2001, Grant Edwards wrote:
> 
> > Yes.   After that line has been executed:
> >
> > (gdb) print inferior_ptid
> > $1 = {pid = 42000, lwp = 0, tid = 0}
> 
> Ok, so someone is resetting it somewhere... Can you find out
> who that is?

Maybe...  

I tried setting a watchpoint after it was initialized by
remote_open_1, but execution is so slow, I don't know if the
serial protocol is going to work.  It doesn't look like it, but
I'm going to give it a while longer.

If you've got some suggestions for likely suspects, I could set
some breakpoints instead of using a watchpoint.

-- 
Grant Edwards
grante@visi.com

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

* Re: No step button using insight w/ remote target.
  2001-10-03 14:03                 ` Keith Seitz
  2001-10-03 15:50                   ` Grant Edwards
@ 2001-11-19 13:28                   ` Keith Seitz
  1 sibling, 0 replies; 31+ messages in thread
From: Keith Seitz @ 2001-11-19 13:28 UTC (permalink / raw)
  To: Grant Edwards; +Cc: insight

On Mon, 19 Nov 2001, Grant Edwards wrote:

> Maybe...
>
> I tried setting a watchpoint after it was initialized by
> remote_open_1, but execution is so slow, I don't know if the
> serial protocol is going to work.  It doesn't look like it, but
> I'm going to give it a while longer.

Let me guess: you're not using an x86 with hardware watchpoints?

> If you've got some suggestions for likely suspects, I could set
> some breakpoints instead of using a watchpoint.

Well, you could grep fro places where inferior_ptid is set and break at
those...

$ grep -n "inferior_ptid =" *.c | awk -F: '{printf "break %s:%d\n", $1, $2}' > breaks

Then source this file into gdb...

Ok, this sucks, but I don't know what else to do right now.

Keith


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

* Re: No step button using insight w/ remote target.
  2001-10-03 15:50                   ` Grant Edwards
@ 2001-11-19 14:12                     ` Grant Edwards
  0 siblings, 0 replies; 31+ messages in thread
From: Grant Edwards @ 2001-11-19 14:12 UTC (permalink / raw)
  To: Keith Seitz; +Cc: insight

On Mon, Nov 19, 2001 at 01:28:00PM -0800, Keith Seitz wrote:
> On Mon, 19 Nov 2001, Grant Edwards wrote:

> > I tried setting a watchpoint after it was initialized by
> > remote_open_1, but execution is so slow, I don't know if the
> > serial protocol is going to work.  It doesn't look like it, but
> > I'm going to give it a while longer.
> 
> Let me guess: you're not using an x86 with hardware watchpoints?

Dunno. It's an AMD K6-400. The "watch" command didn't reply
with a "hardware watchpoint" reply, so I guess not.  Maybe I'll
try on my PIII machine.

-- 
Grant Edwards
grante@visi.com

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

* Re: No step button using insight w/ remote target.
  2001-10-03 16:31               ` Grant Edwards
  2001-10-04 11:28                 ` Grant Edwards
@ 2001-11-19 14:39                 ` Grant Edwards
  1 sibling, 0 replies; 31+ messages in thread
From: Grant Edwards @ 2001-11-19 14:39 UTC (permalink / raw)
  To: Keith Seitz; +Cc: insight

On Mon, Nov 19, 2001 at 01:05:19PM -0800, Keith Seitz wrote:
> On Mon, 19 Nov 2001, Grant Edwards wrote:
> 
> > Yes.   After that line has been executed:
> >
> > (gdb) print inferior_ptid
> > $1 = {pid = 42000, lwp = 0, tid = 0}
> 
> Ok, so someone is resetting it somewhere... Can you find out who that is?

It's being changed from {42000,0,0} to {0,0,0} in
infrun.c:contect_switch() at the last line in the function.
The condition (in_thread_list ...) condition is false. Neither
save_infrun_state() nor load_infrun_state() is called.

Here's the parameter to context_switch() at entry:

(gdb) print/x *ecs
$5 = {
  ws = {
    kind = 0x1, 
    value = {
      integer = 0x5, 
      sig = 0x5, 
      related_pid = 0x5, 
      execd_pathname = 0x5, 
      syscall_id = 0x5
    }
  }, 
  wp = 0xbfffafb0, 
  another_trap = 0x80d7f55, 
  random_signal = 0x0, 
  stop_func_start = 0x0, 
  stop_func_end = 0x0, 
  stop_func_name = 0x0, 
  sal = {
    symtab = 0x0, 
    section = 0x0, 
    line = 0x0, 
    pc = 0x7c6a68, 
    end = 0x0
  }, 
  remove_breakpoints_on_following_step = 0x0, 
  current_line = 0x0, 
  current_symtab = 0x0, 
  handling_longjmp = 0x0, 
  ptid = {
    pid = 0x0, 
    lwp = 0x0, 
    tid = 0x0
  }, 
  saved_inferior_ptid = {
    pid = 0x0, 
    lwp = 0xffffffff, 
    tid = 0xbfffb048
  }, 
  update_step_sp = 0x0, 
  stepping_through_solib_after_catch = 0x0, 
  stepping_through_solib_catchpoints = 0x0, 
  enable_hw_watchpoints_after_wait = 0x0, 
  stepping_through_sigtramp = 0x0, 
  new_thread_event = 0x0, 
  tmpstatus = {
    kind = 0x0, 
    value = {
      integer = 0x0, 
      sig = 0x0, 
      related_pid = 0x0, 
      execd_pathname = 0x0, 
      syscall_id = 0x0
    }
  }, 
  infwait_state = 0x0, 
  waiton_ptid = {
    pid = 0xffffffff, 
    lwp = 0x0, 
    tid = 0x0
  }, 
  wait_some_more = 0x0
}


-- 
Grant Edwards
grante@visi.com

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

* Re: No step button using insight w/ remote target.
  2001-10-04 11:28                 ` Grant Edwards
@ 2001-11-20 16:16                   ` Grant Edwards
  0 siblings, 0 replies; 31+ messages in thread
From: Grant Edwards @ 2001-11-20 16:16 UTC (permalink / raw)
  To: Keith Seitz; +Cc: insight

On Mon, Nov 19, 2001 at 04:44:13PM -0600, Grant Edwards wrote:
> On Mon, Nov 19, 2001 at 01:05:19PM -0800, Keith Seitz wrote:

> > > (gdb) print inferior_ptid
> > > $1 = {pid = 42000, lwp = 0, tid = 0}
> > 
> > Ok, so someone is resetting it somewhere... Can you find out who that is?
> 
> It's being changed from {42000,0,0} to {0,0,0} in
> infrun.c:contect_switch() at the last line in the function.

Moving that assignment into the inside of the "then" part of
the "if (in_thread_list...)" makes things work, but I doubt
that's the right way to fix the problem.

-- 
Grant Edwards
grante@visi.com

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

end of thread, other threads:[~2001-11-21  0:16 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-11-07 15:19 No step button using insight w/ remote target Grant Edwards
2001-10-01  8:25 ` Fernando Nasser
2001-10-02 14:22   ` Grant Edwards
2001-11-15 15:46     ` Grant Edwards
2001-10-02 15:40   ` Grant Edwards
2001-11-19  8:32     ` Grant Edwards
2001-11-12  7:13   ` Fernando Nasser
2001-10-02 16:10 ` Keith Seitz
2001-10-02 20:18   ` Grant Edwards
2001-10-03  9:37     ` Keith Seitz
2001-10-03 10:54       ` Grant Edwards
2001-10-03 11:09         ` Keith Seitz
2001-10-03 11:20           ` Grant Edwards
2001-10-03 11:47             ` Keith Seitz
2001-10-03 13:22               ` Grant Edwards
2001-10-03 14:03                 ` Keith Seitz
2001-10-03 15:50                   ` Grant Edwards
2001-11-19 14:12                     ` Grant Edwards
2001-11-19 13:28                   ` Keith Seitz
2001-11-19 13:19                 ` Grant Edwards
2001-10-03 16:31               ` Grant Edwards
2001-10-04 11:28                 ` Grant Edwards
2001-11-20 16:16                   ` Grant Edwards
2001-11-19 14:39                 ` Grant Edwards
2001-11-19 13:05               ` Keith Seitz
2001-11-19 13:03             ` Grant Edwards
2001-11-19 12:55           ` Keith Seitz
2001-11-19 12:49         ` Grant Edwards
2001-11-19 12:17       ` Keith Seitz
2001-11-19 12:06     ` Grant Edwards
2001-11-19 12:00   ` 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).