aboutsummaryrefslogtreecommitdiff
path: root/gdb/i386-gnu-nat.c
diff options
context:
space:
mode:
authorThomas Schwinge <thomas@codesourcery.com>2019-02-13 12:02:20 +0100
committerThomas Schwinge <thomas@codesourcery.com>2019-02-14 16:02:33 +0100
commitcabb5f067daa9227bf0323cbf64c6065d6e4796f (patch)
tree62f96bd6149e954c4e635588e79d95264199220c /gdb/i386-gnu-nat.c
parentb1041ae0ae8a2f1c51e75b45004686f1956078ed (diff)
downloadbinutils-cabb5f067daa9227bf0323cbf64c6065d6e4796f.zip
binutils-cabb5f067daa9227bf0323cbf64c6065d6e4796f.tar.gz
binutils-cabb5f067daa9227bf0323cbf64c6065d6e4796f.tar.bz2
[gdb, hurd] Work around conflict between Mach's 'thread_info' function, and GDB's 'thread_info' class
In file included from ./nm.h:25:0, from [...]/gdb/defs.h:423, from [...]/gdb/gdb.c:19: [...]/gdb/regcache.h:35:46: warning: 'get_thread_regcache' initialized and declared 'extern' extern struct regcache *get_thread_regcache (thread_info *thread); ^~~~~~~~~~~ [...]/gdb/regcache.h:35:46: error: 'regcache* get_thread_regcache' redeclared as different kind of symbol [...] [...]/gdb/gdbarch.h:1203:69: error: 'thread_info' is not a type extern LONGEST gdbarch_get_syscall_number (struct gdbarch *gdbarch, thread_info *thread); ^~~~~~~~~~~ Fixed with a different (self-contained, more maintainable?) approach compared to what has been done in commit 7aabaf9d4ad52a1df1f551908fbd8cafc5e7597a "Create private_thread_info hierarchy", and commit 75cbc781e371279f4403045be93b07fd8fe7fde5 "gdb: For macOS, s/thread_info/struct thread_info/". We don't want to change all the GDB code to everywhere use 'class thread_info' or 'struct thread_info' instead of plain 'thread_info'. gdb/ * config/i386/nm-i386gnu.h: Don't "#include" any files. * gnu-nat.h (mach_thread_info): New function. * gnu-nat.c (thread_takeover_sc_cmd): Use it.
Diffstat (limited to 'gdb/i386-gnu-nat.c')
-rw-r--r--gdb/i386-gnu-nat.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gdb/i386-gnu-nat.c b/gdb/i386-gnu-nat.c
index ffba941..c23c4bc 100644
--- a/gdb/i386-gnu-nat.c
+++ b/gdb/i386-gnu-nat.c
@@ -17,6 +17,9 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+/* Include this first, to pick up the <mach.h> 'thread_info' diversion. */
+#include "gnu-nat.h"
+
/* Mach/Hurd headers are not yet ready for C++ compilation. */
extern "C"
{
@@ -34,7 +37,6 @@ extern "C"
#include "i386-tdep.h"
-#include "gnu-nat.h"
#include "inf-child.h"
#include "i387-tdep.h"