• 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 17:05:04 -0800

Doh!  Chris pointed out you had gotten to -gdwarf-2 and -g3...

DWARF itself works somewhat on Mac OS X but mostly because we haven't done anything explicitly to make it NOT work. But we don't support it/test it/etc. yet. For the same reason we don't have a mach-o DWARF dumper.

All this is in our plans, but is not there for Xcode 2.2.

Jim

On Jan 19, 2006, at 3:43 PM, Jim Ingham wrote:

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:
40apple.com


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:
    • Future DWARF support [was: Re: C Preprocessor Macro expansion in GDB]
      • From: James Widman <email@hidden>
References: 
 >C Preprocessor Macro expansion in GDB (From: James Widman <email@hidden>)
 >Re: C Preprocessor Macro expansion in GDB (From: Jim Ingham <email@hidden>)

  • Prev by Date: Re: "Build succeded (2 errors)"
  • Next by Date: Re: xcode and Pascal source files
  • Previous by thread: Re: C Preprocessor Macro expansion in GDB
  • Next by thread: Future DWARF support [was: Re: C Preprocessor Macro expansion in GDB]
  • Index(es):
    • Date
    • Thread