<<

feature BILL GATLIFF

Embedding with GNU: GNU

Are GNU tools ready for prime-time embedded development? The author points out the strengths and weaknesses and then explains how to use the GNU debugger to debug firmware running on an embedded system.

he growth in popularity of the industry’s best-known collec- tion of development tools, the GNU toolkit, has reached the embedded marketplace. Well-known embedded vendors like Wind River Systems, Integrated Systems Inc., and others now openly advertise their compatibility with GNU, and the number of individual and corporate consultants Tclaiming expertise in using GNU tools for embedded software develop- ment is growing at a noticeable rate. But are the GNU tools really ready for prime-time embedded develop- ment? I think so, but only under the right circumstances. GNU certainly has its advantages: the tools are cheap (free!), stable, highly portable, and consistent across platforms. However, GNU also has drawbacks: its compo- nents were originally designed for developing desktop applications in a Unix-like environment, they can be a challenge to set up and use for embedded development, and the documentation occasionally lacks detail in areas important to embedded developers. Even with these limitations, a motivated developer who’s willing to invest the time to learn to use GNU will find the transition a rewarding and productive endeavor that lends tremendous stability and flexibility to the

80 SEPTEMBER 1999 Embedded Systems Programming I recently began using the GNU tools in an embedded project of my own, and the results have been so inspiring that GNU tools are now my first choice, even when a commercial alternative exists.

embedded development experience. I How gdb works, from an nondestructively replace a source can say this with confidence because I embedded perspective instruction with a TRAP or similar recently began using the GNU tools in When debugging a remote target, gdb opcode.1 This causes control to trans- an embedded project of my own, and depends on the functionality provided fer to the debugging stub when that the results have been so inspiring that by a debugging stub, a small piece of instruction is encountered. The GNU tools are now my first choice, code in the embedded system that debugging stub’s job at that point is to even when a commercial alternative serves as the intermediary between the communicate the event to gdb (via exists. host running gdb and the application Remote Serial Protocol messages), In this article I’ll explain how to being debugged. This relationship is and then accept commands from gdb use the GNU debugger, gdb, to debug depicted graphically in Figure 1. telling it what to do next. firmware running on an embedded system connected to a PC by a serial cable. FIGURE 1 A typical embedded GNU debugger setup What is gdb? Embedded System The GNU debugger, gdb, is an Workstation extremely powerful all-purpose Application Code debugger. Its text-based user interface can be used to debug programs writ- ten in , C++, Pascal, , and sev- eral other languages, including the assembly language for every micro- processor that GNU supports. Among gdb’s many noteworthy features is its ability to debug pro- grams “remotely,” in a setup where Debugging Stub the platform running gdb itself (the host) is connected to the platform running the application being debugged (the target) via a serial Serial Cable port, network connection, or some other means. This capability is not only essential when porting GNU The debugging stub (the techno- To illustrate, Listing 1 is a TRAP tools to a new or logical equivalent of a ROM monitor) exception handler for the Hitachi SH- microprocessor, but it’s also useful for and gdb communicate via the gdb 2 microprocessor. When the processor developers who need to debug an Remote Serial Protocol, an ASCII, encounters a TRAP instruction placed embedded system based on a proces- message-based protocol containing as a breakpoint by gdb, this function sor that GNU already supports. commands to read and write memory, sends the processor context to a func- The remote debugging capability query registers, run the program, and tion called gdb_exception(), which of gdb, when it has been properly so forth. Since most embedded devel- subsequently communicates it to gdb. integrated into an embedded system, opers write their own stubs so that they Eventually, the target invokes allows a developer to step through can the best use of their specific gdb_return_from_exception(), which code, set breakpoints, examine mem- hardware’s features and limitations, a restores the processor context and ory, and interact with the target in clear understanding of how gdb uses returns control to the application. ways that rival the capabilities of most the Remote Serial Protocol is very The Remote Serial Protocol’s step commercially available debugging important. command is a bit more challenging, CORBIS kernels—and even some low-end To set breakpoints, gdb uses mem- especially when the target processor emulators. ory reading and writing commands to doesn’t provide a “trace bit” or similar

