Debug How to

Joe Samuel sjoe2 at yahoo.com
Tue Nov 19 03:22:43 UTC 2002


Thank you for your response. I'm using the pc386
target. I'll keep you updated about my progress. 
Thank you very much. I thing such a step-by-step
debugging doc exists nowhere(Pardon me if I missed
some). So I'm posting this to the rtems-users list,
for those who might be interested.  

 --- Eric Norum <eric.norum at usask.ca> wrote: > 
> On Monday, November 18, 2002, at 08:58  AM, Joe
> Samuel wrote:
> 
> > Does RTEMS include a RGDBSD implementation? Or am
> I
> > supposed to implement my own server for remote
> > debugging? Please help.
> > Joe.
> >
> >
> What target are you using?
> For pc386 targets:
> 
> 1) Connect COM1 port of host to COM1 of target (COM2
> if target is using 
> video console)
> 2) Make sure that gdb can access the serial port on
> your host machine: 
> (as root) chmod 666 /dev/ttyS0
> 3) In your target application code (perhaps right at
> beginning of 
> Init()) add the lines
>               init_remote_gdb();
>               rtems_task_wake_after(<<<<ENOUGH TICKS
> FOR HALF A SECOND 
> OR SO>>>>>);
>               breakpoint();
>     The delay is probably not necessary if you're
> using the video screen 
> as the console, but is necessary if you're using a
> COM port as the 
> console....
> 4) Rebuild your application and boot it.  It should
> show the following 
> on the console
>        Remote GDB using COM1...
>        Remote GDB: setting traps...
>        Remote GDB: waiting remote connection....
>     If it says that it's using COM2, move the serial
> cable between the 
> machines to that port.
> 6) Run gdb
>              i386-rtems-gdb -b 38400
> o-optimize/test.obj
> 
> You should see something like:
> 
> GNU gdb 5.2
> Copyright 2002 Free Software Foundation, Inc.
> GDB is free software, covered by the GNU General
> Public License, and 
> you are
> welcome to change it and/or distribute copies of it
> under certain 
> conditions.
> Type "show copying" to see the conditions.
> There is absolutely no warranty for GDB.  Type "show
> warranty" for 
> details.
> This GDB was configured as "--host=i686-pc-linux-gnu
> 
> --target=i386-rtems"...
> (gdb) target remote /dev/ttyS0
> Remote debugging using /dev/ttyS0
> breakpoint () at ../../../../../../../../../rtems-
>
cvs/c/src/lib/libbsp/i386/shared/comm/i386-stub.c:983
> 983     ../../../../../../../../../rtems-
> cvs/c/src/lib/libbsp/i386/shared/comm/i386-stub.c:
> No such file or 
> directory.
>          in ../../../../../../../../../rtems-
> cvs/c/src/lib/libbsp/i386/shared/comm/i386-stub.c
> (gdb) <<< set more breakpoints, print registers,
> continue, single-step, 
> etc.....>>>
> 
> 
> You can save yourself some typing by putting the
> 'target remote 
> /dev/ttyS0' (and any breakpoint-setting commands) in
> a .gdbinit file.
> 
> -- 
> Eric Norum <eric.norum at usask.ca>
> Department of Electrical Engineering
> University of Saskatchewan
> Saskatoon, Canada.
> Phone: (306) 966-5394   FAX:   (306) 966-5407
>  

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com



More information about the users mailing list