* gdbarch.sh: Document the return_value method. Explain that
[deliverable/binutils-gdb.git] / gdb / gdbserver / linux-low.h
index 516b40d871782503ddda5207aad750a112e9ce04..78734e76b6973aac3fa0440f8da53d4bc61854a0 100644 (file)
@@ -1,11 +1,11 @@
 /* Internal interfaces for the GNU/Linux specific target code for gdbserver.
-   Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street, Fifth Floor,
-   Boston, MA 02110-1301, USA.  */
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+#ifdef HAVE_THREAD_DB_H
+#include <thread_db.h>
+#endif
 
 #ifdef HAVE_LINUX_REGSETS
 typedef void (*regset_fill_func) (void *);
@@ -40,6 +42,9 @@ extern struct regset_info target_regsets[];
 
 struct linux_target_ops
 {
+  /* Architecture-specific setup.  */
+  void (*arch_setup) (void);
+
   int num_regs;
   int *regmap;
   int (*cannot_fetch_register) (int);
@@ -64,9 +69,10 @@ struct linux_target_ops
   int (*stopped_by_watchpoint) (void);
   CORE_ADDR (*stopped_data_address) (void);
 
-  /* Whether to left-pad registers for PEEKUSR/POKEUSR if they are smaller
-     than an xfer unit.  */
-  int left_pad_xfer;
+  /* Hooks to reformat register data for PEEKUSR/POKEUSR (in particular
+     for registers smaller than an xfer unit).  */
+  void (*collect_ptrace_register) (int regno, char *buf);
+  void (*supply_ptrace_register) (int regno, const char *buf);
 };
 
 extern struct linux_target_ops the_low_target;
@@ -75,26 +81,27 @@ extern struct linux_target_ops the_low_target;
 #define get_thread_process(thr) (get_process (inferior_target_data (thr)))
 #define get_process_thread(proc) ((struct thread_info *) \
                                  find_inferior_id (&all_threads, \
-                                 get_process (proc)->tid))
+                                 get_process (proc)->lwpid))
 
 struct process_info
 {
   struct inferior_list_entry head;
-  int thread_known;
   unsigned long lwpid;
-  unsigned long tid;
 
-  /* If this flag is set, the next SIGSTOP will be ignored (the process will
-     be immediately resumed).  */
+  /* If this flag is set, the next SIGSTOP will be ignored (the
+     process will be immediately resumed).  This means that either we
+     sent the SIGSTOP to it ourselves and got some other pending event
+     (so the SIGSTOP is still pending), or that we stopped the
+     inferior implicitly via PTRACE_ATTACH and have not waited for it
+     yet.  */
   int stop_expected;
 
   /* If this flag is set, the process is known to be stopped right now (stop
      event already received in a wait()).  */
   int stopped;
 
-  /* If this flag is set, we have sent a SIGSTOP to this process and are
-     waiting for it to stop.  */
-  int sigstop_sent;
+  /* When stopped is set, the last wait status recorded for this process.  */
+  int last_status;
 
   /* If this flag is set, STATUS_PENDING is a waitstatus that has not yet
      been reported.  */
@@ -121,10 +128,20 @@ struct process_info
      and then processed and cleared in linux_resume_one_process.  */
 
   struct thread_resume *resume;
+
+  int thread_known;
+  unsigned long tid;
+#ifdef HAVE_THREAD_DB_H
+  /* The thread handle, used for e.g. TLS access.  Only valid if
+     THREAD_KNOWN is set.  */
+  td_thrhandle_t th;
+#endif
 };
 
 extern struct inferior_list all_processes;
 
-void linux_attach_lwp (unsigned long pid, unsigned long tid);
+void linux_attach_lwp (unsigned long pid);
 
-int thread_db_init (void);
+int thread_db_init (int use_events);
+int thread_db_get_tls_address (struct thread_info *thread, CORE_ADDR offset,
+                              CORE_ADDR load_module, CORE_ADDR *address);
This page took 0.03031 seconds and 4 git commands to generate.