This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Introduce support for location views


On Jul 12, 2017, Nick Clifton <nickc@redhat.com> wrote:

> It looks like you are not including dwarf2dbg.h in read.c.

Fixed with the incremental patch below.


> It also looks like you are calling dwarf2_emit_insn() unconditionally,
> even for targets which do not use/support the DWARF format...

dwarf2_emit_insn starts with a test that should make that ok (I
successfully tested sparc-aout and sh-pe):

  if (debug_type != DEBUG_DWARF2
      ? !dwarf2_loc_directive_seen
      : !seen_at_least_1_file ())
    return;

If we're not emitting dwarf2 line info from assembly sources, then we
will test dwarf2_loc_directive_seen, and that won't be set if we're not
handling .loc directives for dwarf2 line table output, so we will
return.  Since dwarf2dbg is linked in unconditionally, the only thing we
were missing was function declarations.


diff --git a/gas/read.c b/gas/read.c
index 37a03a6..629e1a0 100644
--- a/gas/read.c
+++ b/gas/read.c
@@ -37,6 +37,7 @@
 #include "macro.h"
 #include "obstack.h"
 #include "ecoff.h"
+#include "dwarf2dbg.h"
 #include "dw2gencfi.h"
 #include "wchar.h"
 
diff --git a/gas/subsegs.c b/gas/subsegs.c
index bb96142..76e3c6b 100644
--- a/gas/subsegs.c
+++ b/gas/subsegs.c
@@ -25,6 +25,8 @@
 #include "subsegs.h"
 #include "obstack.h"
 
+#include "dwarf2dbg.h"
+
 frchainS *frchain_now;
 
 static struct obstack frchains;


-- 
Alexandre Oliva, freedom fighter    http://FSFLA.org/~lxoliva/
You must be the change you wish to see in the world. -- Gandhi
Be Free! -- http://FSFLA.org/   FSF Latin America board member
Free Software Evangelist|Red Hat Brasil GNU Toolchain Engineer


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]