X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=gdb%2Fgdbarch.sh;h=9474addc5c5b76808df0f5e2e60f57a43e9fc55e;hb=1fe72117e3d535c6edae090668cfaecce2e51a2c;hp=dc8fb088dd71ff83bd1506c4b44a2f9525b237da;hpb=30737ed99f1a8fa9877d114c25f6301b9b0cc915;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh index dc8fb088dd..9474addc5c 100755 --- a/gdb/gdbarch.sh +++ b/gdb/gdbarch.sh @@ -3,7 +3,7 @@ # Architecture commands for GDB, the GNU debugger. # # Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, -# 2008, 2009 Free Software Foundation, Inc. +# 2008, 2009, 2010 Free Software Foundation, Inc. # # This file is part of GDB. # @@ -466,8 +466,8 @@ f:void:value_to_register:struct frame_info *frame, int regnum, struct type *type # (but not the value contents) filled in. f:struct value *:value_from_register:struct type *type, int regnum, struct frame_info *frame:type, regnum, frame::default_value_from_register::0 # -f:CORE_ADDR:pointer_to_address:struct type *type, const gdb_byte *buf:type, buf::unsigned_pointer_to_address::0 -f:void:address_to_pointer:struct type *type, gdb_byte *buf, CORE_ADDR addr:type, buf, addr::unsigned_address_to_pointer::0 +m:CORE_ADDR:pointer_to_address:struct type *type, const gdb_byte *buf:type, buf::unsigned_pointer_to_address::0 +m:void:address_to_pointer:struct type *type, gdb_byte *buf, CORE_ADDR addr:type, buf, addr::unsigned_address_to_pointer::0 M:CORE_ADDR:integer_to_address:struct type *type, const gdb_byte *buf:type, buf # Return the return-value convention that will be used by FUNCTYPE @@ -563,7 +563,7 @@ f:CORE_ADDR:skip_trampoline_code:struct frame_info *frame, CORE_ADDR pc:frame, p # a step-resume breakpoint to get us past the dynamic linker. m:CORE_ADDR:skip_solib_resolver:CORE_ADDR pc:pc::generic_skip_solib_resolver::0 # Some systems also have trampoline code for returning from shared libs. -f:int:in_solib_return_trampoline:CORE_ADDR pc, char *name:pc, name::generic_in_solib_return_trampoline::0 +m:int:in_solib_return_trampoline:CORE_ADDR pc, char *name:pc, name::generic_in_solib_return_trampoline::0 # A target might have problems with watchpoints as soon as the stack # frame of the current function has been destroyed. This mostly happens @@ -575,15 +575,6 @@ f:int:in_solib_return_trampoline:CORE_ADDR pc, char *name:pc, name::generic_in_s # which don't suffer from that problem could just let this functionality # untouched. m:int:in_function_epilogue_p:CORE_ADDR addr:addr:0:generic_in_function_epilogue_p::0 -# Given a vector of command-line arguments, return a newly allocated -# string which, when passed to the create_inferior function, will be -# parsed (on Unix systems, by the shell) to yield the same vector. -# This function should call error() if the argument vector is not -# representable for this target or if this target does not support -# command-line arguments. -# ARGC is the number of elements in the vector. -# ARGV is an array of strings, one per argument. -m:char *:construct_inferior_arguments:int argc, char **argv:argc, argv::construct_inferior_arguments::0 f:void:elf_make_msymbol_special:asymbol *sym, struct minimal_symbol *msym:sym, msym::default_elf_make_msymbol_special::0 f:void:coff_make_msymbol_special:int val, struct minimal_symbol *msym:val, msym::default_coff_make_msymbol_special::0 v:int:cannot_step_breakpoint:::0:0::0 @@ -600,6 +591,13 @@ F:CORE_ADDR:fetch_pointer_argument:struct frame_info *frame, int argi, struct ty # name SECT_NAME and size SECT_SIZE. M:const struct regset *:regset_from_core_section:const char *sect_name, size_t sect_size:sect_name, sect_size +# When creating core dumps, some systems encode the PID in addition +# to the LWP id in core file register section names. In those cases, the +# "XXX" in ".reg/XXX" is encoded as [LWPID << 16 | PID]. This setting +# is set to true for such architectures; false if "XXX" represents an LWP +# or thread id with no special encoding. +v:int:core_reg_section_encodes_pid:::0:0::0 + # Supported register notes in a core file. v:struct core_regset_section *:core_regset_sections:const char *name, int len::::::host_address_to_string (gdbarch->core_regset_sections) @@ -607,6 +605,13 @@ v:struct core_regset_section *:core_regset_sections:const char *name, int len::: # core file into buffer READBUF with length LEN. M:LONGEST:core_xfer_shared_libraries:gdb_byte *readbuf, ULONGEST offset, LONGEST len:readbuf, offset, len +# How the core_stratum layer converts a PTID from a core file to a +# string. +M:char *:core_pid_to_str:ptid_t ptid:ptid + +# BFD target to use when generating a core file. +V:const char *:gcore_bfd_target:::0:0:::gdbarch->gcore_bfd_target + # If the elements of C++ vtables are in-place function descriptors rather # than normal function pointers (which may point to code or a descriptor), # set this to one. @@ -649,6 +654,17 @@ V:ULONGEST:max_insn_length:::0:0 # here. M:struct displaced_step_closure *:displaced_step_copy_insn:CORE_ADDR from, CORE_ADDR to, struct regcache *regs:from, to, regs +# Return true if GDB should use hardware single-stepping to execute +# the displaced instruction identified by CLOSURE. If false, +# GDB will simply restart execution at the displaced instruction +# location, and it is up to the target to ensure GDB will receive +# control again (e.g. by placing a software breakpoint instruction +# into the displaced instruction buffer). +# +# The default implementation returns false on all targets that +# provide a gdbarch_software_single_step routine, and true otherwise. +m:int:displaced_step_hw_singlestep:struct displaced_step_closure *closure:closure::default_displaced_step_hw_singlestep::0 + # Fix up the state resulting from successfully single-stepping a # displaced instruction, to give the result we would have gotten from # stepping the instruction in its original location. @@ -698,6 +714,16 @@ F:char *:static_transform_name:char *name:name # Set if the address in N_SO or N_FUN stabs may be zero. v:int:sofun_address_maybe_missing:::0:0::0 +# Parse the instruction at ADDR storing in the record execution log +# the registers REGCACHE and memory ranges that will be affected when +# the instruction executes, along with their current values. +# Return -1 if something goes wrong, 0 otherwise. +M:int:process_record:struct regcache *regcache, CORE_ADDR addr:regcache, addr + +# Save process state after a signal. +# Return -1 if something goes wrong, 0 otherwise. +M:int:process_record_signal:struct regcache *regcache, enum target_signal signal:regcache, signal + # Signal translation: translate inferior's signal (host's) number into # GDB's representation. m:enum target_signal:target_signal_from_host:int signo:signo::default_target_signal_from_host::0 @@ -705,15 +731,37 @@ m:enum target_signal:target_signal_from_host:int signo:signo::default_target_sig # signal number. m:int:target_signal_to_host:enum target_signal ts:ts::default_target_signal_to_host::0 +# Extra signal info inspection. +# +# Return a type suitable to inspect extra signal information. +M:struct type *:get_siginfo_type:void: + # Record architecture-specific information from the symbol table. M:void:record_special_symbol:struct objfile *objfile, asymbol *sym:objfile, sym +# Function for the 'catch syscall' feature. + +# Get architecture-specific system calls information from registers. +M:LONGEST:get_syscall_number:ptid_t ptid:ptid + # True if the list of shared libraries is one and only for all # processes, as opposed to a list of shared libraries per inferior. -# When this property is true, GDB assumes that since shared libraries -# are shared across processes, so is all code. Hence, GDB further -# assumes an inserted breakpoint location is visible to all processes. +# This usually means that all processes, although may or may not share +# an address space, will see the same set of symbols at the same +# addresses. v:int:has_global_solist:::0:0::0 + +# On some targets, even though each inferior has its own private +# address space, the debug interface takes care of making breakpoints +# visible to all address spaces automatically. For such cases, +# this property should be set to true. +v:int:has_global_breakpoints:::0:0::0 + +# True if inferiors share an address space (e.g., uClinux). +m:int:has_shared_address_space:void:::default_has_shared_address_space::0 + +# True if a fast tracepoint can be set at an address. +m:int:fast_tracepoint_valid_at:CORE_ADDR addr, int *isize, char **msg:addr, isize, msg::default_fast_tracepoint_valid_at::0 EOF } @@ -766,8 +814,8 @@ cat <gdbarch can used to access values from the previously selected architecture for this - architecture family. The global \`\`current_gdbarch'' shall not be - used. + architecture family. The INIT function shall return any of: NULL - indicating that it doesn't recognize the selected architecture; an existing \`\`struct @@ -1052,12 +1112,12 @@ extern int gdbarch_update_p (struct gdbarch_info info); set, and then finished using gdbarch_info_fill. Returns the corresponding architecture, or NULL if no matching - architecture was found. "current_gdbarch" is not updated. */ + architecture was found. */ extern struct gdbarch *gdbarch_find_by_info (struct gdbarch_info info); -/* Helper function. Set the global "current_gdbarch" to "gdbarch". +/* Helper function. Set the global "target_gdbarch" to "gdbarch". FIXME: kettenis/20031124: Of the functions that follow, only gdbarch_from_bfd is supposed to survive. The others will @@ -1065,7 +1125,7 @@ extern struct gdbarch *gdbarch_find_by_info (struct gdbarch_info info); multi-arch. However, for now we're still stuck with the concept of a single active architecture. */ -extern void deprecated_current_gdbarch_select_hack (struct gdbarch *gdbarch); +extern void deprecated_target_gdbarch_select_hack (struct gdbarch *gdbarch); /* Register per-architecture data-pointer. @@ -1287,7 +1347,6 @@ cat < 0) + if (length > 0) internal_error (__FILE__, __LINE__, _("verify_gdbarch: the following are invalid ...%s"), buf); @@ -1869,19 +1928,14 @@ gdbarch_list_lookup_by_info (struct gdbarch_list *arches, /* Find an architecture that matches the specified INFO. Create a new - architecture if needed. Return that new architecture. Assumes - that there is no current architecture. */ + architecture if needed. Return that new architecture. */ -static struct gdbarch * -find_arch_by_info (struct gdbarch_info info) +struct gdbarch * +gdbarch_find_by_info (struct gdbarch_info info) { struct gdbarch *new_gdbarch; struct gdbarch_registration *rego; - /* The existing architecture has been swapped out - all this code - works from a clean slate. */ - gdb_assert (current_gdbarch == NULL); - /* Fill in missing parts of the INFO struct using a number of sources: "set ..."; INFOabfd supplied; and the global defaults. */ @@ -1893,24 +1947,24 @@ find_arch_by_info (struct gdbarch_info info) if (gdbarch_debug) { fprintf_unfiltered (gdb_stdlog, - "find_arch_by_info: info.bfd_arch_info %s\n", + "gdbarch_find_by_info: info.bfd_arch_info %s\n", (info.bfd_arch_info != NULL ? info.bfd_arch_info->printable_name : "(null)")); fprintf_unfiltered (gdb_stdlog, - "find_arch_by_info: info.byte_order %d (%s)\n", + "gdbarch_find_by_info: info.byte_order %d (%s)\n", info.byte_order, (info.byte_order == BFD_ENDIAN_BIG ? "big" : info.byte_order == BFD_ENDIAN_LITTLE ? "little" : "default")); fprintf_unfiltered (gdb_stdlog, - "find_arch_by_info: info.osabi %d (%s)\n", + "gdbarch_find_by_info: info.osabi %d (%s)\n", info.osabi, gdbarch_osabi_name (info.osabi)); fprintf_unfiltered (gdb_stdlog, - "find_arch_by_info: info.abfd %s\n", + "gdbarch_find_by_info: info.abfd %s\n", host_address_to_string (info.abfd)); fprintf_unfiltered (gdb_stdlog, - "find_arch_by_info: info.tdep_info %s\n", + "gdbarch_find_by_info: info.tdep_info %s\n", host_address_to_string (info.tdep_info)); } @@ -1923,7 +1977,7 @@ find_arch_by_info (struct gdbarch_info info) if (rego == NULL) { if (gdbarch_debug) - fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: " + fprintf_unfiltered (gdb_stdlog, "gdbarch_find_by_info: " "No matching architecture\n"); return 0; } @@ -1936,7 +1990,7 @@ find_arch_by_info (struct gdbarch_info info) if (new_gdbarch == NULL) { if (gdbarch_debug) - fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: " + fprintf_unfiltered (gdb_stdlog, "gdbarch_find_by_info: " "Target rejected architecture\n"); return NULL; } @@ -1949,7 +2003,7 @@ find_arch_by_info (struct gdbarch_info info) struct gdbarch_list **list; struct gdbarch_list *this; if (gdbarch_debug) - fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: " + fprintf_unfiltered (gdb_stdlog, "gdbarch_find_by_info: " "Previous architecture %s (%s) selected\n", host_address_to_string (new_gdbarch), new_gdbarch->bfd_arch_info->printable_name); @@ -1971,7 +2025,7 @@ find_arch_by_info (struct gdbarch_info info) /* It's a new architecture. */ if (gdbarch_debug) - fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: " + fprintf_unfiltered (gdb_stdlog, "gdbarch_find_by_info: " "New architecture %s (%s) selected\n", host_address_to_string (new_gdbarch), new_gdbarch->bfd_arch_info->printable_name); @@ -1997,39 +2051,13 @@ find_arch_by_info (struct gdbarch_info info) return new_gdbarch; } -struct gdbarch * -gdbarch_find_by_info (struct gdbarch_info info) -{ - struct gdbarch *new_gdbarch; - - /* Save the previously selected architecture, setting the global to - NULL. This stops things like gdbarch->init() trying to use the - previous architecture's configuration. The previous architecture - may not even be of the same architecture family. The most recent - architecture of the same family is found at the head of the - rego->arches list. */ - struct gdbarch *old_gdbarch = current_gdbarch; - current_gdbarch = NULL; - - /* Find the specified architecture. */ - new_gdbarch = find_arch_by_info (info); - - /* Restore the existing architecture. */ - gdb_assert (current_gdbarch == NULL); - current_gdbarch = old_gdbarch; - - return new_gdbarch; -} - /* Make the specified architecture current. */ void -deprecated_current_gdbarch_select_hack (struct gdbarch *new_gdbarch) +deprecated_target_gdbarch_select_hack (struct gdbarch *new_gdbarch) { gdb_assert (new_gdbarch != NULL); - gdb_assert (current_gdbarch != NULL); gdb_assert (new_gdbarch->initialized_p); - current_gdbarch = new_gdbarch; target_gdbarch = new_gdbarch; observer_notify_architecture_changed (new_gdbarch); registers_changed ();