Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
debug_stl.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  ERR
 

Typedefs

typedef const u8 *(* DebugStlIterator) (void *internal, size_t el_size)
 abstraction of all STL iterators used by debug_stl. More...
 

Functions

wchar_t * debug_stl_simplify_name (wchar_t *name)
 reduce complicated STL symbol names to human-readable form. More...
 
Status debug_stl_get_container_info (const wchar_t *type_name, const u8 *p, size_t size, size_t el_size, size_t *el_count, DebugStlIterator *el_iterator, void *it_mem)
 prepare to enumerate the elements of arbitrarily typed STL containers. More...
 

Variables

const Status ERR::STL_CNT_UNKNOWN = -100500
 
const Status ERR::STL_CNT_UNSUPPORTED = -100501
 
const Status ERR::STL_CNT_INVALID = -100502
 
const size_t DEBUG_STL_MAX_ITERATOR_SIZE = 64
 no STL iterator is larger than this; see below. More...
 

Typedef Documentation

◆ DebugStlIterator

typedef const u8 *(* DebugStlIterator) (void *internal, size_t el_size)

abstraction of all STL iterators used by debug_stl.

Function Documentation

◆ debug_stl_get_container_info()

Status debug_stl_get_container_info ( const wchar_t *  type_name,
const u8 p,
size_t  size,
size_t  el_size,
size_t *  el_count,
DebugStlIterator el_iterator,
void *  it_mem 
)

prepare to enumerate the elements of arbitrarily typed STL containers.

works by retrieving element count&size via debug information and hiding the container's iterator implementation behind a common interface. a basic sanity check is performed to see if the container memory is valid and appears to be initialized.

Parameters
type_nameexact type of STL container (see example above)
praw memory holding the container
sizesizeof(container)
el_sizesizeof(value_type)
el_countout; number of valid elements in container
el_iteratorout; callback function that acts as an iterator
it_memout; buffer holding the iterator state. must be at least DEBUG_STL_MAX_ITERATOR_SIZE bytes.
Returns
Status (ERR::STL_*)

◆ debug_stl_simplify_name()

wchar_t * debug_stl_simplify_name ( wchar_t *  name)

reduce complicated STL symbol names to human-readable form.

algorithm: remove/replace undesired substrings in one pass (fast). example: "std::basic_string\<char, char_traits\<char\>, std::allocator\<char\> \>" => "string".

Parameters
nameBuffer holding input symbol name; modified in-place. There is no length limit; must be large enough to hold typical STL strings. DEBUG_SYMBOL_CHARS chars is a good measure.
Returns
name for convenience.

Variable Documentation

◆ DEBUG_STL_MAX_ITERATOR_SIZE

const size_t DEBUG_STL_MAX_ITERATOR_SIZE = 64

no STL iterator is larger than this; see below.