9b4b61c8db
* features/Makefile (%.dat): Emit xmltarget statement. * regformats/regdat.sh: Support xmltarget and xmlarch statments. Generate code to set gdbserver_xmltarget in init_registers_${name}. * regformats/arm-with-iwmmxt.dat: Regenerate. * regformats/mips64-linux.dat: Regenerate. * regformats/mips-linux.dat: Regenerate. * regformats/rs6000/powerpc-32.dat: Regenerate. * regformats/rs6000/powerpc-64.dat: Regenerate. * regformats/rs6000/powerpc-e500.dat: Regenerate. * regformats/reg-arm.dat: Add xmlarch statement. * regformats/reg-i386.dat: Likewise. * regformats/reg-i386-linux.dat: Likewise. * regformats/reg-x86-64-linux.dat: Likewise. * regformats/reg-spu.dat: Likewise. gdbserver/ChangeLog: * regcache.h (gdbserver_xmltarget): Add extern declaration. * server.c (gdbserver_xmltarget): Define. (get_features_xml): Use it to replace "target.xml" and arch_string. * configure.srv: Remove srv_xmltarget. Add XML files that were mentioned there to srv_xmlfiles instead. Remove conditional tests on gdb_cv_arm_iwmmxt, gdb_cv_ppc_altivec, gdb_cv_ppc_spe; set srv_xmlfiles and srv_regobj to include all possible choices. * configure.ac (srv_xmltarget): Remove. (srv_xmlfiles): Do not add "target.xml". (gdb_cv_arm_iwmmxt, gdb_cv_ppc_altivec, gdb_cv_ppc_spe): Remove checks for supplementary target information. * configure: Regenerate. * Makefile.in (XML_TARGET): Remove. (target.xml): Remove rule. (clean): Do not clean up target.xml. (.PRECIOUS): Do not mention target.xml. * target.h (struct target_ops): Remove arch_string member. * linux-low.c (linux_arch_string): Remove. (linux_target_ops): Remove arch_string initializer. * linux-low.h (struct linux_target_ops): Remove arch_string member. * linux-i386-low.c (the_low_target): Remove arch_string initializer. * linux-x86-64-low.c (the_low_target): Remove arch_string initializer. * spu-low.c (spu_arch_string): Remove. (spu_target_ops): Remove arch_string initializer. * win32-low.c (win32_arch_string): Remove. (win32_target_ops): Remove arch_string initializer. * win32-low.h (struct win32_target_ops): Remove arch_string member. * win32-arm-low.c (the_low_target): Remove arch_string initializer. * win32-i368-low.c (the_low_target): Remove arch_string initializer.
148 lines
4.6 KiB
C
148 lines
4.6 KiB
C
/* Internal interfaces for the GNU/Linux specific target code for gdbserver.
|
|
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 3 of the License, or
|
|
(at your option) any later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
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, 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 *);
|
|
typedef void (*regset_store_func) (const void *);
|
|
enum regset_type {
|
|
GENERAL_REGS,
|
|
FP_REGS,
|
|
EXTENDED_REGS,
|
|
};
|
|
|
|
struct regset_info
|
|
{
|
|
int get_request, set_request;
|
|
int size;
|
|
enum regset_type type;
|
|
regset_fill_func fill_function;
|
|
regset_store_func store_function;
|
|
};
|
|
extern struct regset_info target_regsets[];
|
|
#endif
|
|
|
|
struct linux_target_ops
|
|
{
|
|
/* Architecture-specific setup. */
|
|
void (*arch_setup) (void);
|
|
|
|
int num_regs;
|
|
int *regmap;
|
|
int (*cannot_fetch_register) (int);
|
|
|
|
/* Returns 0 if we can store the register, 1 if we can not
|
|
store the register, and 2 if failure to store the register
|
|
is acceptable. */
|
|
int (*cannot_store_register) (int);
|
|
CORE_ADDR (*get_pc) (void);
|
|
void (*set_pc) (CORE_ADDR newpc);
|
|
const unsigned char *breakpoint;
|
|
int breakpoint_len;
|
|
CORE_ADDR (*breakpoint_reinsert_addr) (void);
|
|
|
|
|
|
int decr_pc_after_break;
|
|
int (*breakpoint_at) (CORE_ADDR pc);
|
|
|
|
/* Watchpoint related functions. See target.h for comments. */
|
|
int (*insert_watchpoint) (char type, CORE_ADDR addr, int len);
|
|
int (*remove_watchpoint) (char type, CORE_ADDR addr, int len);
|
|
int (*stopped_by_watchpoint) (void);
|
|
CORE_ADDR (*stopped_data_address) (void);
|
|
|
|
/* 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;
|
|
|
|
#define get_process(inf) ((struct process_info *)(inf))
|
|
#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)->lwpid))
|
|
|
|
struct process_info
|
|
{
|
|
struct inferior_list_entry head;
|
|
unsigned long lwpid;
|
|
|
|
/* 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;
|
|
|
|
/* 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. */
|
|
int status_pending_p;
|
|
int status_pending;
|
|
|
|
/* If this flag is set, the pending status is a (GDB-placed) breakpoint. */
|
|
int pending_is_breakpoint;
|
|
CORE_ADDR pending_stop_pc;
|
|
|
|
/* If this is non-zero, it is a breakpoint to be reinserted at our next
|
|
stop (SIGTRAP stops only). */
|
|
CORE_ADDR bp_reinsert;
|
|
|
|
/* If this flag is set, the last continue operation on this process
|
|
was a single-step. */
|
|
int stepping;
|
|
|
|
/* If this is non-zero, it points to a chain of signals which need to
|
|
be delivered to this process. */
|
|
struct pending_signals *pending_signals;
|
|
|
|
/* A link used when resuming. It is initialized from the resume request,
|
|
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);
|
|
|
|
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);
|