Fix regression revealed by corethreads.exp
authorAntoine Tremblay <antoine.tremblay@ericsson.com>
Thu, 10 Dec 2015 19:43:48 +0000 (14:43 -0500)
committerAntoine Tremblay <antoine.tremblay@ericsson.com>
Thu, 10 Dec 2015 19:43:48 +0000 (14:43 -0500)
This patch fixes a regression introduced by:
https://sourceware.org/ml/gdb-patches/2015-12/msg00192.html

We can't use thread_from_lwp with core files.  As mentioned in a comment,
td_ta_map_lwp2thr uses ps_get_thread_area, but we can't use that
currently on core targets, as it uses ptrace directly.

Use directly record_thread instead.

This fixes :
PASS -> FAIL: gdb.threads/corethreads.exp: thread0 found
PASS -> FAIL: gdb.threads/corethreads.exp: thread1 found

gdb/ChangeLog:

* linux-thread-db.c (find_new_threads_callback): Use record_thread.

gdb/ChangeLog
gdb/linux-thread-db.c

index 65354bff9b8ed76d64ef0b1b864081c0323ba03b..03ae010e86aca02e329536d930ea7bf3b66bb3c2 100644 (file)
@@ -1,3 +1,7 @@
+2015-12-10  Antoine Tremblay  <antoine.tremblay@ericsson.com>
+
+       * linux-thread-db.c (find_new_threads_callback): Use record_thread.
+
 2015-12-10  Antoine Tremblay  <antoine.tremblay@ericsson.com>
 
        * breakpoint.c (remove_thread_event_breakpoints): Remove.
index 8a80ca3168bcd9d4f79013f897708f06d2e2fab9..4e51c7480376fc27728326b8e0e1c683def1f18d 100644 (file)
@@ -1226,7 +1226,7 @@ find_new_threads_callback (const td_thrhandle_t *th_p, void *data)
   ptid = ptid_build (info->pid, ti.ti_lid, 0);
   tp = find_thread_ptid (ptid);
   if (tp == NULL || tp->priv == NULL)
-    thread_from_lwp (ptid);
+    record_thread (info, tp, ptid, th_p, &ti);
 
   return 0;
 }
This page took 0.029797 seconds and 4 git commands to generate.