bombela / backward-cpp

A beautiful stack trace pretty printer for C++
MIT License
3.81k stars 479 forks source link

Default source line format compatible with compiler error format #315

Open iripoll opened 1 year ago

iripoll commented 1 year ago

It would be nice, that by default, the line printed by print_source_loc() has the same aspect than those generated by most compilers. That is: [filename]:[line]

May code editors accept this syntax to open the file and move to the line. May be other debugging tools can also benefit from this small change. The current print is very human friendly, but it is less practical.

Here is an example: Current line error looks like:

0 Source "src/statistics.c", line 29, in BlockEntropy(void *data) ....

Suggested change:

0 Source "src/statistics.c:29", in BlockEntropy(void *data) ....

stelzch commented 11 months ago

I also ran across the same issue and created a PR.