I have a g++ program that runs without user input. Somewhere the program is interrupted and it says "Floating point exception." Can gdb help me find what's causing this in my code? How?
You can get help on GDB here and at Gnu's site here.
But the basics are this:
$ gdb ./your_program // start gdb on the program
> run // run the program
> run argv1 argv2 // or run it with command line arguments
(floating point exception) // let it run until exception occurs
> bt // bt will show the stack trace
Here are some gdb settings on how to make sure it stops on floating point exceptions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With