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]

[RFA] i386 GNU/Linux support for qGetTLSAddr packet


The patch below implements a remote_qGetTLSAddr_load_module_params
method for GNU/Linux (and possibly other operating environments which
use SVR4-like shared libraries).  It uses this implementation to 
instantiate the remote_qGetTLSAddr_load_module_params method for
i386 GNU/Linux.

I'll need approval for the change to i386-linux-tdep.c.

See also:

  http://sources.redhat.com/ml/gdb/2004-11/msg00189.html
  http://sources.redhat.com/ml/gdb-patches/2004-12/msg00168.html
  http://sources.redhat.com/ml/gdb-patches/2004-12/msg00169.html

Okay?

	* solib-svr4.c, solib-svr4.h
	(svr4_nptl_remote_qGetTLSAddr_load_module_params): New function.
	* i386-linux-tdep.c (i386_linux_init_abi): Set
	remote_qGetTLSAddr_load_module_params method.

Index: i386-linux-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i386-linux-tdep.c,v
retrieving revision 1.43
diff -u -p -r1.43 i386-linux-tdep.c
--- i386-linux-tdep.c	9 Nov 2004 14:28:42 -0000	1.43
+++ i386-linux-tdep.c	6 Dec 2004 21:34:15 -0000
@@ -437,6 +437,9 @@ i386_linux_init_abi (struct gdbarch_info
   set_gdbarch_skip_solib_resolver (gdbarch, glibc_skip_solib_resolver);
 
   dwarf2_frame_set_signal_frame_p (gdbarch, i386_linux_dwarf_signal_frame_p);
+
+  set_gdbarch_remote_qGetTLSAddr_load_module_params
+    (gdbarch, svr4_nptl_remote_qGetTLSAddr_load_module_params);
 }
 
 /* Provide a prototype to silence -Wmissing-prototypes.  */
Index: solib-svr4.c
===================================================================
RCS file: /cvs/src/src/gdb/solib-svr4.c,v
retrieving revision 1.44
diff -u -p -r1.44 solib-svr4.c
--- solib-svr4.c	9 Jun 2004 20:03:33 -0000	1.44
+++ solib-svr4.c	6 Dec 2004 21:34:16 -0000
@@ -1443,6 +1443,27 @@ svr4_lp64_fetch_link_map_offsets (void)
   return lmp;
 }
 
+int
+svr4_nptl_remote_qGetTLSAddr_load_module_params (ULONGEST **args_ptr,
+					         int *argcnt_ptr,
+					         struct objfile *objfile)
+{
+  CORE_ADDR lm;
+
+  lm = svr4_fetch_objfile_link_map (objfile);
+
+  if (!lm)
+    return 0;
+  else
+    {
+      static ULONGEST args[1];
+      args[0] = lm;
+      *args_ptr = args;
+      *argcnt_ptr = 1;
+      return 1;
+    }
+}
+
 
 static struct target_so_ops svr4_so_ops;
 
Index: solib-svr4.h
===================================================================
RCS file: /cvs/src/src/gdb/solib-svr4.h,v
retrieving revision 1.8
diff -u -p -r1.8 solib-svr4.h
--- solib-svr4.h	12 Mar 2004 22:01:39 -0000	1.8
+++ solib-svr4.h	6 Dec 2004 21:34:16 -0000
@@ -92,4 +92,8 @@ extern struct link_map_offsets *(*legacy
 extern struct link_map_offsets *svr4_ilp32_fetch_link_map_offsets (void);
 extern struct link_map_offsets *svr4_lp64_fetch_link_map_offsets (void);
 
+/* Return OS/ABI specific parameters needed for qGetTLSAddr packet.  */
+extern int svr4_nptl_remote_qGetTLSAddr_load_module_params
+  (ULONGEST **args_ptr, int *argcnt_ptr, struct objfile *objfile);
+
 #endif /* solib-svr4.h */


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