This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PUSHED/OBVIOUS] Make extern declaration of dwarf_always_disassemble correct
- From: Simon Marchi <simark at simark dot ca>
- To: Christian Biesinger <cbiesinger at google dot com>, gdb-patches at sourceware dot org
- Date: Wed, 18 Sep 2019 07:17:50 -0400
- Subject: Re: [PUSHED/OBVIOUS] Make extern declaration of dwarf_always_disassemble correct
- References: <20190918045623.207809-1-cbiesinger@google.com>
On 2019-09-18 12:56 a.m., Christian Biesinger via gdb-patches wrote:
> This was an oversight in 491144b5e21bbfd41969c175aebb663976f59058;
> dwarf2loc.c has an extern definition for dwarf_always_disassemble
> that I missed. This patch updates it from int to bool to match
> the definition in dwarf2read.c.
Hi Christian,
I think we should take that opportunity to fix the problem in a way
that would have prevented this mistake and make things cleaner.
Can you try to move the declaration of dwarf_always_disassemble to dwarf2read.h,
remove the declaration from dwarf2loc.c, and make dwarf2loc.c include dwarf2read.h?
I think it's just for historical reasons that this variable has a local declaration
in dwarf2loc.c (dwarf2read.h exists since not so long ago), but as we saw it's a
bit dangerous to do it this way.
Simon