fix codeview format/parse interleave

This commit is contained in:
Ryan Fleury
2025-06-19 07:29:24 -07:00
parent 058c1454e2
commit f2dc9a7d4a
5 changed files with 35 additions and 23 deletions
-22
View File
@@ -202,28 +202,6 @@ cv_string_from_language(CV_Language x)
return str8_zero();
}
internal String8
cv_string_from_numeric(Arena *arena, CV_NumericParsed num)
{
String8 result = str8_zero();
switch (num.kind) {
case CV_NumericKind_FLOAT16: NotImplemented; break; // TODO: format float16
case CV_NumericKind_FLOAT32: result = push_str8f(arena, "%f", (F64)(*(F32*)num.val)); break;
case CV_NumericKind_FLOAT48: NotImplemented; break; // TODO: format float48
case CV_NumericKind_FLOAT64: result = push_str8f(arena, "%f", *(F64*)num.val); break;
case CV_NumericKind_FLOAT80: NotImplemented; break; // TODO: format float80
case CV_NumericKind_FLOAT128: NotImplemented; break; // TODO: format float128
case CV_NumericKind_CHAR: result = push_str8f(arena, "%d", *(S8 *)num.val); break;
case CV_NumericKind_SHORT: result = push_str8f(arena, "%d", *(S16*)num.val); break;
case CV_NumericKind_LONG: result = push_str8f(arena, "%d", *(S32*)num.val); break;
case CV_NumericKind_QUADWORD: result = push_str8f(arena, "%lld", *(S64*)num.val); break;
case CV_NumericKind_USHORT: result = push_str8f(arena, "%u", *(U16*)num.val); break;
case CV_NumericKind_ULONG: result = push_str8f(arena, "%u", *(U32*)num.val); break;
case CV_NumericKind_UQUADWORD: result = push_str8f(arena, "%llu", *(U64*)num.val); break;
}
return result;
}
internal String8
cv_string_from_reg_id(Arena *arena, CV_Arch arch, U32 id)
{
-1
View File
@@ -2978,7 +2978,6 @@ internal U32 cv_map_encoded_base_pointer(CV_Arch arch, U32 enc
internal String8 cv_string_from_inline_range_kind(CV_InlineRangeKind kind);
internal String8 cv_string_from_type_index_source(CV_TypeIndexSource ti_source);
internal String8 cv_string_from_language(CV_Language x);
internal String8 cv_string_from_numeric(Arena *arena, CV_NumericParsed num);
internal String8 cv_string_from_reg_id(Arena *arena, CV_Arch arch, U32 id);
internal String8 cv_string_from_member_access(CV_MemberAccess x);
internal String8 cv_string_from_method_prop(CV_MethodProp x);
+24
View File
@@ -0,0 +1,24 @@
// Copyright (c) Epic Games Tools
// Licensed under the MIT license (https://opensource.org/license/mit/)
internal String8
cv_string_from_numeric(Arena *arena, CV_NumericParsed num)
{
String8 result = str8_zero();
switch (num.kind) {
case CV_NumericKind_FLOAT16: NotImplemented; break; // TODO: format float16
case CV_NumericKind_FLOAT32: result = push_str8f(arena, "%f", (F64)(*(F32*)num.val)); break;
case CV_NumericKind_FLOAT48: NotImplemented; break; // TODO: format float48
case CV_NumericKind_FLOAT64: result = push_str8f(arena, "%f", *(F64*)num.val); break;
case CV_NumericKind_FLOAT80: NotImplemented; break; // TODO: format float80
case CV_NumericKind_FLOAT128: NotImplemented; break; // TODO: format float128
case CV_NumericKind_CHAR: result = push_str8f(arena, "%d", *(S8 *)num.val); break;
case CV_NumericKind_SHORT: result = push_str8f(arena, "%d", *(S16*)num.val); break;
case CV_NumericKind_LONG: result = push_str8f(arena, "%d", *(S32*)num.val); break;
case CV_NumericKind_QUADWORD: result = push_str8f(arena, "%lld", *(S64*)num.val); break;
case CV_NumericKind_USHORT: result = push_str8f(arena, "%u", *(U16*)num.val); break;
case CV_NumericKind_ULONG: result = push_str8f(arena, "%u", *(U32*)num.val); break;
case CV_NumericKind_UQUADWORD: result = push_str8f(arena, "%llu", *(U64*)num.val); break;
}
return result;
}
+9
View File
@@ -0,0 +1,9 @@
// Copyright (c) Epic Games Tools
// Licensed under the MIT license (https://opensource.org/license/mit/)
#ifndef CODEVIEW_DUMP_H
#define CODEVIEW_DUMP_H
internal String8 cv_string_from_numeric(Arena *arena, CV_NumericParsed num);
#endif // CODEVIEW_DUMP_H
+2
View File
@@ -33,6 +33,7 @@
#include "dwarf/dwarf_parse.h"
#include "dwarf/dwarf_coff.h"
#include "dwarf/dwarf_elf.h"
// #include "dwarf/dwarf_dump.h"
#include "msf/msf.h"
#include "msf/msf_parse.h"
#include "pdb/pdb.h"
@@ -64,6 +65,7 @@
#include "dwarf/dwarf_parse.c"
#include "dwarf/dwarf_coff.c"
#include "dwarf/dwarf_elf.c"
// #include "dwarf/dwarf_dump.c"
#include "msf/msf.c"
#include "msf/msf_parse.c"
#include "pdb/pdb.c"