raddbg_markup: stl batteries-included basics

This commit is contained in:
Ryan Fleury
2025-05-03 06:18:26 -07:00
parent fe7bd82bda
commit dfd0fe3fcb
2 changed files with 28 additions and 5 deletions
+22
View File
@@ -12,6 +12,10 @@
# define RADDBG_MARKUP_VSNPRINTF vsnprintf
#endif
#if !defined(RADDBG_MARKUP_STL_TYPE_VIEWS)
# define RADDBG_MARKUP_STL_TYPE_VIEWS 1
#endif
////////////////////////////////
//~ Usage Macros
@@ -383,4 +387,22 @@ raddbg_add_or_remove_breakpoint__impl(void *ptr, int set, int size, int r, int w
#endif // defined(_WIN32)
#endif // defined(RADDBG_MARKUP_IMPLEMENTATION)
////////////////////////////////
//~ Win32 STL Type Views
#if defined(_WIN32) && defined(RADDBG_MARKUP_IMPLEMENTATION) && RADDBG_MARKUP_STL_TYPE_VIEWS
# if defined(_VECTOR_)
raddbg_type_view(std::vector<?>, slice(_Mypair._Myval2));
# endif
# if defined(_MEMORY_)
raddbg_type_view(std::unique_ptr<?>, _Mypair._Myval2);
# endif
# if defined(_STRING_)
raddbg_type_view(std::basic_string<?>, _Mypair._Myval2._Myres <= 15 ? _Mypair._Myval2._Bx._Buf : _Mypair._Myval2._Bx._Ptr);
# endif
# if defined(_STRING_VIEW_)
// TODO(rjf)
# endif
#endif // defined(_WIN32) && defined(RADDBG_MARKUP_IMPLEMENTATION) && RADDBG_MARKUP_STL_TYPE_VIEWS
#endif // RADDBG_MARKUP_H
+6 -5
View File
@@ -6,6 +6,9 @@
** stepping, breakpoints, evaluation, cross-module calls.
*/
#include <string>
#include <vector>
#include <memory>
#define RADDBG_MARKUP_IMPLEMENTATION
#include "lib_raddbg_markup/raddbg_markup.h"
@@ -103,13 +106,8 @@ void optimized_struct_parameters_eval_tests(void);
////////////////////////////////
// NOTE(allen): Type Coverage Eval
#include <vector>
#include <memory>
#include <stdint.h>
raddbg_type_view(std::vector<?>, slice(_Mypair._Myval2));
raddbg_type_view(std::unique_ptr<?>, _Mypair._Myval2);
struct Basics
{
char a;
@@ -553,6 +551,9 @@ type_coverage_eval_tests(void)
const int32_t y1 = -10;
const int32_t z1 = x1 + y1;
std::string small_cplusplus_string = "smallstr";
std::string cplusplus_string = "This is a C++ string!";
std::vector<int> int_vector;
int_vector.push_back(1);
int_vector.push_back(2);