yazd / backtrace-d Goto Github PK
View Code? Open in Web Editor NEWbacktrace-d provides a pretty backtrace for D applications running under Linux
License: Boost Software License 1.0
backtrace-d provides a pretty backtrace for D applications running under Linux
License: Boost Software License 1.0
Make it compatible with windows or convert error to warning, please.
How about adding an option to filter out the extern runtime frames? They don't convey a whole lot of useful information if you're just debugging D code:
#6: ?? line (0) in extern (C) int rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).void runMain()
#7: ?? line (0) in extern (C) int rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).void tryExec(scope void delegate())
#8: ?? line (0) in extern (C) int rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).void runAll()
#9: ?? line (0) in extern (C) int rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).void tryExec(scope void delegate())
#10: ?? line (0) in _d_run_main
#11: ?? line (0) in main
#12: ?? line (0) in __libc_start_main
So in your example the backtrace would become just
object.Exception@source/app.d(15): Exception thrown
----------------
Stack trace:
#1: /path/to/source/app.d line (16) in void app.goToF2(uint)
(13)
(14) void goToF2(uint i = 0) {
(15) if (i == 2) throw new Exception("Exception thrown");
>(16) goToF2(++i);
(17) }
#2: /path/to/source/app.d line (17) in void app.goToF2(uint)
(14) void goToF2(uint i = 0) {
(15) if (i == 2) throw new Exception("Exception thrown");
(16) goToF2(++i);
>(17) }
#3: /path/to/source/app.d line (17) in void app.goToF2(uint)
#4: /path/to/source/app.d line (12) in void app.goToF1()
#5: /path/to/source/app.d line (7) in _Dmain
In this example:
object.Exception@source/app.d(15): Exception thrown
----------------
Stack trace:
#1: /path/to/source/app.d line (16) in void app.goToF2(uint)
(13)
(14) void goToF2(uint i = 0) {
(15) if (i == 2) throw new Exception("Exception thrown");
>(16) goToF2(++i);
(17) }
#2: /path/to/source/app.d line (17) in void app.goToF2(uint)
(14) void goToF2(uint i = 0) {
(15) if (i == 2) throw new Exception("Exception thrown");
(16) goToF2(++i);
>(17) }
#3: /path/to/source/app.d line (17) in void app.goToF2(uint)
#4: /path/to/source/app.d line (12) in void app.goToF1()
#5: /path/to/source/app.d line (7) in _Dmain
shouldn't the backtrace actually be more like this (frame 1: 16 -> 15, frame2: 17 -> 16, frame 3: 17 -> 16, frame 4: 12 -> 11):
object.Exception@source/app.d(15): Exception thrown
----------------
Stack trace:
#1: /path/to/source/app.d line (15) in void app.goToF2(uint)
(13)
(14) void goToF2(uint i = 0) {
>(15) if (i == 2) throw new Exception("Exception thrown");
(16) goToF2(++i);
(17) }
#2: /path/to/source/app.d line (16) in void app.goToF2(uint)
(14) void goToF2(uint i = 0) {
(15) if (i == 2) throw new Exception("Exception thrown");
>(16) goToF2(++i);
(17) }
#3: /path/to/source/app.d line (16) in void app.goToF2(uint)
#4: /path/to/source/app.d line (11) in void app.goToF1()
#5: /path/to/source/app.d line (7) in _Dmain
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.