UTDebugSymbolInfo.h

Go to the documentation of this file.
00001 //==================================================================================================
00002 // Copyright (C) 2010  Brian Tietz    sdbtietz at yahoo dot com
00003 //
00004 // This program is free software; you can redistribute it and/or modify it under the terms of the
00005 // GNU General Public License as published by the Free Software Foundation, version 2.0 of the
00006 // License.
00007 //
00008 // This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
00009 // even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00010 // General Public License for more details.
00011 //
00012 // You should have received a copy of the GNU General Public License along with this program; if
00013 // not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00014 // 02110-1301, USA.
00015 //
00016 // For commercial software, the copyright holder (Brian Tietz, email sdbtietz at yahoo dot com)
00017 // reserves the right and is willing to waive the proprietary source code disclosure aspects of that
00018 // license as applied to the UT library in exchange for either substantial contributions to the
00019 // development of the UT library or other forms of compensation.  Any such waiver must be
00020 // established in writing between the copyright holder and the commercial entity obtaining such a
00021 // waiver.
00022 //==================================================================================================
00023 
00024 
00025 #ifndef _UT_DEBUG_SYMBOL_INFO_H_
00026 #define _UT_DEBUG_SYMBOL_INFO_H_
00027 
00028 
00029 //==================================================================================================
00030 //=== Project headers
00031 //==================================================================================================
00032 #include "UTPath.h"
00033 
00034 
00035 //==================================================================================================
00036 class UT_EXPORT DebugSymbolInfo_t
00037 //==================================================================================================
00043 {
00044     //----------------------------------------------------------------------------------------------
00045     public:
00046     //----------------------------------------------------------------------------------------------
00047     inline                  DebugSymbolInfo_t();
00049 
00050     inline                  DebugSymbolInfo_t(  byte* function_name_buf,
00051                                                 int function_name_buf_size );
00056 
00057     inline                  DebugSymbolInfo_t(  byte* function_name_buf,
00058                                                 int function_name_buf_size,
00059                                                 byte* file_name_buf,
00060                                                 int file_name_buf_size );
00065 
00066     bool                    SetAddr(    const void* address,
00067                                         bool collect_file_name = true,
00068                                         bool file_leaf_name_only = true );
00082 
00083     inline const String_t&  FunctionName() const;
00086 
00087     inline uint32           FunctionOffset() const;
00090 
00091     inline const Path_t&    FileName() const;
00097 
00098     inline uint32           FileLineNumber() const;
00103 
00104     //----------------------------------------------------------------------------------------------
00105     private:
00106     //----------------------------------------------------------------------------------------------
00107     String_t                m_function_name;
00108     uint32                  m_function_offset;
00109     Path_t                  m_file_name;
00110     uint32                  m_file_line_number;
00111 
00112     friend class DebugSymbolInfoCacheEntry_t;
00113 };
00114 
00115 
00116 
00117 
00118 //==================================================================================================
00119 //==================================================================================================
00120 //===
00121 //=== Inline function implementations
00122 //===
00123 //==================================================================================================
00124 //==================================================================================================
00125 inline 
00126 DebugSymbolInfo_t::DebugSymbolInfo_t()
00127 {
00128     m_function_offset = 0xFFFFFFFF;
00129     m_file_line_number = 0;
00130 }
00131 
00132 
00133 inline
00134 DebugSymbolInfo_t::DebugSymbolInfo_t( byte* function_name_buf, int function_name_buf_size )
00135 : m_function_name( function_name_buf, function_name_buf_size )
00136 {
00137     m_function_offset = 0xFFFFFFFF;
00138     m_file_line_number = 0;
00139 }
00140 
00141 
00142 inline
00143 DebugSymbolInfo_t::DebugSymbolInfo_t(   byte* function_name_buf,
00144                                         int function_name_buf_size,
00145                                         byte* file_name_buf,
00146                                         int file_name_buf_size )
00147 :   m_function_name( function_name_buf, function_name_buf_size ),
00148     m_file_name( file_name_buf, file_name_buf_size )
00149 {
00150     m_function_offset = 0xFFFFFFFF;
00151     m_file_line_number = 0;
00152 }
00153 
00154 
00155 inline const String_t&
00156 DebugSymbolInfo_t::FunctionName() const
00157 {
00158     assert( m_function_name.LengthBytes() );
00159     return m_function_name;
00160 }
00161 
00162 
00163 inline uint32
00164 DebugSymbolInfo_t::FunctionOffset() const
00165 {
00166     return m_function_offset;
00167 }
00168 
00169 
00170 inline const Path_t&
00171 DebugSymbolInfo_t::FileName() const
00172 {
00173     return m_file_name;
00174 }
00175 
00176 
00177 inline uint32
00178 DebugSymbolInfo_t::FileLineNumber() const
00179 {
00180     return m_file_line_number;
00181 }
00182 
00183 
00184 #endif // _UT_DEBUG_SYMBOL_INFO_H_

Generated on Tue Dec 14 22:35:05 2010 for UT library by  doxygen 1.6.1