fix packed buffer

This commit is contained in:
J. Nick Koston
2026-01-12 17:23:09 -10:00
parent 3a7cf3ac95
commit 5046ca164a
2 changed files with 16 additions and 4 deletions

View File

@@ -990,9 +990,9 @@ class PackedBufferTypeInfo(TypeInfo):
return (
f'out.append(" {self.name}: ");\n'
+ 'out.append("packed buffer [");\n'
+ f"out.append(std::to_string(this->{self.field_name}_count_));\n"
+ f"append_uint(out, this->{self.field_name}_count_);\n"
+ 'out.append(" values, ");\n'
+ f"out.append(std::to_string(this->{self.field_name}_length_));\n"
+ f"append_uint(out, this->{self.field_name}_length_);\n"
+ 'out.append(" bytes]\\n");'
)
@@ -2604,6 +2604,12 @@ static inline void append_with_newline(DumpBuffer &out, const char *str) {
out.append("\\n");
}
static inline void append_uint(DumpBuffer &out, uint32_t value) {
char buf[16];
snprintf(buf, sizeof(buf), "%" PRIu32, value);
out.append(buf);
}
// RAII helper for message dump formatting
class MessageDumpHelper {
public: