DebugMgr.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2005 Palmsource, Inc.
00003  * 
00004  * This software is licensed as described in the file LICENSE, which
00005  * you should have received as part of this distribution. The terms
00006  * are also available at http://www.openbinder.org/license.html.
00007  * 
00008  * This software consists of voluntary contributions made by many
00009  * individuals. For the exact contribution history, see the revision
00010  * history and logs, available at http://www.openbinder.org
00011  */
00012 
00020 #ifndef _DEBUGMGR_H_
00021 #define _DEBUGMGR_H_
00022 
00023 #include <PalmTypes.h>
00024 #include <stdarg.h>
00025 
00026 #if defined(__cplusplus)
00027 extern "C" {
00028 #endif
00029 
00030 // Retrieve a stack crawl for the current thread.  The 'outAddresses' will
00031 // be filled in with the address of each function on the stack, from the
00032 // immediate caller down.  The number of available slots to return is in
00033 // 'maxResults'.  Use 'ignoreDepth' to skip functions at the top of the
00034 // stack.  Returns the number of functions actually found.
00035 // NOTE: ONLY IMPLEMENTED FOR PALMSIM.
00036 int32_t DbgWalkStack(int32_t ignoreDepth, int32_t maxResults, void** outAddresses);
00037 
00038 // Given a function address, return the raw symbol name for this
00039 // function.
00040 // NOTE: ONLY IMPLEMENTED FOR PALMSIM.
00041 status_t DbgLookupSymbol(const void* addr, int32_t maxLen, char* outSymbol, void** outAddr);
00042 
00043 // Given a symbol name, return the corresponding unmangled name.
00044 // NOTE: ONLY IMPLEMENTED FOR PALMSIM.
00045 status_t DbgUnmangleSymbol(char* symbol, int32_t maxLen, char* outName);
00046 
00047 // Clear out all malloc() profiling statistics that have been collected
00048 // so far for the current process.
00049 void DbgRestartMallocProfiling(void);
00050 void DbgSetMallocProfiling(Boolean enabled, int32_t dumpPeriod, int32_t maxItems, int32_t stackDepth);
00051 
00052 // Is the debugger connected?
00053 Boolean DbgIsPresent(void);
00054 
00055 #if defined(__cplusplus)
00056 } /* extern "C" */
00057 #endif
00058 
00059 #endif  //_DEBUGMGR_H_