Shop OBEX P1 Docs P2 Docs Learn Events
How do to use gdbstub — Parallax Forums

How do to use gdbstub

CircuitsoftCircuitsoft Posts: 1,166
edited 2013-01-10 14:25 in Propeller 1
I think I've figured it out, but I'm having issues with the actual debugging, now.

This is on a QuickStart board, and my serial test is running on pins 0/1.
GNU gdb (GDB) 7.3.1
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=x86_64-unknown-linux-gnu --target=propeller-elf".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/alex/Projects/Personal/Parallax C Library/tests/serial/ffds1/ffds1...done.
(gdb) target remote | /opt/parallax/bin/gdbstub
0x0000026c in ?? ()
(gdb) load
Loading section .boot, size 0x20 lma 0x0
Loading section .lmmkernel, size 0x788 lma 0x20
Loading section .init, size 0xb8 lma 0x7a8
Loading section .text, size 0xf30 lma 0x860
Loading section .ffds1.cog, size 0x144 lma 0x1790
Loading section .fini, size 0x3c lma 0x18d4
Loading section .hub, size 0x2c lma 0x1910
Loading section .ctors, size 0x4 lma 0x193c
Loading section .dtors, size 0x4 lma 0x1940
Transfer rate: 7 KB/sec, 61 bytes/write.
(gdb) b main
Breakpoint 1 at 0x1668: file main.c, line 4.
(gdb) c
Continuing.
error: bad initial response from debug kernel: 00
warning: Remote failure reply: E05
Ignoring packet error, continuing...
Remote 'g' packet reply is of odd length: E01
(gdb) bt
Ignoring packet error, continuing...
Remote 'g' packet reply is of odd length: E01
Ignoring packet error, continuing...
Remote 'g' packet reply is of odd length: E01
Ignoring packet error, continuing...
Remote 'g' packet reply is of odd length: E01

Comments

  • ersmithersmith Posts: 6,054
    edited 2013-01-10 14:25
    gdb doesn't really work on the default branch.

    If you're using the performance branch, then it does work in LMM mode (only). To start a program do:
    propeller-elf-gdb foo.elf
    target remote |gdbstub
    load
    < set any breakpoints or do other gdb commands you want here >
    c
    
    ^C should interrupt the running program, provided it was compiled with -g.

    Eric
Sign In or Register to comment.