Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C Preprocessor Macro expansion in GDB



The stabs debugging format doesn't support recording macro information. So with the current tools, you can't get the compiler to emit macro information.

Jim

On Jan 19, 2006, at 3:26 PM, James Widman wrote:

Hi all,

I'm interested in using preprocessor macros in expressions in GDB sessions, but I can't seem to get it to work. I followed the example given here:

http://developer.apple.com/documentation/DeveloperTools/gdb/gdb/ gdb_10.html

As specified in the documentation, I compiled like so (using GCC 4.0.1, bundled with Xcode 2.2.1):

    gcc -gdwarf-2 -g3 sample.c -o sample	

But when I got to the point in the example where it instructs you to issue the GDB command:

    info macro ADD

... I received only this message:

    GDB has no preprocessor macro information for that code.


Now, I haven't yet found the Mach-O equivalent of:

    readelf --debug-dump=macro sample

... but when I load the binary file 'sample' into a text editor, I can see a region where all of the macro definitions are stored. So it kind of looks like GCC did its part to generate debug symbols for macros, but GDB decided not to load them in.

Is macro expansion supported in Apple's version of GDB? If so, how can I coax it into performing its documented behavior?

Thanks in advance,

James

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/xcode-users/email@hidden

This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Xcode-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/xcode-users/email@hidden

This email sent to email@hidden
References: 
 >C Preprocessor Macro expansion in GDB (From: James Widman <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.