Include s12z-opc.h using ..

Message ID 20190801170141.198456-1-cbiesinger@google.com
State New, archived
Headers

Commit Message

Terekhov, Mikhail via Gdb-patches Aug. 1, 2019, 5:01 p.m. UTC
  I must be missing something; I don't see how this can compile?

This file exists in binutils-gdb/opcodes, and as far as I can tell
nothing in Makefile.in adds this to the include path. This patch
makes my compile work (when using --enable-targets=all).

gdb/ChangeLog:

2019-08-01  Christian Biesinger  <cbiesinger@google.com>

	* s12z-tdep.c: Fix include path for s12z-opc.h.

---
 gdb/s12z-tdep.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Tom Tromey Aug. 2, 2019, 6:20 p.m. UTC | #1
>>>>> "Christian" == Christian Biesinger via gdb-patches <gdb-patches@sourceware.org> writes:

Christian> I must be missing something; I don't see how this can compile?
Christian> This file exists in binutils-gdb/opcodes, and as far as I can tell
Christian> nothing in Makefile.in adds this to the include path. This patch
Christian> makes my compile work (when using --enable-targets=all).

This patch made me realize that moving gdbsupport to top-level is going
to run into this same issue.  I hadn't considered the
--with-system-readline case here :-(

I thought of 3 options:

1. Move all the gdbsupport headers into a subdirectory, either of
   gdbsupport or include.

2. Add a -I for gdbsupport and change how the #includes are written --
   dropping the "gdbsupport/" part.

3. Make a new "readline/readline" directory and move the contents there,
   similar to what is done for gnulib.

On the whole I lean toward plan 3, because it would also let us handle
opcodes includes in a less ugly way.

Tom
  

Patch

diff --git a/gdb/s12z-tdep.c b/gdb/s12z-tdep.c
index a9d20e809c..a1c085cfbb 100644
--- a/gdb/s12z-tdep.c
+++ b/gdb/s12z-tdep.c
@@ -30,7 +30,7 @@ 
 #include "opcode/s12z.h"
 #include "trad-frame.h"
 #include "remote.h"
-#include "opcodes/s12z-opc.h"
+#include "../opcodes/s12z-opc.h"
 
 /* Two of the registers included in S12Z_N_REGISTERS are
    the CCH and CCL "registers" which are just views into