Re: evaluating #defines in gdb?

From: Matthew T. Churilla (
Date: 11/02/95

As far as I know the answer is no there are certain symbols that are carried 
over to the executable file from the compile process this is how gdb knows
function names and line numbers.  If you would like to test this write a 
buggy macro and then compile and run it.  It will give you an error code 
pointing to the actual code of the macro.  For exaple in my example
#define GET_NAME(ch)        (ch)->name
if this was buggy code then gdb would spit something out like
invalid use of pointer -> in line XXX of file foo.c
becuase this is what is contained in the object files.  As with most coding 
you get to notice when a macro is defined wrong or improperly used by the
error messages and line numbers that you recieve from gdb.


Matthew Churilla
Duquesne University CCIT User Consultant / Student of Computer Science
E-Mail Addresses
-------------------------------------------------------------------------------	  	Math\Computer Science Account		   	CCIT Next Account	   	Duquesne University E-Mail Account
"The difference between the right word and the almost right word is the
difference between lightning and a lightning bug."
					-Mark Twain

This archive was generated by hypermail 2b30 : 12/07/00 PST