This patch fixes a crash found on "p *(type *)0x1234" when using "set debug expression 1". While casting works as expected with expression debugging turned off, this seems to be an indication that I'm infact doing something wrong in the building of the expression. (gdb) print *(int*)(0x0) Dump of expression @ 0x12db320, before conversion to prefix form: Language d, 11 elements, 16 bytes each. Index Opcode Hex Value String Value 0 OP_TYPE 87 W............... 1 20114800 p.2............. 2 OP_TYPE 87 W............... 3 OP_LONG 38 &............... 4 19696640 ..,............. 5 OP_NULL 0 ................ 6 OP_LONG 38 &............... 7 UNOP_CAST 51 3............... 8 20114800 p.2............. 9 UNOP_CAST 51 3............... 10 UNOP_IND 61 =............... Dump of expression @ 0x12db320, after conversion to prefix form: Expression: `*(int *) 0' Language d, 11 elements, 16 bytes each. 0 UNOP_IND 1 UNOP_CAST Type @0x132ed70 (int *) 4 OP_LONG Type @0x12c8c00 (int), value 0 (0x0) 8 Unknown format 9 UNOP_CAST Type @0x3d (Segmentation fault Looks like using UNOP_CAST_TYPE is the right thing to do here, as the TypeExp handler has wrapped the type around a pair of OP_TYPE opcodes.