* [PATCH v2 1/2] gdb: Fix ia64 defining TRAP_HWBKPT before including gdb_wait.h
@ 2018-01-19 17:23 James Clarke
2018-01-19 17:23 ` [PATCH v2 2/2] gdb: Add missing #ifdef USE_THREAD_DB to gdbserver James Clarke
0 siblings, 1 reply; 4+ messages in thread
From: James Clarke @ 2018-01-19 17:23 UTC (permalink / raw)
To: gdb-patches; +Cc: James Clarke
On ia64, gdb_wait.h eventually includes siginfo-consts-arch.h, which
contains an enum with TRAP_HWBKPT, along with a #define. Thus we cannot
define TRAP_HWBKPT to 4 beforehand, and so gdb_wait.h must be included
earlier; include it from linux-ptrace.h so it can never come afterwards.
gdb/ChangeLog:
* nat/linux-ptrace.c: Remove unnecessary reinclusion of
gdb_ptrace.h, and move including gdb_wait.h ...
* nat/linux-ptrace.h: ... to here.
---
Changes since v2:
* Added undefined reference linker error to commit message for patch
2/2.
Please commit+push on my behalf if this series is approved.
Thanks,
James
gdb/nat/linux-ptrace.c | 2 --
gdb/nat/linux-ptrace.h | 1 +
2 files changed, 1 insertion(+), 2 deletions(-)
diff --git a/gdb/nat/linux-ptrace.c b/gdb/nat/linux-ptrace.c
index 438177f..1240eea 100644
--- a/gdb/nat/linux-ptrace.c
+++ b/gdb/nat/linux-ptrace.c
@@ -21,8 +21,6 @@
#include "linux-procfs.h"
#include "linux-waitpid.h"
#include "buffer.h"
-#include "gdb_wait.h"
-#include "gdb_ptrace.h"
#ifdef HAVE_SYS_PROCFS_H
#include <sys/procfs.h>
#endif
diff --git a/gdb/nat/linux-ptrace.h b/gdb/nat/linux-ptrace.h
index 5954945..6faa89b 100644
--- a/gdb/nat/linux-ptrace.h
+++ b/gdb/nat/linux-ptrace.h
@@ -21,6 +21,7 @@
struct buffer;
#include "nat/gdb_ptrace.h"
+#include "gdb_wait.h"
#ifdef __UCLIBC__
#if !(defined(__UCLIBC_HAS_MMU__) || defined(__ARCH_HAS_MMU__))
--
1.8.5.3
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v2 2/2] gdb: Add missing #ifdef USE_THREAD_DB to gdbserver
2018-01-19 17:23 [PATCH v2 1/2] gdb: Fix ia64 defining TRAP_HWBKPT before including gdb_wait.h James Clarke
@ 2018-01-19 17:23 ` James Clarke
2018-01-19 18:39 ` Pedro Alves
0 siblings, 1 reply; 4+ messages in thread
From: James Clarke @ 2018-01-19 17:23 UTC (permalink / raw)
To: gdb-patches; +Cc: James Clarke
gdb/ChangeLog:
* gdbserver/linux-low.c (handle_extended_wait): Surround call to
thread_db_notice_clone with #ifdef USE_THREAD_DB, otherwise
linking fails with "undefined reference to
`thread_db_notice_clone(thread_info*, ptid_t)'" on architectures
without thread_db.
---
gdb/gdbserver/linux-low.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
index f6a52d5..398cd70 100644
--- a/gdb/gdbserver/linux-low.c
+++ b/gdb/gdbserver/linux-low.c
@@ -661,7 +661,9 @@ handle_extended_wait (struct lwp_info **orig_event_lwp, int wstat)
new_lwp->status_pending = status;
}
+#ifdef USE_THREAD_DB
thread_db_notice_clone (event_thr, ptid);
+#endif
/* Don't report the event. */
return 1;
--
1.8.5.3
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2 2/2] gdb: Add missing #ifdef USE_THREAD_DB to gdbserver
2018-01-19 17:23 ` [PATCH v2 2/2] gdb: Add missing #ifdef USE_THREAD_DB to gdbserver James Clarke
@ 2018-01-19 18:39 ` Pedro Alves
2018-01-19 22:35 ` James Clarke
0 siblings, 1 reply; 4+ messages in thread
From: Pedro Alves @ 2018-01-19 18:39 UTC (permalink / raw)
To: James Clarke, gdb-patches
On 01/19/2018 05:22 PM, James Clarke wrote:
> gdb/ChangeLog:
> * gdbserver/linux-low.c (handle_extended_wait): Surround call to
> thread_db_notice_clone with #ifdef USE_THREAD_DB, otherwise
> linking fails with "undefined reference to
> `thread_db_notice_clone(thread_info*, ptid_t)'" on architectures
> without thread_db.
Note, we put the "why" info on the git commit log, not in the ChangeLog.
Also, gdb/ChangeLog -> gdb/gdbserver/ChangeLog.
I've amended those nits and pushed both patches in.
AFAICT, you have a copyright assignment on file for other projects,
but not for GDB. The patches are small enough for that to not be
an issue, but if you're planning on contributing more, it'll be
good to take care of that.
Thanks!
Pedro Alves
From a0aad53764f45a634462288befe4c2eaecbf302d Mon Sep 17 00:00:00 2001
From: James Clarke <jrtc27@jrtc27.com>
Date: Fri, 19 Jan 2018 17:22:50 +0000
Subject: [PATCH] gdb: Add missing #ifdef USE_THREAD_DB to gdbserver
Otherwise, linking fails with:
[...]/linux-low.c:664: undefined reference to `thread_db_notice_clone(thread_info*, ptid_t)'
gdb/gdbserver/ChangeLog:
* linux-low.c (handle_extended_wait): Surround call to
thread_db_notice_clone with #ifdef USE_THREAD_DB.
---
gdb/gdbserver/ChangeLog | 5 +++++
gdb/gdbserver/linux-low.c | 2 ++
2 files changed, 7 insertions(+)
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index f1836559539..877b6e6226a 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,3 +1,8 @@
+2018-01-19 James Clarke <jrtc27@jrtc27.com>
+
+ * linux-low.c (handle_extended_wait): Surround call to
+ thread_db_notice_clone with #ifdef USE_THREAD_DB.
+
2018-01-17 Simon Marchi <simon.marchi@ericsson.com>
* linux-low.c (attach_proc_task_lwp_callback): Adjust to
diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
index 8117fc6ca8b..38142bba03d 100644
--- a/gdb/gdbserver/linux-low.c
+++ b/gdb/gdbserver/linux-low.c
@@ -661,7 +661,9 @@ handle_extended_wait (struct lwp_info **orig_event_lwp, int wstat)
new_lwp->status_pending = status;
}
+#ifdef USE_THREAD_DB
thread_db_notice_clone (event_thr, ptid);
+#endif
/* Don't report the event. */
return 1;
--
2.14.3
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2 2/2] gdb: Add missing #ifdef USE_THREAD_DB to gdbserver
2018-01-19 18:39 ` Pedro Alves
@ 2018-01-19 22:35 ` James Clarke
0 siblings, 0 replies; 4+ messages in thread
From: James Clarke @ 2018-01-19 22:35 UTC (permalink / raw)
To: Pedro Alves; +Cc: gdb-patches
On 19 Jan 2018, at 18:39, Pedro Alves <palves@redhat.com> wrote:
> On 01/19/2018 05:22 PM, James Clarke wrote:
>> gdb/ChangeLog:
>> * gdbserver/linux-low.c (handle_extended_wait): Surround call to
>> thread_db_notice_clone with #ifdef USE_THREAD_DB, otherwise
>> linking fails with "undefined reference to
>> `thread_db_notice_clone(thread_info*, ptid_t)'" on architectures
>> without thread_db.
>
> Note, we put the "why" info on the git commit log, not in the ChangeLog.
Ah, I think in the past I've ended up following that by chance, but it's useful
to know that as a rule.
> Also, gdb/ChangeLog -> gdb/gdbserver/ChangeLog.
Right, I should have noticed the extra ChangeLog file.
> I've amended those nits and pushed both patches in.
Thanks!
> AFAICT, you have a copyright assignment on file for other projects,
> but not for GDB. The patches are small enough for that to not be
> an issue, but if you're planning on contributing more, it'll be
> good to take care of that.
Yeah, sure, I hope that I don't need to make any future fixes but who knows.
Thanks,
James
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-01-19 22:35 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-19 17:23 [PATCH v2 1/2] gdb: Fix ia64 defining TRAP_HWBKPT before including gdb_wait.h James Clarke
2018-01-19 17:23 ` [PATCH v2 2/2] gdb: Add missing #ifdef USE_THREAD_DB to gdbserver James Clarke
2018-01-19 18:39 ` Pedro Alves
2018-01-19 22:35 ` James Clarke
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox