[v2,2/2] gdb: Add missing #ifdef USE_THREAD_DB to gdbserver
Commit Message
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(+)
Comments
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
@@ -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
@@ -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;