This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos 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: remote debugging


On Sun, 2005-03-13 at 21:06 +0530, B.E.Comp Project wrote:
> Hi,
> 
> I am trying remote debugging, using GDB stubs,
> with GRUB as the startup for running a simple application.
> 
> i set the following flags:
> 
> CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS
> CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT
> CYGDBG_HAL_DEBUG_GDB_INITIAL_BREAK
> 
> Remote debugging msgs are:
> 
> (gdb) set remotebaud 38400
> (gdb) target remote /dev/ttyS0
> Remote debugging using /dev/ttyS0
> 0x0010bbf0 in ?? ()
> (gdb) info breakpoints
> No breakpoints or watchpoints.
> (gdb) break main
> No symbol table is loaded.  Use the "file" command.
> (gdb) file hello.c
> A program is being debugged already.  Kill it? (y or n) n
> Program not killed.

When you start GDB, tell it the name of your program [binary] and
you won't need to do this step.

> (gdb) continue
> Continuing.
> Hello, eCos world!
> 
> 
> 1) Why is the initial breakpoint set by the option 
> 'CYGDBG_HAL_DEBUG_GDB_INITIAL_BREAK' not displayed with command 
> info breakpoints ?

Because 'info breakpoints' only displays information about the
breakpoints that GDB knows about and sets itself.  The initial
break that you can configure via CDL merely causes eCos to execute
a breakpoint instruction before the application actually starts.
GDB doesn't really know about this, but will handle it properly.
n.b. it will probably tell you that it ran into an illegal instruction
at the startup location, not that it hit a breakpoint.

> 
> 2) How can other breakpoints be set ?
> 

Somewhere in there you need to 'load' the application (using
GDB's load command which you did not show).

After the application has been loaded, but before you start it
up via 'continue', set as many breakpoints as you like.  GDB will
stop and report when it hits the first one.  Also, as you experienced,
GDB needs to know the symbols for your program before you can set
any symbolic breakpoints.  Be sure and specify the program/application
on the command line and things will proceed much smoother.


-- 
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


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