You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
1.8 KiB

# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../musl/pkg/gdb/gdb-76-linux-low-threaddb.patch
# Copyright (C) 2014 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
This is a patch from sabotage-linux
https://github.com/sabotage-linux/sabotage/blob/master/KEEP/gdb-76-linux-low-threaddb.patch
this patch fixes compilation of gdbserver on systems that don't have
thread_db.h. in that case we fall back to gdb's own copy
"gdb_thread_db.h", so the typedef of the td_thrhandle_t member is
available, which is accessed in other parts of the code without
checking whether thread_db.h is available.
this is by far the cleaner solution, removing the accesses to the
th member in other parts of the source would either litter it with
ifdefs or cripple the functionality.
--- gdb-7.6.2.org/gdb/gdbserver/linux-low.h
+++ gdb-7.6.2/gdb/gdbserver/linux-low.h
@@ -18,6 +18,8 @@
#ifdef HAVE_THREAD_DB_H
#include <thread_db.h>
+#else
+#include "gdb_thread_db.h"
#endif
#include <signal.h>
@@ -270,11 +272,9 @@
int need_step_over;
int thread_known;
-#ifdef HAVE_THREAD_DB_H
/* The thread handle, used for e.g. TLS access. Only valid if
THREAD_KNOWN is set. */
td_thrhandle_t th;
-#endif
/* Arch-specific additions. */
struct arch_lwp_info *arch_private;