[PATCH] Introduce and use operation::type_p

Keith Seitz keiths@redhat.com
Tue Oct 1 19:09:31 GMT 2024


On 10/1/24 12:04 PM, Tom Tromey wrote:
>>>>>> "Tom" == Tom Tromey <tromey@adacore.com> writes:
> 
> Tom> There's currently code in gdb that checks if an expression evaluates
> Tom> to a type.  In some spots this is done by comparing the opcode against
> Tom> OP_TYPE, but other spots more correctly also compare with OP_TYPEOF
> Tom> and OP_DECLTYPE.
> 
> Tom> This patch cleans up this area, replacing opcode-checking with a new
> Tom> method on 'operation'.
> 
> Tom> Generally, checking the opcode should be considered deprecated,
> Tom> although it's unfortunately difficult to get rid of opcodes entirely.
> 
> Tom> I also took advantage of this change to turn eval_op_type into a
> Tom> method, removing a bit of indirection.
> 
> I'm checking this in now.

Coincidentally, I was just looking at this. :-)

And I think you should check it in!

FWIW,
Keith



More information about the Gdb-patches mailing list