* [patch] SYS_gettid
@ 2011-12-13 2:34 Yao Qi
2011-12-14 17:45 ` Pedro Alves
0 siblings, 1 reply; 3+ messages in thread
From: Yao Qi @ 2011-12-13 2:34 UTC (permalink / raw)
To: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 489 bytes --]
This patch does two things
1) include <sys/syscall.h> in which SYS_gettid is defined, otherwise
helper_thread_id has no change to set, and in-proc-agent will go to
endless loop (in tracepoint.c:gdb_ust_init).
2) remove preprocessor conditional. If SYS_gettid is not defined,
compiler can emit an error, which is better than leaving
helper_thread_id unset and get an error at runtime.
With this patch, program doesn't hang there at start up. OK for mainline?
--
Yao (é½å°§)
[-- Attachment #2: 0001-include-syscall.h.patch --]
[-- Type: text/x-patch, Size: 807 bytes --]
gdb/gdbserver/
2011-12-12 Yao Qi <yao@codesourcery.com>
* tracepoint.c: Include sys/syscall.h.
(gdb_ust_thread): Remove preprocessor conditional.
---
gdb/gdbserver/tracepoint.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/gdb/gdbserver/tracepoint.c b/gdb/gdbserver/tracepoint.c
index 585f18d..c595cb5 100644
--- a/gdb/gdbserver/tracepoint.c
+++ b/gdb/gdbserver/tracepoint.c
@@ -8028,6 +8028,8 @@ cmd_qtstmat (char *packet)
return -1;
}
+#include <sys/syscall.h>
+
static void *
gdb_ust_thread (void *arg)
{
@@ -8037,10 +8039,8 @@ gdb_ust_thread (void *arg)
{
listen_fd = gdb_ust_socket_init ();
-#ifdef SYS_gettid
if (helper_thread_id == 0)
helper_thread_id = syscall (SYS_gettid);
-#endif
if (listen_fd == -1)
{
--
1.7.0.4
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [patch] SYS_gettid
2011-12-13 2:34 [patch] SYS_gettid Yao Qi
@ 2011-12-14 17:45 ` Pedro Alves
2011-12-15 14:59 ` [committed]: " Yao Qi
0 siblings, 1 reply; 3+ messages in thread
From: Pedro Alves @ 2011-12-14 17:45 UTC (permalink / raw)
To: gdb-patches; +Cc: Yao Qi
On Tuesday 13 December 2011 02:12:36, Yao Qi wrote:
> This patch does two things
> 1) include <sys/syscall.h> in which SYS_gettid is defined, otherwise
> helper_thread_id has no change to set, and in-proc-agent will go to
> endless loop (in tracepoint.c:gdb_ust_init).
> 2) remove preprocessor conditional. If SYS_gettid is not defined,
> compiler can emit an error, which is better than leaving
> helper_thread_id unset and get an error at runtime.
>
> With this patch, program doesn't hang there at start up. OK for mainline?
This is the only little platform specific bit I left in
tracepoint.c, and lo, it breaks. :-)
Okay.
--
Pedro Alves
^ permalink raw reply [flat|nested] 3+ messages in thread
* [committed]: [patch] SYS_gettid
2011-12-14 17:45 ` Pedro Alves
@ 2011-12-15 14:59 ` Yao Qi
0 siblings, 0 replies; 3+ messages in thread
From: Yao Qi @ 2011-12-15 14:59 UTC (permalink / raw)
To: gdb-patches
On 12/15/2011 01:42 AM, Pedro Alves wrote:
> This is the only little platform specific bit I left in
> tracepoint.c, and lo, it breaks. :-)
>
> Okay.
Committed.
http://sourceware.org/ml/gdb-cvs/2011-12/msg00141.html
--
Yao (é½å°§)
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-12-15 12:45 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-13 2:34 [patch] SYS_gettid Yao Qi
2011-12-14 17:45 ` Pedro Alves
2011-12-15 14:59 ` [committed]: " Yao Qi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).