Add debug symbols for global constants of integers, bools, enums, runes, & pointers.

Variables are namespaced with `pkg::name` or `name` if built-in or the initial package for convenience.
This commit is contained in:
gingerBill
2022-11-02 00:05:51 +00:00
parent 382bd87667
commit 3b583cbac7
3 changed files with 147 additions and 0 deletions
+27
View File
@@ -1736,6 +1736,13 @@ void lb_generate_code(lbGenerator *gen) {
lbProcedure *startup_runtime = lb_create_startup_runtime(default_module, startup_type_info, objc_names, global_variables);
gb_unused(startup_runtime);
if (build_context.ODIN_DEBUG) {
for_array(i, builtin_pkg->scope->elements.entries) {
Entity *e = builtin_pkg->scope->elements.entries[i].value;
add_debug_info_for_global_constant_from_entity(gen, e);
}
}
TIME_SECTION("LLVM Global Procedures and Types");
for_array(i, info->entities) {
Entity *e = info->entities[i];
@@ -1759,6 +1766,11 @@ void lb_generate_code(lbGenerator *gen) {
case Entity_TypeName:
case Entity_Procedure:
break;
case Entity_Constant:
if (build_context.ODIN_DEBUG) {
add_debug_info_for_global_constant_from_entity(gen, e);
}
break;
}
bool polymorphic_struct = false;
@@ -1820,6 +1832,21 @@ void lb_generate_code(lbGenerator *gen) {
lb_finalize_objc_names(objc_names);
if (build_context.ODIN_DEBUG) {
TIME_SECTION("LLVM Debug Info for global constant value declarations");
{
// lbModule *m = default_module;
}
// if (gen->modules.entries.count == 1) {
// } else {
// for_array(j, gen->modules.entries) {
// lbModule *m = gen->modules.entries[j].value;
// if (m->debug_builder != nullptr) {
// }
// }
// }
TIME_SECTION("LLVM Debug Info Complete Types and Finalize");
for_array(j, gen->modules.entries) {
lbModule *m = gen->modules.entries[j].value;