@@ -82,7 +82,7 @@ extern "C" CDECL rust_vec*
82
82
vec_alloc (rust_task *task, type_desc *t, type_desc *elem_t , size_t n_elts)
83
83
{
84
84
rust_dom *dom = task->dom ;
85
- task->log (rust_log::MEM,
85
+ task->log (rust_log::MEM | rust_log::STDLIB ,
86
86
" vec_alloc %" PRIdPTR " elements of size %" PRIdPTR,
87
87
n_elts, elem_t ->size );
88
88
size_t fill = n_elts * elem_t ->size ;
@@ -108,6 +108,23 @@ vec_len(rust_task *task, type_desc *ty, rust_vec *v)
108
108
return v->fill / ty->size ;
109
109
}
110
110
111
+ extern " C" CDECL void
112
+ vec_print_debug_info (rust_task *task, type_desc *ty, rust_vec *v)
113
+ {
114
+ task->log (rust_log::STDLIB,
115
+ " vec_print_debug_info(%" PRIxPTR " )"
116
+ " with tydesc %" PRIxPTR
117
+ " (size = %" PRIdPTR " , align = %" PRIdPTR " )"
118
+ " alloc = %" PRIdPTR " , fill = %" PRIdPTR
119
+ " , data = ..." , v, ty, ty->size , ty->align , v->alloc , v->fill );
120
+
121
+ for (size_t i = 0 ; i < v->fill ; ++i) {
122
+ task->log (rust_log::STDLIB,
123
+ " %" PRIdPTR " : 0x%" PRIxPTR,
124
+ i, v->data [i]);
125
+ }
126
+ }
127
+
111
128
/* Helper for str_alloc and str_from_vec. Returns NULL as failure. */
112
129
static rust_str *
113
130
str_alloc_with_data (rust_task *task,
0 commit comments