• 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: How to get source name/line number of backtrace?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to get source name/line number of backtrace?


  • Subject: Re: How to get source name/line number of backtrace?
  • From: Charlie Dickman <email@hidden>
  • Date: Wed, 4 Nov 2009 14:20:09 -0500

There are standard predefined macros that, among other things, give you the name of the source file. Use " __FILE__" (that's 2 underbars in front and 2 underbars in back).

as in... NSString *file = [NSString string withFormat: @"__FILE__"];

On Nov 4, 2009, at 1:28 PM, Jens Alfke wrote:


On Nov 4, 2009, at 1:14 AM, Samuel DELMONT wrote:

I get the name of the function and its arguments but I would like to have the source file's name and the line number of each address of the stack. I know that gdb can do this with "info line *addr", but I want to do it programmatically.

I got the symbolic information from the stack frame pointers by invoking the 'atos' tool. Kind of a kludge but it works. See the method my_callStack in
http://bitbucket.org/snej/myutilities/src/tip/ExceptionUtils.m


—Jens _______________________________________________
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

Charlie Dickman 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: How to get source name/line number of backtrace?
      • From: Jens Alfke <email@hidden>
References: 
 >How to get source name/line number of backtrace? (From: Samuel DELMONT <email@hidden>)
 >Re: How to get source name/line number of backtrace? (From: Jens Alfke <email@hidden>)

  • Prev by Date: Re: Breakpoint bubbles
  • Next by Date: Re: Xcode takes >30s to stop at a breakpoint
  • Previous by thread: Re: How to get source name/line number of backtrace?
  • Next by thread: Re: How to get source name/line number of backtrace?
  • Index(es):
    • Date
    • Thread