Skip to content

Commit

Permalink
Improve name canonicalization for some debuggers
Browse files Browse the repository at this point in the history
  • Loading branch information
gingerBill committed Feb 20, 2025
1 parent 90a973c commit 0946f6b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/name_canonicalization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -372,14 +372,14 @@ gb_internal void write_canonical_parent_prefix(TypeWriter *w, Entity *e) {
if (e->pkg->name == "llvm") {
type_writer_appendc(w, "$");
}
type_writer_append_fmt(w, CANONICAL_NAME_SEPARATOR "[%.*s]" CANONICAL_NAME_SEPARATOR, LIT(file_name));
type_writer_append_fmt(w, CANONICAL_NAME_SEPARATOR "%.*s" CANONICAL_NAME_SEPARATOR, LIT(file_name));
}
} else {
GB_PANIC("TODO(bill): handle entity kind: %d", e->kind);
}
if (e->kind == Entity_Procedure && e->Procedure.is_anonymous) {
String file_name = filename_without_directory(e->file->fullpath);
type_writer_append_fmt(w, CANONICAL_ANON_PREFIX "[%.*s:%d]", LIT(file_name), e->token.pos.offset);
type_writer_append_fmt(w, CANONICAL_ANON_PREFIX "_%.*s:%d", LIT(file_name), e->token.pos.offset);
} else {
type_writer_append(w, e->token.string.text, e->token.string.len);
}
Expand Down Expand Up @@ -514,7 +514,7 @@ gb_internal void write_canonical_entity_name(TypeWriter *w, Entity *e) {

if (write_scope_index_suffix) {
GB_ASSERT(e != nullptr && e->scope != nullptr);
type_writer_append_fmt(w, "[%d]", e->scope->index);
type_writer_append_fmt(w, CANONICAL_NAME_SEPARATOR "$%d", e->scope->index);
}

return;
Expand Down

0 comments on commit 0946f6b

Please sign in to comment.