Include s12z-opc.h using ../opcodes.

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

Commit Message

Terekhov, Mikhail via Gdb-patches Aug. 1, 2019, 5:26 p.m. UTC
  This file exists in binutils-gdb/opcodes, and nothing in Makefile.in adds this
to the include path.  Default builds work because in-tree readline adds
binutils-gdb/ to the include path (!). However, this is broken when compiling
with system readline.

Other files already use this way to include files in opcodes:
./gdb/lm32-tdep.c:#include "../opcodes/lm32-desc.h"
./gdb/or1k-tdep.h:#include "../opcodes/or1k-desc.h"
./gdb/mep-tdep.c:#include "../opcodes/mep-desc.h"

etc.

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

Simon Marchi Aug. 1, 2019, 5:30 p.m. UTC | #1
On 2019-08-01 1:26 p.m., Christian Biesinger via gdb-patches wrote:
> This file exists in binutils-gdb/opcodes, and nothing in Makefile.in adds this
> to the include path.  Default builds work because in-tree readline adds
> binutils-gdb/ to the include path (!). However, this is broken when compiling
> with system readline.

Yeah, my guess is that the include path is added when using the in-tree readline to make
#include "readline/readline.h" work.  And it made this include work by chance.

> Other files already use this way to include files in opcodes:
> ./gdb/lm32-tdep.c:#include "../opcodes/lm32-desc.h"
> ./gdb/or1k-tdep.h:#include "../opcodes/or1k-desc.h"
> ./gdb/mep-tdep.c:#include "../opcodes/mep-desc.h"
> 
> etc.
> 
> 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(-)
> 
> 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
> 
Thanks, the patch LGTM.

Simon
  
Terekhov, Mikhail via Gdb-patches Aug. 1, 2019, 5:45 p.m. UTC | #2
On Thu, Aug 1, 2019 at 12:30 PM Simon Marchi <simark@simark.ca> wrote:
>
> On 2019-08-01 1:26 p.m., Christian Biesinger via gdb-patches wrote:
> > This file exists in binutils-gdb/opcodes, and nothing in Makefile.in adds this
> > to the include path.  Default builds work because in-tree readline adds
> > binutils-gdb/ to the include path (!). However, this is broken when compiling
> > with system readline.
>
> Yeah, my guess is that the include path is added when using the in-tree readline to make
> #include "readline/readline.h" work.  And it made this include work by chance.
>
> > Other files already use this way to include files in opcodes:
> > ./gdb/lm32-tdep.c:#include "../opcodes/lm32-desc.h"
> > ./gdb/or1k-tdep.h:#include "../opcodes/or1k-desc.h"
> > ./gdb/mep-tdep.c:#include "../opcodes/mep-desc.h"
> >
> > etc.
> >
> > 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(-)
> >
> > 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
> >
> Thanks, the patch LGTM.

Thanks, pushed.
  

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