How to build the GDB stub Floppy for PC386 target?
Quality Quorum
qqi at world.std.com
Fri Apr 14 18:08:56 UTC 2000
On Fri, 14 Apr 2000, Boris V. Guzhov wrote:
> Thanks,
>
> But still there are the problems.
>
> I have located my test.exe file in the FS_GRUB diskette
> and load my target PC with it. Then I ran my test with GDB.
>
> Then I have bulided "Hello world" test.exe.
> Then I run gdb:
>
> gdb hello.exe
> (gdb) set remotebaud 38400
> (gdb) target remote /dev/ttyS0
> Remote debugging using /dev/ttyS0
> realloc (ptr=..., size=...)
> at ...malloc.c:268
> 268 if (!size) {
I would guess that your symbol file does not match
your image. Are you sure you are using right gdb ?
I would suppose that correct name is i386-rtems-gdb.
> (gdb)
>
> Good! There is a connect!
>
> But then it does not work.
>
> For examle, a cannot to run "load" command:
> (gdb) load
> Loading section .text, size ...
> Ignoring packet error, continuing ...
>
> How to load another application in target with
> using GDB?
>
> I want to have in target only GDB stub
> and to load any application through GDB
> with using "load" command.
>
> Will somebody help with this problem? I will very much obliged.
Current setup compiles gdb stub in and assumes that loading is performed
by some other mean e.g. GRUB, netboot (recommended), or PROM with
gdb-stub compiled in.
If one is using GRUB or netboot with current pc386 bsp he/she can debug
only the application one has loaded and cannot replace it with something
else.
So, all yuo can do after you hit the first breakpoint of your
applicaction is to continue debugging it: set more breakpoints and
then do 's' or 'c'.
>
> Boris V. Guzhov,
> St.Petersburg
>
Thanks,
Aleksey
>
>
> >
> >> Hi All!
> >>
> >> I have:
> >> - Linux Red Hat 6.0 host
> >> - pc486 target (usual computer)
> >>
> >> I build the "Hello world" simple application.
> >>
> >> How to build the GDB stub Floppy for target?
> >
> >
> >1. Read c/src/lib/libbsp/i386/pc386/HOWTO
> >
> >> How to load the my application in my target with usage of the
> >> I386-rtems-gdb?
> >
> >2. Add following fragment to the init task
> >#if 1
> > /* Init GDB glue */
> >
> > if(BSPConsolePort != BSP_UART_COM2)
> > {
> > /*
> > * If com2 is not used as console use it for
> > * debugging
> > */
> > i386_stub_glue_init(BSP_UART_COM2);
> > }
> > else
> > {
> > /* Otherwise use com1 */
> > i386_stub_glue_init(BSP_UART_COM1);
> > }
> >
> > /* Init GDB stub itself */
> > set_debug_traps();
> >
> > /*
> > * Init GDB break in capability,
> > * has to be called after
> > * set_debug_traps
> > */
> > i386_stub_glue_init_breakin();
> >
> > /* Put breakpoint in */
> > breakpoint();
> >
> >#endif /* 0 */
> >
>
>
>
More information about the users
mailing list