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: Tom Tromey <tom at tromey dot com>
- To: Simon Marchi <simon dot marchi at polymtl dot ca>
- Cc: Simon Marchi <simon dot marchi at ericsson dot com>, gdb-patches at sourceware dot org, Tom Tromey <tom at tromey dot com>
- Date: Sun, 09 Jul 2017 10:44:45 -0600
- 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>
>>>>> "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.
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.
Tom