Recent

Author Topic: RaiseGDBException "Division by zero"  (Read 7144 times)

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9868
  • Debugger - SynEdit - and more
    • wiki
Re: RaiseGDBException "Division by zero"
« Reply #15 on: September 20, 2017, 01:39:27 pm »
There are 2 answers/questions:

1) Why is there code, that divides by 0 (fully intentional)

2) Why is it called in your case.


--------------------

AFAIK its from the old days.
GDB did not catch FCP exceptions. (It does nowadays, but only if there is sufficient debug info)

A division by zero, produces a Sig...., and gdb will always get this.

In case of an unhandled exception, the LCL will catch it for you, and then call this code.

So the answer is, that somewhere else, you got an unhandled exception.


jamie

  • Hero Member
  • *****
  • Posts: 6130
Re: RaiseGDBException "Division by zero"
« Reply #16 on: September 22, 2017, 02:04:56 am »
It looks like someone took a short cut to test for the length(msg), if 0 then it
generates a DIV 0 error..

  Back before fault handling that was assured to dump the
program. That was also a way to dump the program under conditions of checking valid
information, like license keys etc.

The only true wisdom is knowing you know nothing

jamie

  • Hero Member
  • *****
  • Posts: 6130
Re: RaiseGDBException "Division by zero"
« Reply #17 on: September 22, 2017, 02:06:04 am »
I also wanted to add it was a way of trapping code and redirecting execution to a DIV 0
handler.
The only true wisdom is knowing you know nothing

 

TinyPortal © 2005-2018