delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/05/19/22:35:44

Date: Sat, 20 May 1995 10:02:36 +0900
From: Stephen Turnbull <turnbull AT shako DOT sk DOT tsukuba DOT ac DOT jp>
To: ken AT jarrett DOT als DOT com
Cc: cburke AT mitre DOT org, djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: Debuggers

   From: Ken Bowen <ken AT jarrett DOT als DOT com>

   Carl Burke <cburke AT mitre DOT org>
   > It may be powerful if you know how to use it, but where do you
   > learn that?

   As with most things worth learning, by reading the documentation.
   I find the GDB quick Reference sheet especially useful.

New tools require substantial set-up costs.  Even those lovely
multi-window monsters like the Turbo debugger require some time.  If
you don't have time to learn them, maybe you should think about doing
it in some more familiar language or implementation?  Or as Marty
suggests do cross-development on Unix, and use one of the fancy X
graphical interfaces to cut learning time a bit.  (If, as you say,
needing an assembly-level debugger means you've "already failed,"
presumably portability, or something functionally equivalent, is a
goal anyway?)  Much as I love DJGPP.  :-)

   > I've tried setting breakpoints and examining variables, and it gives me
   > some garbage about non-existent symbols (yes, -g was on). 

   You have to make sure that gdb knows _where_ to locate the source files.
   Most often this is directly handled by using the 'dirs' command to tell
   it in which directories to search for your source files. Also, make sure
   you aren't asking for it to print the value of some macro item....it
   can't do anything with that since there is nothing in the symbol table.

You should also be careful -O is *off*.  The optimizer has every right
to move symbols around and even eliminate variables.  Eg, you may
explicitly use a temporary variable to enforce a certain order of
execution, and if that variable then dies, the optimizer may very well
decide that the assignment is dead code and eliminate it.  Note that
the optimizer can't tell the difference between such a temporary
(which you may not care very much about) and an "important" variable.

-- 
Stephen Turnbull  /  Yaseppochi-gumi  /  <turnbull AT shako DOT sk DOT tsukuba DOT ac DOT jp>
http://turnbull.sk.tsukuba.ac.jp/      anon FTP: turnbull.sk.tsukuba.ac.jp
Check out Kansai-WWW, too ------------> http://pclsp2.kuicr.kyoto-u.ac.jp/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019