gdb: fix IA64 build failure of linux-nat

Message ID 20200519212710.1417100-1-slyfox@gentoo.org
State New
Headers show
Series
  • gdb: fix IA64 build failure of linux-nat
Related show

Commit Message

Simon Marchi via Gdb-patches May 19, 2020, 9:27 p.m.
From: Sergei Trofimovich <siarheit@google.com>


On IA64 built failed as:

```
ia64-linux-nat.c:352:29: error: 'gdbarch_num_regs' was not declared in this scope
  352 |   if (regno < 0 || regno >= gdbarch_num_regs (gdbarch))
      |                             ^~~~~~~~~~~~~~~~
```

The fix includes "gdbarch.h" header where symbol is declared.

	* gdb/ia64-linux-nat.c: include "gdbarch.h" to declare used
	'gdbarch_num_regs'.

Signed-off-by: Sergei Trofimovich <siarheit@google.com>

---
 gdb/ChangeLog        | 5 +++++
 gdb/ia64-linux-nat.c | 1 +
 2 files changed, 6 insertions(+)

-- 
2.26.2

Comments

Simon Marchi via Gdb-patches May 19, 2020, 10 p.m. | #1
On Tue, 19 May 2020 22:27:10 +0100
Sergei Trofimovich via Gdb-patches <gdb-patches@sourceware.org> wrote:

> From: Sergei Trofimovich <siarheit@google.com>

> 

> On IA64 built failed as:

> 

> ```

> ia64-linux-nat.c:352:29: error: 'gdbarch_num_regs' was not declared in this scope

>   352 |   if (regno < 0 || regno >= gdbarch_num_regs (gdbarch))

>       |                             ^~~~~~~~~~~~~~~~

> ```

> 

> The fix includes "gdbarch.h" header where symbol is declared.

> 

> 	* gdb/ia64-linux-nat.c: include "gdbarch.h" to declare used

> 	'gdbarch_num_regs'.


Okay, but please capitalize "include" in the ChangeLog entry prior
to pushing this change.

Kevin

Patch

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index ac0beef5ad..0d921da325 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@ 
+2020-05-19  Sergei Trofimovich  <siarheit@google.com>
+
+	* gdb/ia64-linux-nat.c: include "gdbarch.h" to declare used
+	'gdbarch_num_regs'.
+
 2020-05-19  Simon Marchi  <simon.marchi@efficios.com>
 
 	* dwarf2/read.c (quirk_rust_enum): Allocate enough fields.
diff --git a/gdb/ia64-linux-nat.c b/gdb/ia64-linux-nat.c
index 8f36ea78e7..b532e7a51c 100644
--- a/gdb/ia64-linux-nat.c
+++ b/gdb/ia64-linux-nat.c
@@ -21,6 +21,7 @@ 
 #include "defs.h"
 #include "inferior.h"
 #include "target.h"
+#include "gdbarch.h"
 #include "gdbcore.h"
 #include "regcache.h"
 #include "ia64-tdep.h"