#include "precompiled.h"
#include "lib/debug_stl.h"
#include <deque>
#include <map>
#include <set>
#include <cassert>
#include <list>
#include "lib/regex.h"
Go to the source code of this file.
|
| STATUS_ADD_DEFINITIONS (debugStlStatusDefinitions) |
|
wchar_t * | debug_stl_simplify_name (wchar_t *name) |
| reduce complicated STL symbol names to human-readable form. More...
|
|
template<class T > |
const u8 * | stl_iterator (void *it_mem, size_t el_size) |
|
template<class T > |
static bool | IsContainerValid (const T &t, size_t el_count) |
|
template<class T > |
bool | get_container_info (const T &t, size_t size, size_t el_size, size_t &el_count, DebugStlIterator &el_iterator, void *it_mem) |
|
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...
|
|
#define CONTAINER |
( |
|
name, |
|
|
|
type_name_pattern |
|
) |
| |
Value:
{\
handled = true;\
IsValid = get_container_info<Any_##name>(*(Any_##name*)p, size, el_size, *el_count, *el_iterator, it_mem);\
}
int match_wildcard(const wchar_t *s, const wchar_t *w)
see if string matches pattern.
#define REPLACE |
( |
|
what, |
|
|
|
with |
|
) |
| |
Value:else if(!wcsncmp(src, (what),
ARRAY_SIZE(what)-1))\
{\
}
int wcscpy_s(wchar_t *dst, size_t max_dst_chars, const wchar_t *src)
Definition at line 49 of file debug_stl.cpp.
#define STD_CONTAINER |
( |
|
name | ) |
CONTAINER(name, L"std::" WIDEN(#name) L"<*>") |
#define STRINGIZE2 |
( |
|
id | ) |
# id |
#define STRIP_NESTED |
( |
|
what | ) |
|
Value:else if(!wcsncmp(src, (what),
ARRAY_SIZE(what)-1))\
{\
\
if(src != name && src[-1] == ',')\
dst--;\
nesting = 1;\
}
#define ENSURE(expr)
ensure the expression <expr> evaluates to non-zero.
Definition at line 61 of file debug_stl.cpp.
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_name | exact type of STL container (see example above) |
p | raw memory holding the container |
size | sizeof(container) |
el_size | sizeof(value_type) |
el_count | out; number of valid elements in container |
el_iterator | out; callback function that acts as an iterator |
it_mem | out; buffer holding the iterator state. must be at least DEBUG_STL_MAX_ITERATOR_SIZE bytes. |
- Returns
- Status (ERR::STL_*)
Definition at line 549 of file debug_stl.cpp.
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
-
name | Buffer 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.
Definition at line 80 of file debug_stl.cpp.
template<class T >
bool get_container_info |
( |
const T & |
t, |
|
|
size_t |
size, |
|
|
size_t |
el_size, |
|
|
size_t & |
el_count, |
|
|
DebugStlIterator & |
el_iterator, |
|
|
void * |
it_mem |
|
) |
| |
template<class T >
static bool IsContainerValid |
( |
const T & |
t, |
|
|
size_t |
el_count |
|
) |
| |
|
static |
template<class T >
const u8* stl_iterator |
( |
void * |
it_mem, |
|
|
size_t |
el_size |
|
) |
| |
Initial value:= {
}
const Status STL_CNT_UNSUPPORTED
const Status STL_CNT_INVALID
const Status STL_CNT_UNKNOWN
Definition at line 38 of file debug_stl.cpp.