This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] compile-loc2c: Fix uninitialized variable error
- From: Simon Marchi <simon dot marchi at polymtl dot ca>
- To: Tom Tromey <tom at tromey dot com>
- Cc: Simon Marchi <simon dot marchi at ericsson dot com>, gdb-patches at sourceware dot org
- Date: Sun, 09 Jul 2017 20:27:50 +0200
- Subject: Re: [PATCH] compile-loc2c: Fix uninitialized variable error
- Authentication-results: sourceware.org; auth=none
- References: <1497124148-11187-1-git-send-email-simon.marchi@ericsson.com> <3ec2d2df8170bea2b43c095996ad7278@polymtl.ca> <8760f1o8zm.fsf@tromey.com>
On 2017-07-09 18:44, Tom Tromey wrote:
"Simon" == Simon Marchi <simon.marchi@polymtl.ca> writes:
Sorry about the delay on this. I've been away.
* compile/compile-loc2c.c (do_compile_dwarf_expr_to_c): Read
address when op is DW_OP_addr.
Simon> As you are the original author of that code, would it be
possible for
Simon> you to take a quick look, if you remember any of this :) ?
This patch looks correct to me. I'm sure the earlier state was just an
oversight.
Thanks! Pushing it now.
FWIW in gimli's DWARF expression code, I separated the format decoder
from the evaluator to avoid this sort of problem. Each operation is
decoded to an object; and then evaluation is done using the object.
This isn't perfect, as different users of the decoded objects can still
disagree about the semantics of the operation, but an approach like
this
would have caught this bug.
Indeed, that sounds like a good design.
Simon