Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I get the stack trace information?

I am working on a server programming on linux machine using epoll and I have a problem with debugging. Right now I have placed log statements all over the place. It helps to see when it blows up but it is hard to see why..

So I was wondering if there is a way to print a stack trace or something more information in C++.

Thanks in advance...

edit:

I set -g in mu make file and if I run my server on GDB then it won't receive any packets. I don't know why but If I run this on command line then it receives packets but if I run this on GDB it doesn't receive anything from client(I can not see any log statements)

like image 332
user800799 Avatar asked Sep 15 '26 01:09

user800799


1 Answers

Try the backtrace function in Glibc.

like image 52
Fred Foo Avatar answered Sep 16 '26 13:09

Fred Foo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!