This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch] x % 0 hangs


I like your patch, although I can't approve it.

There is a PR for this:

  http://sources.redhat.com/gdb/bugs/1056
  divide by zero hangs gdb

Could you a line to your ChangeLog like this:

2004-06-26    <david@streamline-computing.com>

	Partial fix for PR cli/1056.
	* valarith.c: check for zero in division and remainder
	evaluation.

> Although there may be some systems that can healthily respond to this, I
> propose a trivial patch - unless someone is going to tell me there's an
> option to stop the hanging, or respond differently to the signal.

Someone still has to dive into the signal handling design and fix the
lower-level problem, which is analyzed in the PR.  Briefly, the problem
is that gdb defers the its response to the signal and returns from the
signal handler, but returning from the signal handler for SIGFPE can
re-execute the same instruction that hung.

But I'm all for patching value_binop and providing a friendly
error message for BINOP_DIV and BINOP_REM.  That's the most common
place a gdb user would generate a SIGFPE.

Michael C


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]