This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[commit] Correct a search for lwp id


I was previously searching the threads list for an LWP id, instead of the
processes list.  The threads list is initially indexed by PID, but when we
enable thread-db we convert it to indexed by TID instead; after that point,
ps_lgetregs didn't work.

Tested on i686-pc-linux-gnu (which does exercise ps_lgetregs) and committed.

-- 
Daniel Jacobowitz
CodeSourcery, LLC

2005-05-04  Daniel Jacobowitz  <dan@codesourcery.com>

	* proc-service.c (ps_lgetregs): Search all_processes instead of
	all_threads.

Index: gdb/gdbserver/proc-service.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/proc-service.c,v
retrieving revision 1.2
diff -u -p -r1.2 proc-service.c
--- gdb/gdbserver/proc-service.c	16 Oct 2004 17:42:00 -0000	1.2
+++ gdb/gdbserver/proc-service.c	4 May 2005 19:09:38 -0000
@@ -1,5 +1,5 @@
 /* libthread_db helper functions for the remote server for GDB.
-   Copyright 2002, 2004
+   Copyright 2002, 2004, 2005
    Free Software Foundation, Inc.
 
    Contributed by MontaVista Software.
@@ -113,13 +113,15 @@ ps_err_e
 ps_lgetregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, prgregset_t gregset)
 {
 #ifdef HAVE_REGSETS
+  struct process_info *process;
   struct thread_info *reg_inferior, *save_inferior;
 
-  reg_inferior = (struct thread_info *) find_inferior_id (&all_threads,
-							  lwpid);
-  if (reg_inferior == NULL)
+  process = (struct process_info *) find_inferior_id (&all_processes,
+						      lwpid);
+  if (process == NULL)
     return PS_ERR;
 
+  reg_inferior = get_process_thread (process);
   save_inferior = current_inferior;
   current_inferior = reg_inferior;
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]