From: Duane Ellis <duane@duaneellis.com>
To: gdb@sourceware.org, miloody@gmail.com
Subject: Re: how to debug mips or arm platform applications by cgdb
Date: Sat, 06 Jun 2009 23:36:00 -0000 [thread overview]
Message-ID: <4A2AFD8F.5090304@duaneellis.com> (raw)
>> Would someone tell me how to debug mips or arm applications by CGDB.
By CGDB, I presume you mean "cross gdb".
You need to describe your target better.
===========
(A) Is your target running linux?
===========
If so, if your development host is not your target, (ie: cross work),
you need a "gdb-server" application for your target. That "gdb server"
would talk via RS232 (serial) or TCP/IP (ethernet) back to your
development host.
You can "simulate" the TCP environment quite easily using "local host"
on your development host so you can more easily understand how this
works. It can be confusing the first few times you do it.
You can learn how to run "gdb server" on your development host, (aka:
"local host"), and connect to the server using the GDB command: "target
remote localhost:port" ... 90% of the battle is understanding how
"gdbserver and target remote works" - doing that with "localhost" and a
"development host program" is sometimes a little easier to understand
and figure out.
Only then - change "target remote localhost" to "target remote
<ip-address-of-your-target-linux-board>".
===========
(B) is your target running standalone - no operating system, or
something other then linux.
===========
For example, you might be debugging "UBOOT" or some other FLASH MEMORY
type device, perhaps like: 'contiki' or 'freertos' or 'ethernut'
Some use JTAG to debug the Linux Kernel.
In this case, 2 options:
(a) A serial rom monitor that talks the GDB protocol (very rare these
days, most people use jtag).
(b) A JTAG dongle, and software for that jtag dongle that understands
the GDB protocol.
You'll need to *PURCHASE* a jtag dongle (or make one) - I highly
recommend a "USB based ftdi-2232 based dongle", and *STRONGLY* do not
recommend a "printer-port" solution.
The "jtag dongle method" - is 80% identical to the GDBREMOTE example
above - but is more complicated (20%) because you have to create an
initialization script to setup your target board, program the cpu
clocks, erase & program the flash memory, stuff like that.
A *VERY* common JTAG solution (de-facto for ARM) is: "openocd" - see:
http://openocd.berlios.de/web
In the JTAG dongle case, GDB talks "target remote" to a GDB server
program running on Linux, or Windows, or in some cases the DONGLE is
really a tiny computer that talks the GDBSERVER protocol over Ethernet
(the Zylin zy1000 is an example, it actually runs OpenOCD inside).
-Duane.
next reply other threads:[~2009-06-06 23:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-06 23:36 Duane Ellis [this message]
2009-07-19 14:16 ` loody
2009-07-19 15:09 ` Duane Ellis
-- strict thread matches above, loose matches on Subject: below --
2009-06-06 5:51 loody
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4A2AFD8F.5090304@duaneellis.com \
--to=duane@duaneellis.com \
--cc=gdb@sourceware.org \
--cc=miloody@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox