diff --git a/include/QF/progs.h b/include/QF/progs.h index 76b8e0000..adae471f9 100644 --- a/include/QF/progs.h +++ b/include/QF/progs.h @@ -1984,6 +1984,9 @@ int PR_LoadDebug (progs_t *pr); const char *PR_Debug_GetBaseDirectory (progs_t *pr, const char *file); void PR_Debug_Watch (progs_t *pr, const char *expr); void PR_Debug_Print (progs_t *pr, const char *expr); +const char *PR_Debug_ValueString (progs_t *pr, pr_ptr_t offset, + struct qfot_type_s *type, + struct dstring_s *dstr); pr_auxfunction_t *PR_Debug_AuxFunction (progs_t *pr, pr_uint_t func) __attribute__((pure)); pr_auxfunction_t *PR_Debug_MappedAuxFunction (progs_t *pr, pr_uint_t func) __attribute__((pure)); pr_def_t *PR_Debug_LocalDefs (progs_t *pr, pr_auxfunction_t *aux_function) __attribute__((pure)); diff --git a/libs/gamecode/pr_debug.c b/libs/gamecode/pr_debug.c index 1b1484351..2a07ba9cd 100644 --- a/libs/gamecode/pr_debug.c +++ b/libs/gamecode/pr_debug.c @@ -1168,6 +1168,15 @@ global_string (pr_debug_data_t *data, pr_ptr_t offset, qfot_type_t *type, return dstr->str; } +const char * +PR_Debug_ValueString (progs_t *pr, pr_ptr_t offset, qfot_type_t *type, + dstring_t *dstr) +{ + pr_debug_data_t data = {pr, dstr}; + value_string (&data, type, pr->pr_globals + offset); + return dstr->str; +} + static void pr_debug_void_view (qfot_type_t *type, pr_type_t *value, void *_data) {