]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Debug more information when we fail to find a lock call symbol
authorMatt Corallo <git@bluematt.me>
Wed, 20 Mar 2024 20:40:41 +0000 (20:40 +0000)
committerMatt Corallo <git@bluematt.me>
Fri, 5 Apr 2024 09:05:26 +0000 (09:05 +0000)
lightning/src/sync/debug_sync.rs

index 2b75e095380ec09f22d07d4d1bd636dd93e53c61..5968a79ee4daa50439a3cac96478c49d3803458b 100644 (file)
@@ -103,7 +103,9 @@ fn locate_call_symbol(backtrace: &Backtrace) -> (String, Option<u32>) {
                        }
                }
        }
-       let symbol = symbol_after_latest_debug_sync.expect("Couldn't find lock call symbol");
+       let symbol = symbol_after_latest_debug_sync.unwrap_or_else(|| {
+               panic!("Couldn't find lock call symbol in trace {:?}", backtrace);
+       });
        (format!("{}:{}", symbol.filename().unwrap().display(), symbol.lineno().unwrap()), symbol.colno())
 }