Embedded Systems Programming SEPTEMBER 1999 81 step In these cases, the only In these cases, 2 in gdb/sh-stub.c is illustra- in gdb/sh-stub.c is . The Remote Serial Protocol mes- The GNU debugger has a scripting Of course, gdb can also disassem- Fortunately for me, several sugges- Fortunately for me, sages exchanged between gdb and the debugging stub running on the target can be displayed, as well as logged to a file. These features are extremely use- ful both for debugging a new stub, and for understanding how gdb uses the Remote Serial Protocol to implement user requests for data, program mem- function calls, and so forth. ory, language that permits automated tar- get setup and testing. The language is target microprocessor-independent, so scripts can be reused when the tar- get application changes from one microprocessor to another. tive, as are the similarly-named func- tive, as are the similarly-named gdb/i386-stub.c, tions in the files others. gdb/m68k-stub.c, and print foo( sci[x]->smr.brg ) and gdb will happily report the results. ble code, and it does a good job of sup- plementing magic numbers with equivalent symbol information when- ever possible. For example, the follow- ing output: jmp 0x401010

way of saying that the address is gdb’s shown is equivalent to an offset of 80 bytes from the start of the function main() functionality. with gdb. For command are supplied the function the Hitachi SH-2, doSStep() Other things gdb can do The debugger can also evaluate arbi- trarythe con- C expressions entered at sole, including ones containing func- tion calls on the remote target. So you can type commands like: alternative is for the stub to disassem- alternative execut- about to be ble the instruction where the ed so that it can determine go next. program is going to the tions on how to implement Embedded Systems Programming Embedded Systems A gdb TRAPA handler for the Hitachi SH2 for the Hitachi handler A gdb TRAPA SEPTEMBER 1999 .align 2 _gdb_exception_target: .long _gdb_exception “); /* call gdb_exception, pass it exception=32 */ mov.l _gdb_exception_target, r1 jmp @r1 mov #32, r4 /* push other register values onto the stack */ /* push other register values onto the stack mov.l r13, @-r15 mov.l r12, @-r15 mov.l r11, @-r15 mov.l r10, @-r15 mov.l r9, @-r15 mov.l r8, @-r15 mov.l r7, @-r15 mov.l r6, @-r15 mov.l r5, @-r15 mov.l r4, @-r15 mov.l r3, @-r15 mov.l r2, @-r15 mov.l r1, @-r15 mov.l r0, @-r15 sts.l macl, @-r15 sts.l mach, @-r15 stc vbr, r7 stc gbr, r6 sts pr, r5 /* the sh2 stacks the pc and sr automatically when performing a trap /* the sh2 stacks the pc and sr automatically pointer value we give to gdb to /* exception, so we have to adjust the stack words, gdb wants to see the stack /* account for this extra data. In other was taken, and not what its value /* pointer value as it was BEFORE the trap and sr are four bytes each) from the /* is right now. So, subtract eight (pc /* sp value we just pushed onto the stack */ mov.l @(4,r15), r14 add #8, r14 mov.l r14, @(4,r15) /* push the stack pointer and r14 */ /* push the stack pointer mov.l r15, @-r15 mov.l r14, @-r15 /* An example TRAPA #32 handler for the Hitachi SH2. TRAPA #32 handler /* An example /* values on the stack, then calls gdb_exception. /*Stores current register */ asm(" .global _gdb_exception_32 _gdb_exception_32: LISTING 1 LISTING 82 debugger A gdb TRAPA handler for the Hitachi SH2 for the Hitachi handler A gdb TRAPA LISTING 1, cont’. LISTING from a debugging control to an application on how to return /* An example SH2. /* stub, for the Hitachi /* in C, the prototype would be: /* If this were written ); gdb_sh2_registers_T registers /* void gdb_return_from_exception( /* the same fashion simply pop registers off the stack in /* In general, we can stack pointer puts them on. However, usually the return /* as gdb_exception_nn pc and sr back ours, so if we pop r15 before we copy the /* isn’t the same as we lose them. /* onto the return stack, */ asm(“ .global _gdb_return_from_exception _gdb_return_from_exception: /* restore some registers */ lds r4, pr ldc r5, gbr ldc r6, vbr lds r7, mach lds.l @r15+, macl mov.l @r15+, r0 mov.l @r15+, r1 mov.l @r15+, r2 mov.l @r15+, r3 mov.l @r15+, r4 mov.l @r15+, r5 mov.l @r15+, r6 mov.l @r15+, r7 mov.l @r15+, r8 mov.l @r15+, r9 mov.l @r15+, r10 mov.l @r15+, r11 mov.l @r15+, r12 not ours */ /* pop pc, sr onto application’s stack, mov.l @(8,r15), r14 mov.l @(16,r15), r13 mov.l r13, @-r14 mov.l @(12,r15), r13 mov.l r13, @-r14 /* finish restoring registers */ mov.l @r15+, r13 mov.l @r15+, r14 mov.l @r15, r15 /* adjust application’s stack pointer to account for pc, sr */ add #-8, r15 /* ... and return to the application */ rte nop “); Embedded Systems Programming Embedded Systems SEPTEMBER 1999 84 ’s ESP www.embedded.com/code. . This source code has been com- . This source code The left column of the example I have posted my attempt at a I have posted my code is con- The processor-specific If you do succeed in porting my A typical gdb session Now that we’ve covered the gdb’s functionality in general terms and I’ve observe shown how to install it, let’s 1 is a transcript of gdb in action. Table a typical gdb debugging session, dur- ing which gdb initiates communica- tions with a remote target running a debugging stub, downloads a pro- gram, sets a breakpoint, and then runs the program. The debugging stub informs gdb when the breakpoint is encountered, and gdb then displays the appropriate source line to the The user subsequently displays a user. variable, steps one instruction, and then exits gdb. shows a portion of the gdb console, where the user types commands and views data. The right columns show some of the GDB Remote Serial Protocol messages exchanged between the host machine and the embedded device. I’ve included sup- plemental information in square brackets. For a detailed explanation of ging stub that can be reused with min- can be reused with ging stub that on several different imal modification microprocessors. embedded stub on “portable” debugging site, at Web htm the Hitachi SH-2, piled and tested for and ports are underway for the PC, and other Hitachi H8, Power processors. processor-specific tained in files with gdb_sh2*.c. You file names, like should first copy these files to ones with names related to your micro- processor (such as gdb_m68k*.c), and replace the contents with code that works for your machine. or desire code to another processor, assistance in doing so, please let me In addition to hearing your know. feedback, I would like to make your modifications available to the rest of the embedded community. http://source- sh-hitachi- parameter tells parameter during . target target (or whatever prefix you sup- -- target=sh-hitachi-hms When you’re done, you’ll end up The configure script will study the Finally, tell gdb to compile and Finally, Per the installation instructions in To install gdb, first decompress install gdb, first To ../gdb-4.18/configure mkdir gdb-build configuration). By default, this file is run it, placed in /usr/local/bin. To simply type the executable file name followed by the name of your applica- tion file: with an executable called host machine’s setup and create the host machine’s proper local environment in which to build gdb. The gdb what microprocessor your embed- ded applications will run on. You’ll find a list of supported targets in the file gdb/ChangeLog. install itself: Despite the target-specific nature of remote software debugging, it is possi- ble to create a highly portable debug- sh-hitachi-hms-gdb a.out a gdb code for Source debugging stub make all install cd gdb-build tar xzvf gdb-4.18.tar.gz and Next, study gdb-4.18/README as these files con- gdb-4.18/gdb/News, on how to tain important information state of gdb install gdb, the current features, and so development, new forth. README, configure gdb for your host machine and debugging target: plied in the gdb-4.18.tar.gz: mate its compilation and installation. mate its compilation Cygnus available from the This file is site, gdb Web Solutions ware.cygnus.com/gdb/ hms-gdb http://source- ). Once the . Embedded Systems Programming Embedded Systems www.gnu.org at the gdb console, or you can use at the gdb console, or SEPTEMBER 1999 And finally, gdb provides trace- gdb provides And finally, these features Information on all of Efforts are underway to produce The most recent release of gdb is points, a way to record information points, a mini- program with about a running the program to mal interruption of require collect the data. Tracepoints stub support to significant debugging be the subject of implement, so they’ll a future article. can type You is provided with gdb. 86 Installing gdb GNU tools like gdb are generally dis- tributed as source code, archived, and compressed into a single file using the tar and utilities (available from GNU at ports of GNU tools for Windows 95, 98, and NT hosts. At the present time, gdb and other tools neces- however, sary for embedded development can- not be easily built on Microsoft hosts, although they will run fine when prop- erly cross-compiled on another host. get the latest information about To check GNU-Microsoft compatibility, out the Project at which contains the file gdb-4.18.tar.gz, both the gdb source code and some configuration scripts that help auto- source code is in hand, the user typi- cally decompresses, configures, com- piles, links, and installs the programs in a manner most compatible with their workstation setup, target envi- ronment, and other factors. Some gra- cious members of the GNU communi- ty provide precompiled binary ver- sions of the most popular tools; the availability of such releases is usually advertised in Internet newsgroups. ware.cygnus.com/cygwin/ help a GNU utility called “info” to review a GNU utility called in the gdb documentation contained The debugger installation package. also comes with a preformatted quick- reference card in the file gdb/doc/refcard.ps, and typeset manuals are available online at user’s several sites that mirror gdb source code distributions. gnu debugger after info gdb-internals The following is not a comprehen- You can also modify gdb’s behavior gdb’s can also modify You The file gdb/remote.c contains For the most up-to-date informa- installing gdb. Graphical gdb interfaces Once you get the plain-vanilla gdb working on your embedded target, you may find that although its text console is fast, intuitive, and easy to also a bit, well, uninspiring. use, it’s are not alone, and fortunately sev- You eral free graphical add-ons are avail- able to help jazz up your debugging experience. These enhancements all use a running instance of gdb itself as so if gdb talks the low-level debugger, properly to your target, then these interfaces will too. sive list of all available graphical gdb front ends, by any means—I’ve only included tools that I have firsthand experience with. Be sure to ask around in the gdb newsgroups and on the gdb homepage if you find that the shelf serial-to-CAN or parallel-to-CAN shelf serial-to-CAN bridge. with other to make it more compatible applica- software in your embedded you were already tion. For example, if #32 for something non- using TRAPA either change gdb-related, you could for a breakpoint, the opcode gdb uses produce a new or you could have gdb signaled your tar- message—one that tracing or get to turn on instruction enable on-chip breakpoint-generating hardware, for example. implementation of the Remote gdb’s Serial Protocol, and is a good starting modular point for studying how gdb’s implementation permits you to quick- ly adapt it to meet the needs of a spe- cific debugging target. Other files, like gdb/remote-hms.c and gdb/remote- e7000.c, use this modular framework to provide support for and emulators supplied by Hitachi, Motorola, and other vendors. tion on how gdb works, how to enhance gdb, and how to get your improvements into future gdb releas- es, type fef; fffff f;16:0000 fef;e:0040 f;d: fffff fffff fffffff f;d: f;16:000000f0;#d2 fffffff f;5:00000000;6:00000 fffff f;5:00000000;6:00000010 +$00001a00ffff81b200000020... ;2:00000001;3:00000030;4:ff fffff ;7:00000010;8:0040161c;9:0 0002070;a:00404068;b:0040 15bc;c: 4840;f:00404840;10:004015c e;11:004015cc;12:d04001e2; 13:00401000;14:00000000; 15:00 [PC is now 0x4015ce] $T050:00401400;1:00404850 ;2:00000001;3:00000030; 4:fffffff 010;7:00000010;8:0040161c; 9:00002070;a:00404068;b: 004015bc;c: e:00404840;f:00404840;10: 004015cc;11:004015cc;12: d04001e2;13:00401000;14: 00000000;15:00 00f0;#d1 stopped at main(), [target 0x4015cc] address 0x4015bc; [foo is at address its value is 0x2f86] executes one [target instruction] $T050:00401400;1:00404840 forward aspects of gdb’s to change needs. suit your that don’t behavior has only if your product For example, port that is one communications a non-gdb com- already dedicated to possi- then it’s munications protocol, so that debugger ble to modify gdb packets that your messages fit inside of understands. product already lacks a serial Likewise, if your product kind of com- port but has some other munications interface—like a CAN you could port, for instance—then remote communica- enhance gdb’s tions strategy to work with an off-the- 20240040202400402024#72 M messages] ... [lots more is sent] the continue command before +$c#63[gdb places a breakpointopcode at main()] runs until it reaches [program main()] + gdb sends...+$?#3f+$g#67 target responds with... +$S05#b8 Embedded Systems Programming Embedded Systems Transcript of a typical gdb session Transcript SEPTEMBER 1999 Note that Table 1 is not what users Table Note that gdb> quit $k#6b + gdb> display foogdb> stepi +$m4015bc,2#5a $s#73 +$2f86#06 + gdb> continue +$M4015cc,2:c320#6d +$OK#9a gdb> load maingdb> breakpoint immediately gdb physically sets the breakpoint [nothing— $M401054,10:004020240040 +$OK#9a host>gdb myprogram remotegdb> target /dev/ttyS0 +$Hc-1#09 +$qOffsets#4b +$OK#9a +$Text=0;Data=0;Bss=0#04 TABLE 1 TABLE What the user enters What happens on the serial port 88 Ideas on adapting gdb to Ideas on adapting problems solve specific archi- The modular implementation tecture used by gdb makes it straight- see when they use gdb—they see a ter- see when they use gdb—they complete minal display in English, variables, with source code, displayed the transcript and the like. Instead, happens behind shown illustrates what user types the list- the scenes when the ed commands. these messages, see the sidebar, “The see the sidebar, these messages, Serial Protocol.” GDB Remote gnu debugger Unfortunately, tool selection Unfortunately, As I’ve already mentioned, consisten- gdb’s In particular, does any tool available today at any price, free or otherwise). strengths (besides its cost) gdb’s lie in its feature list, its uniform applicability across many host platforms and debug targets, and the degree to which its behavior can be tailored to meet the specific demands of an embedded debugging target. cy across hosts and targets pre- sents the opportunity for con- I hope that by now you’re con- vinced that gdb is a powerful and capable tool for embedded software debugging. If that were all that mattered, then I believe that gdb would be the most pop- ular embedded debugger avail- able today. is a trade-off among many fac- tors—price, performance, com- and support, to name patibility, a few—and when everythingis considered, gdb has both its strengths and weaknesses (as you? DDD and Code Medic, Insight’s DDD and by way of Tcl/Tk graphics come X-Windows, which instead of on Windows means it runs easily Insight platforms. Furthermore, gdb (rather is compiled into as a sub- than it running gdb and process, the way CodeMedic its DDD do), which improves performance its com- and makes gdb more munications with func- interactive. It also provides configure tionality to graphically which the remote connections, other front ends can only do by way of gdb command scripts. But is gdb right for siderable reuse of automated configuration, compilation and unit testing scripts, which is a value that should not be underestimated. This in itself may reward the pain of switching to GNU, particularly if proliferation of http://sourceware.cygnus.com/ Insight Data Display Code Medic is Cygnus Solution’s own (and is Cygnus Solution’s Insight Insight ( gdb/) formerly proprietary) graphical enhancement to gdb. In contrast to FIGURE 4 FIGURE 3 FIGURE 2 FIGURE 2 ) by ) is an ele- Embedded Systems Programming Embedded Systems www.cco.caltech. SEPTEMBER 1999 Code Medic provides drag- This application is well doc- www.cs.tu-bs.de/softech/ddd/ 90 and-drop data management, context-sensitive highlighting, and a sophisticated display tai- lored for complicated data structure visualization. Furthermore, Code Medic uses a mes- sage-based interface to gdb, which improves performance significantly over DDD in both remote and self- hosted debugging setups. Code Medic ( edu/~glenn/medic/ gant, X-Windows-based graphi- cal interface most to gdb’s important features. The inter- face was written by Glenn Bach (of the Physics, Mathematics, and Astronomy Division, California Institute of and is also part of Technology), a suite of integrated software development tools known as Code Crusader. Code Medic The Data Display Debugger The Data Display ( DDD: Display Data Debugger tools I’ve listed don’t suit your listed don’t tools I’ve needs. umented and easy to install. Its graphics-intensive interface extracts a slight penalty in run- time performance, but any host processor that can reasonably run other graphical GNU tools will probably work fine. Andreas Zeller (Software Andreas Zeller Department, Technology of University Technical a mature, Braunschweig) is high-quality X-Windows-based interface.graphical gdb you Besides the usual features would expect from any graphi- DDD provides an cal debugger, easy-to-navigate graphical data display that allows sophisticated data structure visualization with just a few mouse clicks. gnu debugger www.sourceware. , for example). In situa- On the other hand, if you truly Finally, gdb works best when fed gdb works Finally, A rewarding experience A rewarding The ability of gdb to adapt to the spe- cific needs of a debugging target What about support? actual- One perceived drawback that’s ly an advantage for GNU is the lack of available support from a central, con- trolling organization. Instead, people highly skilled in the use and develop- ment of the GNU tools (including the authors of the tools themselves) are available 24 hours a day via a variety of Internet news groups (gnu.gdb.bug is one) and mail servers ( cygnus.com/gdb tions where I’ve requested help I usu- ally received an answer in four hours or less—an impressive statistic for even the most expensive product support desks. need the level of support that only or you need extensive money can buy, modifications to one or more GNU tools in support of a very specialized situation, then there are companies and individuals around that can pro- vide those kinds of services. The best way to find them is to subscribe to and read the Internet news groups and mail specific to the GNU tools you need help with. ment—initialize global variables, zero global variables, ment—initialize so forth—are only and out memory, as an working code and supplied as in the descrip- occasional side note commands; there tions of a few linker document that is currently no single in detail a completely describes important for process that is critically systems. (I’m C/C++-based embedded effort would wel- certain that the GNU a tutorial on this come the creation of subject.) produced by debugging information which the GNU and linker, presents compatibility problems for non-GNU legacy projects, or work involving third-party libraries that available in a GNU-compatible aren’t format. www.embed- Web site, Web ESP occasionally lacks details that are lacks details that occasionally to embedded developers. important properly procedures to For example, environ- establish the C run-time are ASCII hex representations of an eight-bit checksum ASCII hex representations are are shown below. are CKSUM_LSN . Embedded Systems Programming Embedded Systems and is typically a string of ASCII hex [0-9,a-f,A-F] characters. is typically a string of ASCII hex [0-9,a-f,A-F] Register-related commands Register-related Target infromation commands infromation Target Memory-related commands Memory-related . Only the hex digits 0 to 9 and a to f are allowed. . Only the hex digits 0 to 9 and a to f are When a message is sent, the receiver responds with either: responds When a message is sent, the receiver OK (depending gdb with either data or an to a message from can respond A target Definitions for CKSUM_MSN The following are short descriptions of the RSP’s most important commands. A most important RSP’s short descriptions of the The following are with the GDB Remote Serial target Data exchanged between gdb and a remote Command namequery section offsets definition qOffsets Description information Return section offset TABLE C TABLE Command name registersread definitionwrite registers nnwrite register Description g GXX..XX Pnn=XX..XX NN Set the value of register XX..XX to Set registers registers Return the values of all TABLE A TABLE Command name memoryread definitionwrite memory Description mAA..AA,LL..LL MAA..AA,LL..LL:XX..XX values to memory Write memory Read values from TABLE B TABLE if the received checksum was correct, and the receiver is ready for the next packet is ready and the receiver was correct, checksum if the received and the message needs to be retransmitted was incorrect, checksum the received SEPTEMBER 1999 Although the GNU tools are gener- Although + - code, it an error code. When gdb receives error on the message), or a target-defined to the user via the gdb console. the number reports of where where $ # CKSUM_MSN CKSUM_LSN complete summary of each command is available on the complete summary of ded.com/code.htm ASCII characters. Messages begin with a dollar sign ($) and end uses plain Protocol each message looks like this: words, with a gridlet (#) and eight-bit checksum. In other The GDB Remote Serial Protocol GDB Remote The lingua franca between gdb and a remote (RSP) is the Protocol The GDB Remote Serial the application and writing data, controlling It defines messages for reading target. status. The host side is implemented in application reporting being debugged, and file. source remote.c gdb’s 92 ally well documented, the information ally well documented, your products across a variety of target across a variety your products is likely. processors gnu debugger p s e last signal command values register console gdb’s tion being debugged is located in RAM. a smart enough debugging stub, With support, and/or com- hardware proper this need however, piled-in breakpoints, not be true. contain the ability to trap on instruction execution and/or changes in program by the is controlled flow; this feature "trace enable" bits, T1 and T0, in the status register. processor's Bill Gatliff embedded develop- is a freelance er and senior design engineer with Komatsu Mining Systems, Inc. in Peoria, at the presenter IL, and is a semi-regular He can be Embedded Systems Conferences. at [email protected]. reached References is that the applica- 1. An assumption here 683xx processors 2. For example, Motorola doubt that a motivated developer who is willing to master the GNU tools will find their product development a more stable, flexible, and rewarding experience. for gdb is available at code Source http://sourceware.cygnus.com/gdb/. This site also includes links to gdb-specific ends, and mailing lists, graphical front gdb binaries. precompiled for sources Program control commands control Program Target status messages (responses from the target) from (responses status messages Target TABLE D TABLE Command nameset threadstep definitioncontinuelast signalkill Description Hc cAA..AA ? sAA..AA k thread program Set current Resume application execution Execute one assembly instruction Report last signal application Terminate Message name last signal response expedited response Snn definitionconsole output Tnnr...:v......:v...; Description plus key The last signal reported, Ovvvvvvvv... to the Minimal reply to the target Sends text from TABLE E TABLE A switch to GNU might be in your support of a GNU’s And finally, With all these advantages, I have no (memory usage, communications media, and so forth) often makes it the only choice available for on-target debugging, particularly given the growing popularity of single-chip, highly-integrated, and IP-based embedded products. The complexity embedded devices is of today’s increasing at an alarming rate, and as the technology choices available for new designs continue to diverge, find- ing a commercial development tool vendor with a product that fits your needs becomes less likely every day. best long-term interests, even if you’re using conventional technology in your embedded designs, because GNU applications are becoming increasing- ly popular as educational tools. So a recent engineering graduate would probably be more familiar with them than with any specific equivalent com- mercial products. variety of popular embedded proces- sors means that you reduce the risk of needing to find a new tool vendor sup- because your current one doesn’t port the processor you’d like to use in your next design. Embedded Systems Programming Embedded Systems SEPTEMBER 1999 94 gnu debugger