Skip to content

Commit 734e303

Browse files
Make the output of --sym-info hopefully a little less confusing
1 parent cca7c83 commit 734e303

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

libwild/src/layout.rs

+5-15
Original file line numberDiff line numberDiff line change
@@ -4337,18 +4337,7 @@ impl std::fmt::Debug for FileLayoutState<'_> {
43374337
}
43384338

43394339
fn print_symbol_info<S: StorageModel>(symbol_db: &SymbolDb<S>, name: &str) {
4340-
if let Some(symbol_id) = symbol_db
4341-
.global_names
4342-
.get(&SymbolName::prehashed(name.as_bytes()))
4343-
{
4344-
println!(
4345-
"Global definition:\n {}",
4346-
symbol_db.symbol_debug(symbol_id)
4347-
);
4348-
} else {
4349-
println!("No global symbol `{name}` defined by any input files");
4350-
}
4351-
println!("Definitions / references for `{name}`:");
4340+
println!("Definitions / references with name `{name}`:");
43524341
for i in 0..symbol_db.num_symbols() {
43534342
let symbol_id = SymbolId::from_usize(i);
43544343
if symbol_db
@@ -4362,12 +4351,13 @@ fn print_symbol_info<S: StorageModel>(symbol_db: &SymbolDb<S>, name: &str) {
43624351
let local_index = symbol_id.to_input(o.symbol_id_range);
43634352
match o.object.symbol(local_index) {
43644353
Ok(sym) => {
4354+
let canonical = symbol_db.definition(symbol_id);
43654355
println!(
4366-
" {}: symbol_id={symbol_id} Local #{local_index} \
4367-
in File #{file_id} {} ({})",
4356+
" {}: symbol_id={symbol_id} -> {canonical} {} \n \
4357+
#{local_index} in File #{file_id} {}",
43684358
crate::symbol::SymDebug(sym),
4369-
o.input,
43704359
symbol_db.local_symbol_value_flags(symbol_id),
4360+
o.input,
43714361
);
43724362
}
43734363
Err(e) => {

0 commit comments

Comments
 (0)