On Wed, Dec 05, 2001 at 05:53:17PM +1100, Michael Glickman wrote: > What I meant was that build-prc might have an > option to rip out libg.a while creating a .prc > GdbStartDebug() can be also placed separately, > so that it can be removed.
Nope. Not practical, because it's already been bound in by the linker. That option is called "don't link with -g". > Still a question remains about the symbolic > information - this is probably a really crucial part. > Should we place have m68k-palmos-strip before build-prc > or it doesn't make sense ? Pretty much everything that has been said in this thread is correct, except Michael's description of COFF symbols as "presumably NOP commands with line numbers". As usual, I recommend exploration with m68k-palmos-objdump and the use of m68k-palmos-gcc -v to those who are curious about these matters. Everything you want to know about -g can be figured out from GCC's -g documentation and http://prc-tools.sf.net/cgi-bin/info/Using+a+debugger . Also Warren Young's FAQ has a useful section. In short: m68k-palmos-gcc -g -c foo.c -o foo.o # 1 m68k-palmos-gcc -g foo.o -o foo # 2 build-prc foo -o foo.prc * Compiling (line 1) with -g adds symbolic information to foo.o (which then gets copied to foo by the linker). These symbols are separate from the section contents, and are not copied by build-prc. They are used by GDB. Whether you compile with -g has *no effect* on the contents of foo.prc. * Linking (line 2) with -g adds the GdbStartDebug stub to the .code section of foo. This is of course carried over to the 'code' #1 resource of foo.prc by build-prc. The stub is currently needed by GDB to insert a breakpoint at the start of your application and to correlate the addresses in the symbolic information from foo with the actual addresses at which your application got loaded in memory. To debug effectively with GDB, you need to *both* compile and link with -g. When you ship a release version of your app, you probably want to link without -g; but you might not care too much about whether you compile with -g or not, because it makes no difference to the .prc file you are shipping. Using m68k-palmos-strip is approximately equivalent to not compiling with -g. It has no effect on your .prc file. (If you compile and link at the same time: m68k-palmos-gcc -g foo.c -o foo # 1 and 2 then you are switching -g on and off for both at once -- you can't control compiling and linking separately. This isn't a bad thing; I'm just mentioning it for completeness.) John -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
