• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: C Preprocessor Macro expansion in GDB
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C Preprocessor Macro expansion in GDB


  • Subject: Re: C Preprocessor Macro expansion in GDB
  • From: Jim Ingham <email@hidden>
  • Date: Thu, 19 Jan 2006 15:43:35 -0800

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:
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: This email sent to email@hidden
  • Follow-Ups:
    • Re: C Preprocessor Macro expansion in GDB
      • From: Jim Ingham <email@hidden>
References: 
 >C Preprocessor Macro expansion in GDB (From: James Widman <email@hidden>)

  • Prev by Date: RE: Help debugging a framework
  • Next by Date: RE: Help debugging a framework
  • Previous by thread: C Preprocessor Macro expansion in GDB
  • Next by thread: Re: C Preprocessor Macro expansion in GDB
  • Index(es):
    • Date
    • Thread