[mlpack-git] [mlpack] Log::Fatal should give a backtrace of some sort (#380)

Grzegorz Krajewski notifications at github.com
Wed Dec 9 01:06:58 EST 2015


```__func__```, ```__FUNCTION__``` or ```__PREETY_FUNCTION__``` don't give too much. I can write some extinguish algorithm which will retrieve names of functions and ```__FILE__```, but still I'm left without line, where ```__LINE__``` don't help either.

The simpliest way as I know is to "dump" output file with ```objdump``` which is provided in ```binutils-dev```. Then I can get some ```hex``` numbers from "relocations" of ```PC``` - I mean addresses which program counter was calling. After I should find those addresses in symbolic table or dynamic symbols table in section ```.text``` of ```objdump``` output where next to the names of functions are file's names and line numbers.

Even when I use ```libc``` libraries to get addresses of functions (like I actually do only to get addresses) You can go straight forward to symbolic table, but still I'm depending on ```objdump```.

For sure there is simple way to obtain all those informations but I think I'll need some 'hacky-tricks' to "dump" myself output file or go straight into stack.

That is why it's easier to depend on already prepared library ```bfd``` from ```binutils-dev``` because time to get full backtrace this way is equal to get backtrace only for one frame when I was searching through ```objdump```.

Of course those are my short experiences with debugging that is why please don't take them too seriously. ;)

---
Reply to this email directly or view it on GitHub:
https://github.com/mlpack/mlpack/issues/380#issuecomment-163120489
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20151208/4bb39d9f/attachment.html>


More information about the mlpack-git mailing list