This is the mail archive of the gdb-patches@sourceware.org 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] Make native SPU target always have a thread


Hello,

it seems all targets now need to always register a thread even for
single-threaded applications.

The patch below fixes the stand-alone SPU native target to do that.

Tested on spu-elf, fixed a couple of MI regressions.
Committed to mainline.

Bye,
Ulrich


ChangeLog:

	* spu-linux-nat.c: Include "gdbthread.h".
	(spu_child_post_startup_inferior): Register main thread.
	(spu_child_post_attach): Likewise.
	* Makefile.in (spu-linux-nat.o): Update dependencies.


Index: gdb/Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/Makefile.in,v
retrieving revision 1.1035
diff -c -p -r1.1035 Makefile.in
*** gdb/Makefile.in	11 Jul 2008 11:07:38 -0000	1.1035
--- gdb/Makefile.in	12 Jul 2008 22:12:05 -0000
*************** sparc-tdep.o: sparc-tdep.c $(defs_h) $(a
*** 2863,2869 ****
  	$(value_h) $(gdb_assert_h) $(gdb_string_h) $(sparc_tdep_h)
  spu-linux-nat.o: spu-linux-nat.c $(defs_h) $(gdbcore_h) $(gdb_string_h) \
  	$(target_h) $(inferior_h) $(inf_ptrace_h) $(regcache_h) $(symfile_h) \
! 	$(gdb_wait_h) $(spu_tdep_h)
  spu-tdep.o: spu-tdep.c $(defs_h) $(arch_utils_h) $(gdbtypes_h) $(gdbcmd_h) \
  	$(gdbcore_h) $(gdb_string_h) $(gdb_assert_h) $(frame_h) \
  	$(frame_unwind_h) $(frame_base_h) $(trad_frame_h) $(symtab_h) \
--- 2863,2869 ----
  	$(value_h) $(gdb_assert_h) $(gdb_string_h) $(sparc_tdep_h)
  spu-linux-nat.o: spu-linux-nat.c $(defs_h) $(gdbcore_h) $(gdb_string_h) \
  	$(target_h) $(inferior_h) $(inf_ptrace_h) $(regcache_h) $(symfile_h) \
! 	$(gdb_wait_h) $(gdbthread_h) $(spu_tdep_h)
  spu-tdep.o: spu-tdep.c $(defs_h) $(arch_utils_h) $(gdbtypes_h) $(gdbcmd_h) \
  	$(gdbcore_h) $(gdb_string_h) $(gdb_assert_h) $(frame_h) \
  	$(frame_unwind_h) $(frame_base_h) $(trad_frame_h) $(symtab_h) \
Index: gdb/spu-linux-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/spu-linux-nat.c,v
retrieving revision 1.12
diff -c -p -r1.12 spu-linux-nat.c
*** gdb/spu-linux-nat.c	26 Jun 2008 15:51:28 -0000	1.12
--- gdb/spu-linux-nat.c	12 Jul 2008 22:12:05 -0000
***************
*** 27,32 ****
--- 27,33 ----
  #include "regcache.h"
  #include "symfile.h"
  #include "gdb_wait.h"
+ #include "gdbthread.h"
  
  #include <sys/ptrace.h>
  #include <asm/ptrace.h>
*************** spu_child_post_startup_inferior (ptid_t 
*** 375,380 ****
--- 376,383 ----
        ptrace (PT_SYSCALL, tid, (PTRACE_TYPE_ARG3) 0, 0);
        waitpid (tid, NULL, __WALL | __WNOTHREAD);
      }
+ 
+   add_thread_silent (ptid);
  }
  
  /* Override the post_attach routine to try load the SPE executable
*************** spu_child_post_attach (int pid)
*** 394,399 ****
--- 397,404 ----
        waitpid (pid, NULL, __WALL | __WNOTHREAD);
      }
  
+   add_thread_silent (inferior_ptid);
+ 
    /* If the user has not provided an executable file, try to extract
       the image from inside the target process.  */
    if (!get_exec_file (0))
-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


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