[Dwarf-Discuss] interpretation of DW_OP_mod

Tom Tromey tromey@redhat.com
Tue Jan 19 20:27:42 GMT 2010


While looking into a gdb bug I came across an oddity in GCC's unwinder.
It treats the operands of DW_OP_mod as signed:

	      case DW_OP_mod:
		result = (_Unwind_Sword) second % (_Unwind_Sword) first;
		break;

Other programs (valgrind 3.3.1, according to google code search) also
follow this interpretation -- I assume because it seems strange to have
signed division but unsigned modulus.

Is this a (widespread) bug in these programs?  Or an oversight in the
spec?

Tom




More information about the Dwarf-discuss mailing list