home *** CD-ROM | disk | FTP | other *** search
- /*
- File: Crawl.h
-
- Contains: StackCrawl class, for building & examining stack crawls
-
- Owned by: Jens Alfke
-
- Copyright: © 1995 by Apple Computer, Inc., all rights reserved.
-
- */
-
-
- /* In StackCrawl::New, frames are numbered with 0 being the top of the stack (the caller
- of New) and the numbers increasing down the stack. The endAt parameter may be negative,
- which means to skip that many frames at the base of the stack; or zero, which means
- to go all the way to the end. */
-
- #ifndef __TYPES__
- #include <Types.h>
- #endif
-
- #ifndef __STDDEF__
- #include <stddef.h>
- #endif
-
- class StackCrawl {
- public:
-
- static StackCrawl* New( long startAt =0, long endAt =0 );
-
- long CountFrames( ) const
- {return fNFrames;}
- Boolean IsFrameNative( long ) const;
- const void* GetFramePC( long ) const;
- Boolean LookupSymbol( long i, char fnName[], size_t *offset ) const;
- Boolean GetFrameName( long i, char[] ) const;
- void AsString( char[], long maxLen, const char delimiter[] ) const;
-
- unsigned long Hash ( ) const;
-
- Boolean operator== ( const StackCrawl& ) const;
- Boolean operator!= ( const StackCrawl& c ) const
- {return !(*this==c);}
-
- private:
- long fNFrames;
- const void * fFrame[1];
-
- StackCrawl( long nFrames ) {fNFrames = nFrames;}
- void* operator new( size_t size, long nFrames );
- };
-
-
- Boolean GetNameOfCaller( char str[] );
-