This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [BUG] BINOP_DIV and ptyp command
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Doug Evans <dje at google dot com>
- Cc: GDB Patches <gdb-patches at sourceware dot org>, Pierre Muller <muller at ics dot u-strasbg dot fr>
- Date: Mon, 28 Jan 2008 22:41:48 -0800
- Subject: Re: [BUG] BINOP_DIV and ptyp command
- References: <002301c85c12$a73a4640$f5aed2c0$@u-strasbg.fr> <e394668d0801282052g3c3b0510l3448f39a5a6d78f0@mail.gmail.com>
> I may be missing something, but it seems like special casing
> EVAL_AVOID_SIDE_EFFECTS for DIV/MOD/REM is no longer useful here
I don't think this is right. EVAL_AVOID_SIDE_EFFECTS is used when
computing the actual value is not needed. For instance, when you do
"ptype", the expression is evaluated in that mode. So when you do
"ptype 3 div 2", we don't do the division, we just know that we're only
interested in the type of result. So the expression evaluator will
return a struct value of the correct type but with a bogus contents,
instead of doing the division, only to discard the result down the road.
So the code you suggested we remove is useful.
--
Joel