espmonitor icon indicating copy to clipboard operation
espmonitor copied to clipboard

Demangling not working correctly

Open MabezDev opened this issue 3 years ago • 3 comments
trafficstars

I believe the trace should be demangling symbols, as per https://github.com/esp-rs/espmonitor/blob/992fefbed469a46f2dfe66e4e9e11432f57d0fb6/espmonitor/src/lib.rs#L324.

Sadly it doesn't seem to be working correctly:

Backtrace:
 
0x400d8652
0x400d8652 - _ZN4core3num7flt2dec17digits_to_dec_str17hc32606d1079c94d2E
    at ??:??
0x400d886d
0x400d886d - _ZN4core3num7flt2dec15to_shortest_str17h654526032c2cd997E
    at ??:??
0x400d710c
0x400d710c - _ZN4core3fmt5float32float_to_decimal_common_shortest17h41be84e596d8a6caE.llvm.13434864130540073215
    at ??:??
0x400d717b
0x400d717b - _ZN4core3fmt5float52_$LT$impl$u20$core..fmt..Display$u20$for$u20$f64$GT$3fmt17h59c8e4b96a25ec7cE
    at ??:??
0x400d72be
0x400d72be - _ZN4core3fmt5write17h0ac2b54e9e860323E
    at ??:??
0x400d0bb5
0x400d0bb5 - main
    at ??:??
0x400d12c2
0x400d12c2 - Reset
    at ??:??
0x400d0f60
0x400d0f60 - ESP32Reset
    at ??:??

MabezDev avatar Aug 25 '22 15:08 MabezDev

Right, it should be... Can you try with latest main. I've merged a bunch of dependency updates (including addr2line) recently, and it's possible something in there fixed it (assuming it's not epsmonitor's fault). If it works, I can just cut a new release.

kelnos avatar Aug 25 '22 18:08 kelnos

Ah, so I found it only didn't work in release mode.

I added the following to the release profile settings and it started working.

[profile.release]
debug = true

Which is a slightly odd requirement for name demangling?

MabezDev avatar Aug 31 '22 16:08 MabezDev

Hmm, all I can think of is that the demangled names are stored in debug info, because maybe the demangling of Rust symbols isn't actually set in stone like it is for C++? So there's no standard algorithm that the addr2line crate can use between different versions of rustc? Dunno...

kelnos avatar Aug 31 '22 19:08 kelnos