From a8837843766289c5afd9460c9a3e2b469e8d0e50 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Fri, 5 Feb 2021 00:25:05 +0100 Subject: [PATCH] bt: Show filenames and line numbers when available :^) --- Userland/Utilities/bt.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Userland/Utilities/bt.cpp b/Userland/Utilities/bt.cpp index 0bf569a0ad..a87a58f3b7 100644 --- a/Userland/Utilities/bt.cpp +++ b/Userland/Utilities/bt.cpp @@ -24,6 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include #include #include #include @@ -67,7 +68,12 @@ int main(int argc, char** argv) // FIXME: Support multiple threads in the same process! auto symbols = SymbolClient::symbolicate_thread(pid, pid); for (auto& symbol : symbols) { - outln("{:p} {}", symbol.address, symbol.name); + out("{:p} ", symbol.address); + if (!symbol.name.is_empty()) + out("{} ", symbol.name); + if (!symbol.filename.is_empty()) + out("(\033[34;1m{}\033[0m:{})", LexicalPath(symbol.filename).basename(), symbol.line_number); + outln(""); } return 0; }