From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24505 invoked by alias); 19 Jul 2009 15:09:40 -0000 Received: (qmail 24491 invoked by uid 22791); 19 Jul 2009 15:09:39 -0000 X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL,BAYES_40 X-Spam-Check-By: sourceware.org Received: from smtpauth19.prod.mesa1.secureserver.net (HELO smtpauth19.prod.mesa1.secureserver.net) (64.202.165.30) by sourceware.org (qpsmtpd/0.43rc1) with SMTP; Sun, 19 Jul 2009 15:09:33 +0000 Received: (qmail 22653 invoked from network); 19 Jul 2009 15:09:30 -0000 Received: from unknown (69.142.105.149) by smtpauth19.prod.mesa1.secureserver.net (64.202.165.30) with ESMTP; 19 Jul 2009 15:09:29 -0000 Message-ID: <4A633726.7080502@duaneellis.com> Date: Sun, 19 Jul 2009 15:09:00 -0000 From: Duane Ellis User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 To: loody CC: gdb@sourceware.org Subject: Re: how to debug mips or arm platform applications by cgdb References: <4A2AFD8F.5090304@duaneellis.com> <3a665c760907190716s716e1102h2ce2a8e6aec2e2ed@mail.gmail.com> In-Reply-To: <3a665c760907190716s716e1102h2ce2a8e6aec2e2ed@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2009-07/txt/msg00127.txt.bz2 loody wrote: > Hi: > > 2009/6/7 Duane Ellis : > loody> Would someone tell me how to debug mips or arm applications by CGDB. duane> You need to describe your target better. [... snip ...] [answer: Basically a standalone board, NO OS] duane> .... >> 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). >> > > loody> ... > from the case you mention above, there seems a gdbserver running on > the dongle not on the target board such that > when we send gdb protocol from host to the dongle, it can translate it > to the proper jtag instructions to handle the target board. > > Is my assumption correct? > Thanks for your help, > Yes, exactly. Some are standalone and self contained "dongles" - ie: ZYLIN Z1000 (it has an Ethernet connector). Others are a cheap piece of hardware (few chips) and the software runs on your PC under windoze, or Linux (ie: OpenOCD is an example of that). If the GDB server runs on the target (with no operating system present) - it is most typically a ROM monitor of some sort. The problem with this sort of platform is this: If your program goes off into the weeds - so might your ROM monitors ability to respond to GDB requests. Example: You are using a serial port to respond to GDB requests. If your program *disables* interrupts and gets hung up, there will be no more serial port interrupts. GDB will be ignored. Another variant of this is a commercial product. In the past I used the "ARM" version of the "EPI TOOLS" majic debugger. Which, is/was a fantastic package with fantastic support. Today, they are owned by Mentor. I have no experience since Mentor's acquisition, nor their MIPS variant of their debuggers. My experience with Mentor though has always been very positive. http://www.mentor.com/products/embedded_software/majic-jtag-probe/ Another variant is offered by "Green Hills Software". And another is Lauterbach software. (They also often include/require use of their compiler and/or tools). -Duane. Be