GDB (API)
/home/stan/gdb/src/gdb/gdbarch.h
Go to the documentation of this file.
00001 /* *INDENT-OFF* */ /* THIS FILE IS GENERATED -*- buffer-read-only: t -*- */
00002 /* vi:set ro: */
00003 
00004 /* Dynamic architecture support for GDB, the GNU debugger.
00005 
00006    Copyright (C) 1998-2013 Free Software Foundation, Inc.
00007 
00008    This file is part of GDB.
00009 
00010    This program is free software; you can redistribute it and/or modify
00011    it under the terms of the GNU General Public License as published by
00012    the Free Software Foundation; either version 3 of the License, or
00013    (at your option) any later version.
00014   
00015    This program is distributed in the hope that it will be useful,
00016    but WITHOUT ANY WARRANTY; without even the implied warranty of
00017    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018    GNU General Public License for more details.
00019   
00020    You should have received a copy of the GNU General Public License
00021    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
00022 
00023 /* This file was created with the aid of ``gdbarch.sh''.
00024 
00025    The Bourne shell script ``gdbarch.sh'' creates the files
00026    ``new-gdbarch.c'' and ``new-gdbarch.h and then compares them
00027    against the existing ``gdbarch.[hc]''.  Any differences found
00028    being reported.
00029 
00030    If editing this file, please also run gdbarch.sh and merge any
00031    changes into that script. Conversely, when making sweeping changes
00032    to this file, modifying gdbarch.sh and using its output may prove
00033    easier.  */
00034 
00035 #ifndef GDBARCH_H
00036 #define GDBARCH_H
00037 
00038 struct floatformat;
00039 struct ui_file;
00040 struct frame_info;
00041 struct value;
00042 struct objfile;
00043 struct obj_section;
00044 struct minimal_symbol;
00045 struct regcache;
00046 struct reggroup;
00047 struct regset;
00048 struct disassemble_info;
00049 struct target_ops;
00050 struct obstack;
00051 struct bp_target_info;
00052 struct target_desc;
00053 struct displaced_step_closure;
00054 struct core_regset_section;
00055 struct syscall;
00056 struct agent_expr;
00057 struct axs_value;
00058 struct stap_parse_info;
00059 struct ravenscar_arch_ops;
00060 struct elf_internal_linux_prpsinfo;
00061 
00062 /* The architecture associated with the inferior through the
00063    connection to the target.
00064 
00065    The architecture vector provides some information that is really a
00066    property of the inferior, accessed through a particular target:
00067    ptrace operations; the layout of certain RSP packets; the solib_ops
00068    vector; etc.  To differentiate architecture accesses to
00069    per-inferior/target properties from
00070    per-thread/per-frame/per-objfile properties, accesses to
00071    per-inferior/target properties should be made through this
00072    gdbarch.  */
00073 
00074 /* This is a convenience wrapper for 'current_inferior ()->gdbarch'.  */
00075 extern struct gdbarch *target_gdbarch (void);
00076 
00077 /* The initial, default architecture.  It uses host values (for want of a better
00078    choice).  */
00079 extern struct gdbarch startup_gdbarch;
00080 
00081 
00082 /* Callback type for the 'iterate_over_objfiles_in_search_order'
00083    gdbarch  method.  */
00084 
00085 typedef int (iterate_over_objfiles_in_search_order_cb_ftype)
00086   (struct objfile *objfile, void *cb_data);
00087 
00088 
00089 /* The following are pre-initialized by GDBARCH.  */
00090 
00091 extern const struct bfd_arch_info * gdbarch_bfd_arch_info (struct gdbarch *gdbarch);
00092 /* set_gdbarch_bfd_arch_info() - not applicable - pre-initialized.  */
00093 
00094 extern int gdbarch_byte_order (struct gdbarch *gdbarch);
00095 /* set_gdbarch_byte_order() - not applicable - pre-initialized.  */
00096 
00097 extern int gdbarch_byte_order_for_code (struct gdbarch *gdbarch);
00098 /* set_gdbarch_byte_order_for_code() - not applicable - pre-initialized.  */
00099 
00100 extern enum gdb_osabi gdbarch_osabi (struct gdbarch *gdbarch);
00101 /* set_gdbarch_osabi() - not applicable - pre-initialized.  */
00102 
00103 extern const struct target_desc * gdbarch_target_desc (struct gdbarch *gdbarch);
00104 /* set_gdbarch_target_desc() - not applicable - pre-initialized.  */
00105 
00106 
00107 /* The following are initialized by the target dependent code.  */
00108 
00109 /* The bit byte-order has to do just with numbering of bits in debugging symbols
00110    and such.  Conceptually, it's quite separate from byte/word byte order. */
00111 
00112 extern int gdbarch_bits_big_endian (struct gdbarch *gdbarch);
00113 extern void set_gdbarch_bits_big_endian (struct gdbarch *gdbarch, int bits_big_endian);
00114 
00115 /* Number of bits in a char or unsigned char for the target machine.
00116    Just like CHAR_BIT in <limits.h> but describes the target machine.
00117    v:TARGET_CHAR_BIT:int:char_bit::::8 * sizeof (char):8::0:
00118   
00119    Number of bits in a short or unsigned short for the target machine. */
00120 
00121 extern int gdbarch_short_bit (struct gdbarch *gdbarch);
00122 extern void set_gdbarch_short_bit (struct gdbarch *gdbarch, int short_bit);
00123 
00124 /* Number of bits in an int or unsigned int for the target machine. */
00125 
00126 extern int gdbarch_int_bit (struct gdbarch *gdbarch);
00127 extern void set_gdbarch_int_bit (struct gdbarch *gdbarch, int int_bit);
00128 
00129 /* Number of bits in a long or unsigned long for the target machine. */
00130 
00131 extern int gdbarch_long_bit (struct gdbarch *gdbarch);
00132 extern void set_gdbarch_long_bit (struct gdbarch *gdbarch, int long_bit);
00133 
00134 /* Number of bits in a long long or unsigned long long for the target
00135    machine. */
00136 
00137 extern int gdbarch_long_long_bit (struct gdbarch *gdbarch);
00138 extern void set_gdbarch_long_long_bit (struct gdbarch *gdbarch, int long_long_bit);
00139 
00140 /* Alignment of a long long or unsigned long long for the target
00141    machine. */
00142 
00143 extern int gdbarch_long_long_align_bit (struct gdbarch *gdbarch);
00144 extern void set_gdbarch_long_long_align_bit (struct gdbarch *gdbarch, int long_long_align_bit);
00145 
00146 /* The ABI default bit-size and format for "half", "float", "double", and
00147    "long double".  These bit/format pairs should eventually be combined
00148    into a single object.  For the moment, just initialize them as a pair.
00149    Each format describes both the big and little endian layouts (if
00150    useful). */
00151 
00152 extern int gdbarch_half_bit (struct gdbarch *gdbarch);
00153 extern void set_gdbarch_half_bit (struct gdbarch *gdbarch, int half_bit);
00154 
00155 extern const struct floatformat ** gdbarch_half_format (struct gdbarch *gdbarch);
00156 extern void set_gdbarch_half_format (struct gdbarch *gdbarch, const struct floatformat ** half_format);
00157 
00158 extern int gdbarch_float_bit (struct gdbarch *gdbarch);
00159 extern void set_gdbarch_float_bit (struct gdbarch *gdbarch, int float_bit);
00160 
00161 extern const struct floatformat ** gdbarch_float_format (struct gdbarch *gdbarch);
00162 extern void set_gdbarch_float_format (struct gdbarch *gdbarch, const struct floatformat ** float_format);
00163 
00164 extern int gdbarch_double_bit (struct gdbarch *gdbarch);
00165 extern void set_gdbarch_double_bit (struct gdbarch *gdbarch, int double_bit);
00166 
00167 extern const struct floatformat ** gdbarch_double_format (struct gdbarch *gdbarch);
00168 extern void set_gdbarch_double_format (struct gdbarch *gdbarch, const struct floatformat ** double_format);
00169 
00170 extern int gdbarch_long_double_bit (struct gdbarch *gdbarch);
00171 extern void set_gdbarch_long_double_bit (struct gdbarch *gdbarch, int long_double_bit);
00172 
00173 extern const struct floatformat ** gdbarch_long_double_format (struct gdbarch *gdbarch);
00174 extern void set_gdbarch_long_double_format (struct gdbarch *gdbarch, const struct floatformat ** long_double_format);
00175 
00176 /* For most targets, a pointer on the target and its representation as an
00177    address in GDB have the same size and "look the same".  For such a
00178    target, you need only set gdbarch_ptr_bit and gdbarch_addr_bit
00179    / addr_bit will be set from it.
00180   
00181    If gdbarch_ptr_bit and gdbarch_addr_bit are different, you'll probably
00182    also need to set gdbarch_dwarf2_addr_size, gdbarch_pointer_to_address and
00183    gdbarch_address_to_pointer as well.
00184   
00185    ptr_bit is the size of a pointer on the target */
00186 
00187 extern int gdbarch_ptr_bit (struct gdbarch *gdbarch);
00188 extern void set_gdbarch_ptr_bit (struct gdbarch *gdbarch, int ptr_bit);
00189 
00190 /* addr_bit is the size of a target address as represented in gdb */
00191 
00192 extern int gdbarch_addr_bit (struct gdbarch *gdbarch);
00193 extern void set_gdbarch_addr_bit (struct gdbarch *gdbarch, int addr_bit);
00194 
00195 /* dwarf2_addr_size is the target address size as used in the Dwarf debug
00196    info.  For .debug_frame FDEs, this is supposed to be the target address
00197    size from the associated CU header, and which is equivalent to the
00198    DWARF2_ADDR_SIZE as defined by the target specific GCC back-end.
00199    Unfortunately there is no good way to determine this value.  Therefore
00200    dwarf2_addr_size simply defaults to the target pointer size.
00201   
00202    dwarf2_addr_size is not used for .eh_frame FDEs, which are generally
00203    defined using the target's pointer size so far.
00204   
00205    Note that dwarf2_addr_size only needs to be redefined by a target if the
00206    GCC back-end defines a DWARF2_ADDR_SIZE other than the target pointer size,
00207    and if Dwarf versions < 4 need to be supported. */
00208 
00209 extern int gdbarch_dwarf2_addr_size (struct gdbarch *gdbarch);
00210 extern void set_gdbarch_dwarf2_addr_size (struct gdbarch *gdbarch, int dwarf2_addr_size);
00211 
00212 /* One if `char' acts like `signed char', zero if `unsigned char'. */
00213 
00214 extern int gdbarch_char_signed (struct gdbarch *gdbarch);
00215 extern void set_gdbarch_char_signed (struct gdbarch *gdbarch, int char_signed);
00216 
00217 extern int gdbarch_read_pc_p (struct gdbarch *gdbarch);
00218 
00219 typedef CORE_ADDR (gdbarch_read_pc_ftype) (struct regcache *regcache);
00220 extern CORE_ADDR gdbarch_read_pc (struct gdbarch *gdbarch, struct regcache *regcache);
00221 extern void set_gdbarch_read_pc (struct gdbarch *gdbarch, gdbarch_read_pc_ftype *read_pc);
00222 
00223 extern int gdbarch_write_pc_p (struct gdbarch *gdbarch);
00224 
00225 typedef void (gdbarch_write_pc_ftype) (struct regcache *regcache, CORE_ADDR val);
00226 extern void gdbarch_write_pc (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR val);
00227 extern void set_gdbarch_write_pc (struct gdbarch *gdbarch, gdbarch_write_pc_ftype *write_pc);
00228 
00229 /* Function for getting target's idea of a frame pointer.  FIXME: GDB's
00230    whole scheme for dealing with "frames" and "frame pointers" needs a
00231    serious shakedown. */
00232 
00233 typedef void (gdbarch_virtual_frame_pointer_ftype) (struct gdbarch *gdbarch, CORE_ADDR pc, int *frame_regnum, LONGEST *frame_offset);
00234 extern void gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch, CORE_ADDR pc, int *frame_regnum, LONGEST *frame_offset);
00235 extern void set_gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch, gdbarch_virtual_frame_pointer_ftype *virtual_frame_pointer);
00236 
00237 extern int gdbarch_pseudo_register_read_p (struct gdbarch *gdbarch);
00238 
00239 typedef enum register_status (gdbarch_pseudo_register_read_ftype) (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, gdb_byte *buf);
00240 extern enum register_status gdbarch_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, gdb_byte *buf);
00241 extern void set_gdbarch_pseudo_register_read (struct gdbarch *gdbarch, gdbarch_pseudo_register_read_ftype *pseudo_register_read);
00242 
00243 /* Read a register into a new struct value.  If the register is wholly
00244    or partly unavailable, this should call mark_value_bytes_unavailable
00245    as appropriate.  If this is defined, then pseudo_register_read will
00246    never be called. */
00247 
00248 extern int gdbarch_pseudo_register_read_value_p (struct gdbarch *gdbarch);
00249 
00250 typedef struct value * (gdbarch_pseudo_register_read_value_ftype) (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum);
00251 extern struct value * gdbarch_pseudo_register_read_value (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum);
00252 extern void set_gdbarch_pseudo_register_read_value (struct gdbarch *gdbarch, gdbarch_pseudo_register_read_value_ftype *pseudo_register_read_value);
00253 
00254 extern int gdbarch_pseudo_register_write_p (struct gdbarch *gdbarch);
00255 
00256 typedef void (gdbarch_pseudo_register_write_ftype) (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, const gdb_byte *buf);
00257 extern void gdbarch_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, const gdb_byte *buf);
00258 extern void set_gdbarch_pseudo_register_write (struct gdbarch *gdbarch, gdbarch_pseudo_register_write_ftype *pseudo_register_write);
00259 
00260 extern int gdbarch_num_regs (struct gdbarch *gdbarch);
00261 extern void set_gdbarch_num_regs (struct gdbarch *gdbarch, int num_regs);
00262 
00263 /* This macro gives the number of pseudo-registers that live in the
00264    register namespace but do not get fetched or stored on the target.
00265    These pseudo-registers may be aliases for other registers,
00266    combinations of other registers, or they may be computed by GDB. */
00267 
00268 extern int gdbarch_num_pseudo_regs (struct gdbarch *gdbarch);
00269 extern void set_gdbarch_num_pseudo_regs (struct gdbarch *gdbarch, int num_pseudo_regs);
00270 
00271 /* Assemble agent expression bytecode to collect pseudo-register REG.
00272    Return -1 if something goes wrong, 0 otherwise. */
00273 
00274 extern int gdbarch_ax_pseudo_register_collect_p (struct gdbarch *gdbarch);
00275 
00276 typedef int (gdbarch_ax_pseudo_register_collect_ftype) (struct gdbarch *gdbarch, struct agent_expr *ax, int reg);
00277 extern int gdbarch_ax_pseudo_register_collect (struct gdbarch *gdbarch, struct agent_expr *ax, int reg);
00278 extern void set_gdbarch_ax_pseudo_register_collect (struct gdbarch *gdbarch, gdbarch_ax_pseudo_register_collect_ftype *ax_pseudo_register_collect);
00279 
00280 /* Assemble agent expression bytecode to push the value of pseudo-register
00281    REG on the interpreter stack.
00282    Return -1 if something goes wrong, 0 otherwise. */
00283 
00284 extern int gdbarch_ax_pseudo_register_push_stack_p (struct gdbarch *gdbarch);
00285 
00286 typedef int (gdbarch_ax_pseudo_register_push_stack_ftype) (struct gdbarch *gdbarch, struct agent_expr *ax, int reg);
00287 extern int gdbarch_ax_pseudo_register_push_stack (struct gdbarch *gdbarch, struct agent_expr *ax, int reg);
00288 extern void set_gdbarch_ax_pseudo_register_push_stack (struct gdbarch *gdbarch, gdbarch_ax_pseudo_register_push_stack_ftype *ax_pseudo_register_push_stack);
00289 
00290 /* GDB's standard (or well known) register numbers.  These can map onto
00291    a real register or a pseudo (computed) register or not be defined at
00292    all (-1).
00293    gdbarch_sp_regnum will hopefully be replaced by UNWIND_SP. */
00294 
00295 extern int gdbarch_sp_regnum (struct gdbarch *gdbarch);
00296 extern void set_gdbarch_sp_regnum (struct gdbarch *gdbarch, int sp_regnum);
00297 
00298 extern int gdbarch_pc_regnum (struct gdbarch *gdbarch);
00299 extern void set_gdbarch_pc_regnum (struct gdbarch *gdbarch, int pc_regnum);
00300 
00301 extern int gdbarch_ps_regnum (struct gdbarch *gdbarch);
00302 extern void set_gdbarch_ps_regnum (struct gdbarch *gdbarch, int ps_regnum);
00303 
00304 extern int gdbarch_fp0_regnum (struct gdbarch *gdbarch);
00305 extern void set_gdbarch_fp0_regnum (struct gdbarch *gdbarch, int fp0_regnum);
00306 
00307 /* Convert stab register number (from `r' declaration) to a gdb REGNUM. */
00308 
00309 typedef int (gdbarch_stab_reg_to_regnum_ftype) (struct gdbarch *gdbarch, int stab_regnr);
00310 extern int gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, int stab_regnr);
00311 extern void set_gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_stab_reg_to_regnum_ftype *stab_reg_to_regnum);
00312 
00313 /* Provide a default mapping from a ecoff register number to a gdb REGNUM. */
00314 
00315 typedef int (gdbarch_ecoff_reg_to_regnum_ftype) (struct gdbarch *gdbarch, int ecoff_regnr);
00316 extern int gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, int ecoff_regnr);
00317 extern void set_gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_ecoff_reg_to_regnum_ftype *ecoff_reg_to_regnum);
00318 
00319 /* Convert from an sdb register number to an internal gdb register number. */
00320 
00321 typedef int (gdbarch_sdb_reg_to_regnum_ftype) (struct gdbarch *gdbarch, int sdb_regnr);
00322 extern int gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, int sdb_regnr);
00323 extern void set_gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_sdb_reg_to_regnum_ftype *sdb_reg_to_regnum);
00324 
00325 /* Provide a default mapping from a DWARF2 register number to a gdb REGNUM. */
00326 
00327 typedef int (gdbarch_dwarf2_reg_to_regnum_ftype) (struct gdbarch *gdbarch, int dwarf2_regnr);
00328 extern int gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int dwarf2_regnr);
00329 extern void set_gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_dwarf2_reg_to_regnum_ftype *dwarf2_reg_to_regnum);
00330 
00331 typedef const char * (gdbarch_register_name_ftype) (struct gdbarch *gdbarch, int regnr);
00332 extern const char * gdbarch_register_name (struct gdbarch *gdbarch, int regnr);
00333 extern void set_gdbarch_register_name (struct gdbarch *gdbarch, gdbarch_register_name_ftype *register_name);
00334 
00335 /* Return the type of a register specified by the architecture.  Only
00336    the register cache should call this function directly; others should
00337    use "register_type". */
00338 
00339 extern int gdbarch_register_type_p (struct gdbarch *gdbarch);
00340 
00341 typedef struct type * (gdbarch_register_type_ftype) (struct gdbarch *gdbarch, int reg_nr);
00342 extern struct type * gdbarch_register_type (struct gdbarch *gdbarch, int reg_nr);
00343 extern void set_gdbarch_register_type (struct gdbarch *gdbarch, gdbarch_register_type_ftype *register_type);
00344 
00345 extern int gdbarch_dummy_id_p (struct gdbarch *gdbarch);
00346 
00347 typedef struct frame_id (gdbarch_dummy_id_ftype) (struct gdbarch *gdbarch, struct frame_info *this_frame);
00348 extern struct frame_id gdbarch_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame);
00349 extern void set_gdbarch_dummy_id (struct gdbarch *gdbarch, gdbarch_dummy_id_ftype *dummy_id);
00350 
00351 /* Implement DUMMY_ID and PUSH_DUMMY_CALL, then delete
00352    deprecated_fp_regnum. */
00353 
00354 extern int gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch);
00355 extern void set_gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch, int deprecated_fp_regnum);
00356 
00357 extern int gdbarch_push_dummy_call_p (struct gdbarch *gdbarch);
00358 
00359 typedef CORE_ADDR (gdbarch_push_dummy_call_ftype) (struct gdbarch *gdbarch, struct value *function, struct regcache *regcache, CORE_ADDR bp_addr, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr);
00360 extern CORE_ADDR gdbarch_push_dummy_call (struct gdbarch *gdbarch, struct value *function, struct regcache *regcache, CORE_ADDR bp_addr, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr);
00361 extern void set_gdbarch_push_dummy_call (struct gdbarch *gdbarch, gdbarch_push_dummy_call_ftype *push_dummy_call);
00362 
00363 extern int gdbarch_call_dummy_location (struct gdbarch *gdbarch);
00364 extern void set_gdbarch_call_dummy_location (struct gdbarch *gdbarch, int call_dummy_location);
00365 
00366 extern int gdbarch_push_dummy_code_p (struct gdbarch *gdbarch);
00367 
00368 typedef CORE_ADDR (gdbarch_push_dummy_code_ftype) (struct gdbarch *gdbarch, CORE_ADDR sp, CORE_ADDR funaddr, struct value **args, int nargs, struct type *value_type, CORE_ADDR *real_pc, CORE_ADDR *bp_addr, struct regcache *regcache);
00369 extern CORE_ADDR gdbarch_push_dummy_code (struct gdbarch *gdbarch, CORE_ADDR sp, CORE_ADDR funaddr, struct value **args, int nargs, struct type *value_type, CORE_ADDR *real_pc, CORE_ADDR *bp_addr, struct regcache *regcache);
00370 extern void set_gdbarch_push_dummy_code (struct gdbarch *gdbarch, gdbarch_push_dummy_code_ftype *push_dummy_code);
00371 
00372 typedef void (gdbarch_print_registers_info_ftype) (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, int regnum, int all);
00373 extern void gdbarch_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, int regnum, int all);
00374 extern void set_gdbarch_print_registers_info (struct gdbarch *gdbarch, gdbarch_print_registers_info_ftype *print_registers_info);
00375 
00376 extern int gdbarch_print_float_info_p (struct gdbarch *gdbarch);
00377 
00378 typedef void (gdbarch_print_float_info_ftype) (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args);
00379 extern void gdbarch_print_float_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args);
00380 extern void set_gdbarch_print_float_info (struct gdbarch *gdbarch, gdbarch_print_float_info_ftype *print_float_info);
00381 
00382 extern int gdbarch_print_vector_info_p (struct gdbarch *gdbarch);
00383 
00384 typedef void (gdbarch_print_vector_info_ftype) (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args);
00385 extern void gdbarch_print_vector_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args);
00386 extern void set_gdbarch_print_vector_info (struct gdbarch *gdbarch, gdbarch_print_vector_info_ftype *print_vector_info);
00387 
00388 /* MAP a GDB RAW register number onto a simulator register number.  See
00389    also include/...-sim.h. */
00390 
00391 typedef int (gdbarch_register_sim_regno_ftype) (struct gdbarch *gdbarch, int reg_nr);
00392 extern int gdbarch_register_sim_regno (struct gdbarch *gdbarch, int reg_nr);
00393 extern void set_gdbarch_register_sim_regno (struct gdbarch *gdbarch, gdbarch_register_sim_regno_ftype *register_sim_regno);
00394 
00395 typedef int (gdbarch_cannot_fetch_register_ftype) (struct gdbarch *gdbarch, int regnum);
00396 extern int gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, int regnum);
00397 extern void set_gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, gdbarch_cannot_fetch_register_ftype *cannot_fetch_register);
00398 
00399 typedef int (gdbarch_cannot_store_register_ftype) (struct gdbarch *gdbarch, int regnum);
00400 extern int gdbarch_cannot_store_register (struct gdbarch *gdbarch, int regnum);
00401 extern void set_gdbarch_cannot_store_register (struct gdbarch *gdbarch, gdbarch_cannot_store_register_ftype *cannot_store_register);
00402 
00403 /* setjmp/longjmp support. */
00404 
00405 extern int gdbarch_get_longjmp_target_p (struct gdbarch *gdbarch);
00406 
00407 typedef int (gdbarch_get_longjmp_target_ftype) (struct frame_info *frame, CORE_ADDR *pc);
00408 extern int gdbarch_get_longjmp_target (struct gdbarch *gdbarch, struct frame_info *frame, CORE_ADDR *pc);
00409 extern void set_gdbarch_get_longjmp_target (struct gdbarch *gdbarch, gdbarch_get_longjmp_target_ftype *get_longjmp_target);
00410 
00411 extern int gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch);
00412 extern void set_gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch, int believe_pcc_promotion);
00413 
00414 typedef int (gdbarch_convert_register_p_ftype) (struct gdbarch *gdbarch, int regnum, struct type *type);
00415 extern int gdbarch_convert_register_p (struct gdbarch *gdbarch, int regnum, struct type *type);
00416 extern void set_gdbarch_convert_register_p (struct gdbarch *gdbarch, gdbarch_convert_register_p_ftype *convert_register_p);
00417 
00418 typedef int (gdbarch_register_to_value_ftype) (struct frame_info *frame, int regnum, struct type *type, gdb_byte *buf, int *optimizedp, int *unavailablep);
00419 extern int gdbarch_register_to_value (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, gdb_byte *buf, int *optimizedp, int *unavailablep);
00420 extern void set_gdbarch_register_to_value (struct gdbarch *gdbarch, gdbarch_register_to_value_ftype *register_to_value);
00421 
00422 typedef void (gdbarch_value_to_register_ftype) (struct frame_info *frame, int regnum, struct type *type, const gdb_byte *buf);
00423 extern void gdbarch_value_to_register (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, const gdb_byte *buf);
00424 extern void set_gdbarch_value_to_register (struct gdbarch *gdbarch, gdbarch_value_to_register_ftype *value_to_register);
00425 
00426 /* Construct a value representing the contents of register REGNUM in
00427    frame FRAME, interpreted as type TYPE.  The routine needs to
00428    allocate and return a struct value with all value attributes
00429    (but not the value contents) filled in. */
00430 
00431 typedef struct value * (gdbarch_value_from_register_ftype) (struct type *type, int regnum, struct frame_info *frame);
00432 extern struct value * gdbarch_value_from_register (struct gdbarch *gdbarch, struct type *type, int regnum, struct frame_info *frame);
00433 extern void set_gdbarch_value_from_register (struct gdbarch *gdbarch, gdbarch_value_from_register_ftype *value_from_register);
00434 
00435 typedef CORE_ADDR (gdbarch_pointer_to_address_ftype) (struct gdbarch *gdbarch, struct type *type, const gdb_byte *buf);
00436 extern CORE_ADDR gdbarch_pointer_to_address (struct gdbarch *gdbarch, struct type *type, const gdb_byte *buf);
00437 extern void set_gdbarch_pointer_to_address (struct gdbarch *gdbarch, gdbarch_pointer_to_address_ftype *pointer_to_address);
00438 
00439 typedef void (gdbarch_address_to_pointer_ftype) (struct gdbarch *gdbarch, struct type *type, gdb_byte *buf, CORE_ADDR addr);
00440 extern void gdbarch_address_to_pointer (struct gdbarch *gdbarch, struct type *type, gdb_byte *buf, CORE_ADDR addr);
00441 extern void set_gdbarch_address_to_pointer (struct gdbarch *gdbarch, gdbarch_address_to_pointer_ftype *address_to_pointer);
00442 
00443 extern int gdbarch_integer_to_address_p (struct gdbarch *gdbarch);
00444 
00445 typedef CORE_ADDR (gdbarch_integer_to_address_ftype) (struct gdbarch *gdbarch, struct type *type, const gdb_byte *buf);
00446 extern CORE_ADDR gdbarch_integer_to_address (struct gdbarch *gdbarch, struct type *type, const gdb_byte *buf);
00447 extern void set_gdbarch_integer_to_address (struct gdbarch *gdbarch, gdbarch_integer_to_address_ftype *integer_to_address);
00448 
00449 /* Return the return-value convention that will be used by FUNCTION
00450    to return a value of type VALTYPE.  FUNCTION may be NULL in which
00451    case the return convention is computed based only on VALTYPE.
00452   
00453    If READBUF is not NULL, extract the return value and save it in this buffer.
00454   
00455    If WRITEBUF is not NULL, it contains a return value which will be
00456    stored into the appropriate register.  This can be used when we want
00457    to force the value returned by a function (see the "return" command
00458    for instance). */
00459 
00460 extern int gdbarch_return_value_p (struct gdbarch *gdbarch);
00461 
00462 typedef enum return_value_convention (gdbarch_return_value_ftype) (struct gdbarch *gdbarch, struct value *function, struct type *valtype, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf);
00463 extern enum return_value_convention gdbarch_return_value (struct gdbarch *gdbarch, struct value *function, struct type *valtype, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf);
00464 extern void set_gdbarch_return_value (struct gdbarch *gdbarch, gdbarch_return_value_ftype *return_value);
00465 
00466 /* Return true if the return value of function is stored in the first hidden
00467    parameter.  In theory, this feature should be language-dependent, specified
00468    by language and its ABI, such as C++.  Unfortunately, compiler may
00469    implement it to a target-dependent feature.  So that we need such hook here
00470    to be aware of this in GDB. */
00471 
00472 typedef int (gdbarch_return_in_first_hidden_param_p_ftype) (struct gdbarch *gdbarch, struct type *type);
00473 extern int gdbarch_return_in_first_hidden_param_p (struct gdbarch *gdbarch, struct type *type);
00474 extern void set_gdbarch_return_in_first_hidden_param_p (struct gdbarch *gdbarch, gdbarch_return_in_first_hidden_param_p_ftype *return_in_first_hidden_param_p);
00475 
00476 typedef CORE_ADDR (gdbarch_skip_prologue_ftype) (struct gdbarch *gdbarch, CORE_ADDR ip);
00477 extern CORE_ADDR gdbarch_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR ip);
00478 extern void set_gdbarch_skip_prologue (struct gdbarch *gdbarch, gdbarch_skip_prologue_ftype *skip_prologue);
00479 
00480 extern int gdbarch_skip_main_prologue_p (struct gdbarch *gdbarch);
00481 
00482 typedef CORE_ADDR (gdbarch_skip_main_prologue_ftype) (struct gdbarch *gdbarch, CORE_ADDR ip);
00483 extern CORE_ADDR gdbarch_skip_main_prologue (struct gdbarch *gdbarch, CORE_ADDR ip);
00484 extern void set_gdbarch_skip_main_prologue (struct gdbarch *gdbarch, gdbarch_skip_main_prologue_ftype *skip_main_prologue);
00485 
00486 typedef int (gdbarch_inner_than_ftype) (CORE_ADDR lhs, CORE_ADDR rhs);
00487 extern int gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs);
00488 extern void set_gdbarch_inner_than (struct gdbarch *gdbarch, gdbarch_inner_than_ftype *inner_than);
00489 
00490 typedef const gdb_byte * (gdbarch_breakpoint_from_pc_ftype) (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr);
00491 extern const gdb_byte * gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr);
00492 extern void set_gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc);
00493 
00494 /* Return the adjusted address and kind to use for Z0/Z1 packets.
00495    KIND is usually the memory length of the breakpoint, but may have a
00496    different target-specific meaning. */
00497 
00498 typedef void (gdbarch_remote_breakpoint_from_pc_ftype) (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *kindptr);
00499 extern void gdbarch_remote_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *kindptr);
00500 extern void set_gdbarch_remote_breakpoint_from_pc (struct gdbarch *gdbarch, gdbarch_remote_breakpoint_from_pc_ftype *remote_breakpoint_from_pc);
00501 
00502 extern int gdbarch_adjust_breakpoint_address_p (struct gdbarch *gdbarch);
00503 
00504 typedef CORE_ADDR (gdbarch_adjust_breakpoint_address_ftype) (struct gdbarch *gdbarch, CORE_ADDR bpaddr);
00505 extern CORE_ADDR gdbarch_adjust_breakpoint_address (struct gdbarch *gdbarch, CORE_ADDR bpaddr);
00506 extern void set_gdbarch_adjust_breakpoint_address (struct gdbarch *gdbarch, gdbarch_adjust_breakpoint_address_ftype *adjust_breakpoint_address);
00507 
00508 typedef int (gdbarch_memory_insert_breakpoint_ftype) (struct gdbarch *gdbarch, struct bp_target_info *bp_tgt);
00509 extern int gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, struct bp_target_info *bp_tgt);
00510 extern void set_gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, gdbarch_memory_insert_breakpoint_ftype *memory_insert_breakpoint);
00511 
00512 typedef int (gdbarch_memory_remove_breakpoint_ftype) (struct gdbarch *gdbarch, struct bp_target_info *bp_tgt);
00513 extern int gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, struct bp_target_info *bp_tgt);
00514 extern void set_gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, gdbarch_memory_remove_breakpoint_ftype *memory_remove_breakpoint);
00515 
00516 extern CORE_ADDR gdbarch_decr_pc_after_break (struct gdbarch *gdbarch);
00517 extern void set_gdbarch_decr_pc_after_break (struct gdbarch *gdbarch, CORE_ADDR decr_pc_after_break);
00518 
00519 /* A function can be addressed by either it's "pointer" (possibly a
00520    descriptor address) or "entry point" (first executable instruction).
00521    The method "convert_from_func_ptr_addr" converting the former to the
00522    latter.  gdbarch_deprecated_function_start_offset is being used to implement
00523    a simplified subset of that functionality - the function's address
00524    corresponds to the "function pointer" and the function's start
00525    corresponds to the "function entry point" - and hence is redundant. */
00526 
00527 extern CORE_ADDR gdbarch_deprecated_function_start_offset (struct gdbarch *gdbarch);
00528 extern void set_gdbarch_deprecated_function_start_offset (struct gdbarch *gdbarch, CORE_ADDR deprecated_function_start_offset);
00529 
00530 /* Return the remote protocol register number associated with this
00531    register.  Normally the identity mapping. */
00532 
00533 typedef int (gdbarch_remote_register_number_ftype) (struct gdbarch *gdbarch, int regno);
00534 extern int gdbarch_remote_register_number (struct gdbarch *gdbarch, int regno);
00535 extern void set_gdbarch_remote_register_number (struct gdbarch *gdbarch, gdbarch_remote_register_number_ftype *remote_register_number);
00536 
00537 /* Fetch the target specific address used to represent a load module. */
00538 
00539 extern int gdbarch_fetch_tls_load_module_address_p (struct gdbarch *gdbarch);
00540 
00541 typedef CORE_ADDR (gdbarch_fetch_tls_load_module_address_ftype) (struct objfile *objfile);
00542 extern CORE_ADDR gdbarch_fetch_tls_load_module_address (struct gdbarch *gdbarch, struct objfile *objfile);
00543 extern void set_gdbarch_fetch_tls_load_module_address (struct gdbarch *gdbarch, gdbarch_fetch_tls_load_module_address_ftype *fetch_tls_load_module_address);
00544 
00545 extern CORE_ADDR gdbarch_frame_args_skip (struct gdbarch *gdbarch);
00546 extern void set_gdbarch_frame_args_skip (struct gdbarch *gdbarch, CORE_ADDR frame_args_skip);
00547 
00548 extern int gdbarch_unwind_pc_p (struct gdbarch *gdbarch);
00549 
00550 typedef CORE_ADDR (gdbarch_unwind_pc_ftype) (struct gdbarch *gdbarch, struct frame_info *next_frame);
00551 extern CORE_ADDR gdbarch_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame);
00552 extern void set_gdbarch_unwind_pc (struct gdbarch *gdbarch, gdbarch_unwind_pc_ftype *unwind_pc);
00553 
00554 extern int gdbarch_unwind_sp_p (struct gdbarch *gdbarch);
00555 
00556 typedef CORE_ADDR (gdbarch_unwind_sp_ftype) (struct gdbarch *gdbarch, struct frame_info *next_frame);
00557 extern CORE_ADDR gdbarch_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame);
00558 extern void set_gdbarch_unwind_sp (struct gdbarch *gdbarch, gdbarch_unwind_sp_ftype *unwind_sp);
00559 
00560 /* DEPRECATED_FRAME_LOCALS_ADDRESS as been replaced by the per-frame
00561    frame-base.  Enable frame-base before frame-unwind. */
00562 
00563 extern int gdbarch_frame_num_args_p (struct gdbarch *gdbarch);
00564 
00565 typedef int (gdbarch_frame_num_args_ftype) (struct frame_info *frame);
00566 extern int gdbarch_frame_num_args (struct gdbarch *gdbarch, struct frame_info *frame);
00567 extern void set_gdbarch_frame_num_args (struct gdbarch *gdbarch, gdbarch_frame_num_args_ftype *frame_num_args);
00568 
00569 extern int gdbarch_frame_align_p (struct gdbarch *gdbarch);
00570 
00571 typedef CORE_ADDR (gdbarch_frame_align_ftype) (struct gdbarch *gdbarch, CORE_ADDR address);
00572 extern CORE_ADDR gdbarch_frame_align (struct gdbarch *gdbarch, CORE_ADDR address);
00573 extern void set_gdbarch_frame_align (struct gdbarch *gdbarch, gdbarch_frame_align_ftype *frame_align);
00574 
00575 typedef int (gdbarch_stabs_argument_has_addr_ftype) (struct gdbarch *gdbarch, struct type *type);
00576 extern int gdbarch_stabs_argument_has_addr (struct gdbarch *gdbarch, struct type *type);
00577 extern void set_gdbarch_stabs_argument_has_addr (struct gdbarch *gdbarch, gdbarch_stabs_argument_has_addr_ftype *stabs_argument_has_addr);
00578 
00579 extern int gdbarch_frame_red_zone_size (struct gdbarch *gdbarch);
00580 extern void set_gdbarch_frame_red_zone_size (struct gdbarch *gdbarch, int frame_red_zone_size);
00581 
00582 typedef CORE_ADDR (gdbarch_convert_from_func_ptr_addr_ftype) (struct gdbarch *gdbarch, CORE_ADDR addr, struct target_ops *targ);
00583 extern CORE_ADDR gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, CORE_ADDR addr, struct target_ops *targ);
00584 extern void set_gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, gdbarch_convert_from_func_ptr_addr_ftype *convert_from_func_ptr_addr);
00585 
00586 /* On some machines there are bits in addresses which are not really
00587    part of the address, but are used by the kernel, the hardware, etc.
00588    for special purposes.  gdbarch_addr_bits_remove takes out any such bits so
00589    we get a "real" address such as one would find in a symbol table.
00590    This is used only for addresses of instructions, and even then I'm
00591    not sure it's used in all contexts.  It exists to deal with there
00592    being a few stray bits in the PC which would mislead us, not as some
00593    sort of generic thing to handle alignment or segmentation (it's
00594    possible it should be in TARGET_READ_PC instead). */
00595 
00596 typedef CORE_ADDR (gdbarch_addr_bits_remove_ftype) (struct gdbarch *gdbarch, CORE_ADDR addr);
00597 extern CORE_ADDR gdbarch_addr_bits_remove (struct gdbarch *gdbarch, CORE_ADDR addr);
00598 extern void set_gdbarch_addr_bits_remove (struct gdbarch *gdbarch, gdbarch_addr_bits_remove_ftype *addr_bits_remove);
00599 
00600 /* FIXME/cagney/2001-01-18: This should be split in two.  A target method that
00601    indicates if the target needs software single step.  An ISA method to
00602    implement it.
00603   
00604    FIXME/cagney/2001-01-18: This should be replaced with something that inserts
00605    breakpoints using the breakpoint system instead of blatting memory directly
00606    (as with rs6000).
00607   
00608    FIXME/cagney/2001-01-18: The logic is backwards.  It should be asking if the
00609    target can single step.  If not, then implement single step using breakpoints.
00610   
00611    A return value of 1 means that the software_single_step breakpoints
00612    were inserted; 0 means they were not. */
00613 
00614 extern int gdbarch_software_single_step_p (struct gdbarch *gdbarch);
00615 
00616 typedef int (gdbarch_software_single_step_ftype) (struct frame_info *frame);
00617 extern int gdbarch_software_single_step (struct gdbarch *gdbarch, struct frame_info *frame);
00618 extern void set_gdbarch_software_single_step (struct gdbarch *gdbarch, gdbarch_software_single_step_ftype *software_single_step);
00619 
00620 /* Return non-zero if the processor is executing a delay slot and a
00621    further single-step is needed before the instruction finishes. */
00622 
00623 extern int gdbarch_single_step_through_delay_p (struct gdbarch *gdbarch);
00624 
00625 typedef int (gdbarch_single_step_through_delay_ftype) (struct gdbarch *gdbarch, struct frame_info *frame);
00626 extern int gdbarch_single_step_through_delay (struct gdbarch *gdbarch, struct frame_info *frame);
00627 extern void set_gdbarch_single_step_through_delay (struct gdbarch *gdbarch, gdbarch_single_step_through_delay_ftype *single_step_through_delay);
00628 
00629 /* FIXME: cagney/2003-08-28: Need to find a better way of selecting the
00630    disassembler.  Perhaps objdump can handle it? */
00631 
00632 typedef int (gdbarch_print_insn_ftype) (bfd_vma vma, struct disassemble_info *info);
00633 extern int gdbarch_print_insn (struct gdbarch *gdbarch, bfd_vma vma, struct disassemble_info *info);
00634 extern void set_gdbarch_print_insn (struct gdbarch *gdbarch, gdbarch_print_insn_ftype *print_insn);
00635 
00636 typedef CORE_ADDR (gdbarch_skip_trampoline_code_ftype) (struct frame_info *frame, CORE_ADDR pc);
00637 extern CORE_ADDR gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, struct frame_info *frame, CORE_ADDR pc);
00638 extern void set_gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, gdbarch_skip_trampoline_code_ftype *skip_trampoline_code);
00639 
00640 /* If in_solib_dynsym_resolve_code() returns true, and SKIP_SOLIB_RESOLVER
00641    evaluates non-zero, this is the address where the debugger will place
00642    a step-resume breakpoint to get us past the dynamic linker. */
00643 
00644 typedef CORE_ADDR (gdbarch_skip_solib_resolver_ftype) (struct gdbarch *gdbarch, CORE_ADDR pc);
00645 extern CORE_ADDR gdbarch_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc);
00646 extern void set_gdbarch_skip_solib_resolver (struct gdbarch *gdbarch, gdbarch_skip_solib_resolver_ftype *skip_solib_resolver);
00647 
00648 /* Some systems also have trampoline code for returning from shared libs. */
00649 
00650 typedef int (gdbarch_in_solib_return_trampoline_ftype) (struct gdbarch *gdbarch, CORE_ADDR pc, const char *name);
00651 extern int gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, const char *name);
00652 extern void set_gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch, gdbarch_in_solib_return_trampoline_ftype *in_solib_return_trampoline);
00653 
00654 /* A target might have problems with watchpoints as soon as the stack
00655    frame of the current function has been destroyed.  This mostly happens
00656    as the first action in a funtion's epilogue.  in_function_epilogue_p()
00657    is defined to return a non-zero value if either the given addr is one
00658    instruction after the stack destroying instruction up to the trailing
00659    return instruction or if we can figure out that the stack frame has
00660    already been invalidated regardless of the value of addr.  Targets
00661    which don't suffer from that problem could just let this functionality
00662    untouched. */
00663 
00664 typedef int (gdbarch_in_function_epilogue_p_ftype) (struct gdbarch *gdbarch, CORE_ADDR addr);
00665 extern int gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR addr);
00666 extern void set_gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch, gdbarch_in_function_epilogue_p_ftype *in_function_epilogue_p);
00667 
00668 typedef void (gdbarch_elf_make_msymbol_special_ftype) (asymbol *sym, struct minimal_symbol *msym);
00669 extern void gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch, asymbol *sym, struct minimal_symbol *msym);
00670 extern void set_gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch, gdbarch_elf_make_msymbol_special_ftype *elf_make_msymbol_special);
00671 
00672 typedef void (gdbarch_coff_make_msymbol_special_ftype) (int val, struct minimal_symbol *msym);
00673 extern void gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch, int val, struct minimal_symbol *msym);
00674 extern void set_gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch, gdbarch_coff_make_msymbol_special_ftype *coff_make_msymbol_special);
00675 
00676 extern int gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch);
00677 extern void set_gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch, int cannot_step_breakpoint);
00678 
00679 extern int gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch);
00680 extern void set_gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch, int have_nonsteppable_watchpoint);
00681 
00682 extern int gdbarch_address_class_type_flags_p (struct gdbarch *gdbarch);
00683 
00684 typedef int (gdbarch_address_class_type_flags_ftype) (int byte_size, int dwarf2_addr_class);
00685 extern int gdbarch_address_class_type_flags (struct gdbarch *gdbarch, int byte_size, int dwarf2_addr_class);
00686 extern void set_gdbarch_address_class_type_flags (struct gdbarch *gdbarch, gdbarch_address_class_type_flags_ftype *address_class_type_flags);
00687 
00688 extern int gdbarch_address_class_type_flags_to_name_p (struct gdbarch *gdbarch);
00689 
00690 typedef const char * (gdbarch_address_class_type_flags_to_name_ftype) (struct gdbarch *gdbarch, int type_flags);
00691 extern const char * gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch, int type_flags);
00692 extern void set_gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch, gdbarch_address_class_type_flags_to_name_ftype *address_class_type_flags_to_name);
00693 
00694 extern int gdbarch_address_class_name_to_type_flags_p (struct gdbarch *gdbarch);
00695 
00696 typedef int (gdbarch_address_class_name_to_type_flags_ftype) (struct gdbarch *gdbarch, const char *name, int *type_flags_ptr);
00697 extern int gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch, const char *name, int *type_flags_ptr);
00698 extern void set_gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch, gdbarch_address_class_name_to_type_flags_ftype *address_class_name_to_type_flags);
00699 
00700 /* Is a register in a group */
00701 
00702 typedef int (gdbarch_register_reggroup_p_ftype) (struct gdbarch *gdbarch, int regnum, struct reggroup *reggroup);
00703 extern int gdbarch_register_reggroup_p (struct gdbarch *gdbarch, int regnum, struct reggroup *reggroup);
00704 extern void set_gdbarch_register_reggroup_p (struct gdbarch *gdbarch, gdbarch_register_reggroup_p_ftype *register_reggroup_p);
00705 
00706 /* Fetch the pointer to the ith function argument. */
00707 
00708 extern int gdbarch_fetch_pointer_argument_p (struct gdbarch *gdbarch);
00709 
00710 typedef CORE_ADDR (gdbarch_fetch_pointer_argument_ftype) (struct frame_info *frame, int argi, struct type *type);
00711 extern CORE_ADDR gdbarch_fetch_pointer_argument (struct gdbarch *gdbarch, struct frame_info *frame, int argi, struct type *type);
00712 extern void set_gdbarch_fetch_pointer_argument (struct gdbarch *gdbarch, gdbarch_fetch_pointer_argument_ftype *fetch_pointer_argument);
00713 
00714 /* Return the appropriate register set for a core file section with
00715    name SECT_NAME and size SECT_SIZE. */
00716 
00717 extern int gdbarch_regset_from_core_section_p (struct gdbarch *gdbarch);
00718 
00719 typedef const struct regset * (gdbarch_regset_from_core_section_ftype) (struct gdbarch *gdbarch, const char *sect_name, size_t sect_size);
00720 extern const struct regset * gdbarch_regset_from_core_section (struct gdbarch *gdbarch, const char *sect_name, size_t sect_size);
00721 extern void set_gdbarch_regset_from_core_section (struct gdbarch *gdbarch, gdbarch_regset_from_core_section_ftype *regset_from_core_section);
00722 
00723 /* Supported register notes in a core file. */
00724 
00725 extern struct core_regset_section * gdbarch_core_regset_sections (struct gdbarch *gdbarch);
00726 extern void set_gdbarch_core_regset_sections (struct gdbarch *gdbarch, struct core_regset_section * core_regset_sections);
00727 
00728 /* Create core file notes */
00729 
00730 extern int gdbarch_make_corefile_notes_p (struct gdbarch *gdbarch);
00731 
00732 typedef char * (gdbarch_make_corefile_notes_ftype) (struct gdbarch *gdbarch, bfd *obfd, int *note_size);
00733 extern char * gdbarch_make_corefile_notes (struct gdbarch *gdbarch, bfd *obfd, int *note_size);
00734 extern void set_gdbarch_make_corefile_notes (struct gdbarch *gdbarch, gdbarch_make_corefile_notes_ftype *make_corefile_notes);
00735 
00736 /* The elfcore writer hook to use to write Linux prpsinfo notes to core
00737    files.  Most Linux architectures use the same prpsinfo32 or
00738    prpsinfo64 layouts, and so won't need to provide this hook, as we
00739    call the Linux generic routines in bfd to write prpsinfo notes by
00740    default. */
00741 
00742 extern int gdbarch_elfcore_write_linux_prpsinfo_p (struct gdbarch *gdbarch);
00743 
00744 typedef char * (gdbarch_elfcore_write_linux_prpsinfo_ftype) (bfd *obfd, char *note_data, int *note_size, const struct elf_internal_linux_prpsinfo *info);
00745 extern char * gdbarch_elfcore_write_linux_prpsinfo (struct gdbarch *gdbarch, bfd *obfd, char *note_data, int *note_size, const struct elf_internal_linux_prpsinfo *info);
00746 extern void set_gdbarch_elfcore_write_linux_prpsinfo (struct gdbarch *gdbarch, gdbarch_elfcore_write_linux_prpsinfo_ftype *elfcore_write_linux_prpsinfo);
00747 
00748 /* Find core file memory regions */
00749 
00750 extern int gdbarch_find_memory_regions_p (struct gdbarch *gdbarch);
00751 
00752 typedef int (gdbarch_find_memory_regions_ftype) (struct gdbarch *gdbarch, find_memory_region_ftype func, void *data);
00753 extern int gdbarch_find_memory_regions (struct gdbarch *gdbarch, find_memory_region_ftype func, void *data);
00754 extern void set_gdbarch_find_memory_regions (struct gdbarch *gdbarch, gdbarch_find_memory_regions_ftype *find_memory_regions);
00755 
00756 /* Read offset OFFSET of TARGET_OBJECT_LIBRARIES formatted shared libraries list from
00757    core file into buffer READBUF with length LEN. */
00758 
00759 extern int gdbarch_core_xfer_shared_libraries_p (struct gdbarch *gdbarch);
00760 
00761 typedef LONGEST (gdbarch_core_xfer_shared_libraries_ftype) (struct gdbarch *gdbarch, gdb_byte *readbuf, ULONGEST offset, LONGEST len);
00762 extern LONGEST gdbarch_core_xfer_shared_libraries (struct gdbarch *gdbarch, gdb_byte *readbuf, ULONGEST offset, LONGEST len);
00763 extern void set_gdbarch_core_xfer_shared_libraries (struct gdbarch *gdbarch, gdbarch_core_xfer_shared_libraries_ftype *core_xfer_shared_libraries);
00764 
00765 /* Read offset OFFSET of TARGET_OBJECT_LIBRARIES_AIX formatted shared
00766    libraries list from core file into buffer READBUF with length LEN. */
00767 
00768 extern int gdbarch_core_xfer_shared_libraries_aix_p (struct gdbarch *gdbarch);
00769 
00770 typedef LONGEST (gdbarch_core_xfer_shared_libraries_aix_ftype) (struct gdbarch *gdbarch, gdb_byte *readbuf, ULONGEST offset, LONGEST len);
00771 extern LONGEST gdbarch_core_xfer_shared_libraries_aix (struct gdbarch *gdbarch, gdb_byte *readbuf, ULONGEST offset, LONGEST len);
00772 extern void set_gdbarch_core_xfer_shared_libraries_aix (struct gdbarch *gdbarch, gdbarch_core_xfer_shared_libraries_aix_ftype *core_xfer_shared_libraries_aix);
00773 
00774 /* How the core target converts a PTID from a core file to a string. */
00775 
00776 extern int gdbarch_core_pid_to_str_p (struct gdbarch *gdbarch);
00777 
00778 typedef char * (gdbarch_core_pid_to_str_ftype) (struct gdbarch *gdbarch, ptid_t ptid);
00779 extern char * gdbarch_core_pid_to_str (struct gdbarch *gdbarch, ptid_t ptid);
00780 extern void set_gdbarch_core_pid_to_str (struct gdbarch *gdbarch, gdbarch_core_pid_to_str_ftype *core_pid_to_str);
00781 
00782 /* BFD target to use when generating a core file. */
00783 
00784 extern int gdbarch_gcore_bfd_target_p (struct gdbarch *gdbarch);
00785 
00786 extern const char * gdbarch_gcore_bfd_target (struct gdbarch *gdbarch);
00787 extern void set_gdbarch_gcore_bfd_target (struct gdbarch *gdbarch, const char * gcore_bfd_target);
00788 
00789 /* If the elements of C++ vtables are in-place function descriptors rather
00790    than normal function pointers (which may point to code or a descriptor),
00791    set this to one. */
00792 
00793 extern int gdbarch_vtable_function_descriptors (struct gdbarch *gdbarch);
00794 extern void set_gdbarch_vtable_function_descriptors (struct gdbarch *gdbarch, int vtable_function_descriptors);
00795 
00796 /* Set if the least significant bit of the delta is used instead of the least
00797    significant bit of the pfn for pointers to virtual member functions. */
00798 
00799 extern int gdbarch_vbit_in_delta (struct gdbarch *gdbarch);
00800 extern void set_gdbarch_vbit_in_delta (struct gdbarch *gdbarch, int vbit_in_delta);
00801 
00802 /* Advance PC to next instruction in order to skip a permanent breakpoint. */
00803 
00804 extern int gdbarch_skip_permanent_breakpoint_p (struct gdbarch *gdbarch);
00805 
00806 typedef void (gdbarch_skip_permanent_breakpoint_ftype) (struct regcache *regcache);
00807 extern void gdbarch_skip_permanent_breakpoint (struct gdbarch *gdbarch, struct regcache *regcache);
00808 extern void set_gdbarch_skip_permanent_breakpoint (struct gdbarch *gdbarch, gdbarch_skip_permanent_breakpoint_ftype *skip_permanent_breakpoint);
00809 
00810 /* The maximum length of an instruction on this architecture in bytes. */
00811 
00812 extern int gdbarch_max_insn_length_p (struct gdbarch *gdbarch);
00813 
00814 extern ULONGEST gdbarch_max_insn_length (struct gdbarch *gdbarch);
00815 extern void set_gdbarch_max_insn_length (struct gdbarch *gdbarch, ULONGEST max_insn_length);
00816 
00817 /* Copy the instruction at FROM to TO, and make any adjustments
00818    necessary to single-step it at that address.
00819   
00820    REGS holds the state the thread's registers will have before
00821    executing the copied instruction; the PC in REGS will refer to FROM,
00822    not the copy at TO.  The caller should update it to point at TO later.
00823   
00824    Return a pointer to data of the architecture's choice to be passed
00825    to gdbarch_displaced_step_fixup.  Or, return NULL to indicate that
00826    the instruction's effects have been completely simulated, with the
00827    resulting state written back to REGS.
00828   
00829    For a general explanation of displaced stepping and how GDB uses it,
00830    see the comments in infrun.c.
00831   
00832    The TO area is only guaranteed to have space for
00833    gdbarch_max_insn_length (arch) bytes, so this function must not
00834    write more bytes than that to that area.
00835   
00836    If you do not provide this function, GDB assumes that the
00837    architecture does not support displaced stepping.
00838   
00839    If your architecture doesn't need to adjust instructions before
00840    single-stepping them, consider using simple_displaced_step_copy_insn
00841    here. */
00842 
00843 extern int gdbarch_displaced_step_copy_insn_p (struct gdbarch *gdbarch);
00844 
00845 typedef struct displaced_step_closure * (gdbarch_displaced_step_copy_insn_ftype) (struct gdbarch *gdbarch, CORE_ADDR from, CORE_ADDR to, struct regcache *regs);
00846 extern struct displaced_step_closure * gdbarch_displaced_step_copy_insn (struct gdbarch *gdbarch, CORE_ADDR from, CORE_ADDR to, struct regcache *regs);
00847 extern void set_gdbarch_displaced_step_copy_insn (struct gdbarch *gdbarch, gdbarch_displaced_step_copy_insn_ftype *displaced_step_copy_insn);
00848 
00849 /* Return true if GDB should use hardware single-stepping to execute
00850    the displaced instruction identified by CLOSURE.  If false,
00851    GDB will simply restart execution at the displaced instruction
00852    location, and it is up to the target to ensure GDB will receive
00853    control again (e.g. by placing a software breakpoint instruction
00854    into the displaced instruction buffer).
00855   
00856    The default implementation returns false on all targets that
00857    provide a gdbarch_software_single_step routine, and true otherwise. */
00858 
00859 typedef int (gdbarch_displaced_step_hw_singlestep_ftype) (struct gdbarch *gdbarch, struct displaced_step_closure *closure);
00860 extern int gdbarch_displaced_step_hw_singlestep (struct gdbarch *gdbarch, struct displaced_step_closure *closure);
00861 extern void set_gdbarch_displaced_step_hw_singlestep (struct gdbarch *gdbarch, gdbarch_displaced_step_hw_singlestep_ftype *displaced_step_hw_singlestep);
00862 
00863 /* Fix up the state resulting from successfully single-stepping a
00864    displaced instruction, to give the result we would have gotten from
00865    stepping the instruction in its original location.
00866   
00867    REGS is the register state resulting from single-stepping the
00868    displaced instruction.
00869   
00870    CLOSURE is the result from the matching call to
00871    gdbarch_displaced_step_copy_insn.
00872   
00873    If you provide gdbarch_displaced_step_copy_insn.but not this
00874    function, then GDB assumes that no fixup is needed after
00875    single-stepping the instruction.
00876   
00877    For a general explanation of displaced stepping and how GDB uses it,
00878    see the comments in infrun.c. */
00879 
00880 extern int gdbarch_displaced_step_fixup_p (struct gdbarch *gdbarch);
00881 
00882 typedef void (gdbarch_displaced_step_fixup_ftype) (struct gdbarch *gdbarch, struct displaced_step_closure *closure, CORE_ADDR from, CORE_ADDR to, struct regcache *regs);
00883 extern void gdbarch_displaced_step_fixup (struct gdbarch *gdbarch, struct displaced_step_closure *closure, CORE_ADDR from, CORE_ADDR to, struct regcache *regs);
00884 extern void set_gdbarch_displaced_step_fixup (struct gdbarch *gdbarch, gdbarch_displaced_step_fixup_ftype *displaced_step_fixup);
00885 
00886 /* Free a closure returned by gdbarch_displaced_step_copy_insn.
00887   
00888    If you provide gdbarch_displaced_step_copy_insn, you must provide
00889    this function as well.
00890   
00891    If your architecture uses closures that don't need to be freed, then
00892    you can use simple_displaced_step_free_closure here.
00893   
00894    For a general explanation of displaced stepping and how GDB uses it,
00895    see the comments in infrun.c. */
00896 
00897 typedef void (gdbarch_displaced_step_free_closure_ftype) (struct gdbarch *gdbarch, struct displaced_step_closure *closure);
00898 extern void gdbarch_displaced_step_free_closure (struct gdbarch *gdbarch, struct displaced_step_closure *closure);
00899 extern void set_gdbarch_displaced_step_free_closure (struct gdbarch *gdbarch, gdbarch_displaced_step_free_closure_ftype *displaced_step_free_closure);
00900 
00901 /* Return the address of an appropriate place to put displaced
00902    instructions while we step over them.  There need only be one such
00903    place, since we're only stepping one thread over a breakpoint at a
00904    time.
00905   
00906    For a general explanation of displaced stepping and how GDB uses it,
00907    see the comments in infrun.c. */
00908 
00909 typedef CORE_ADDR (gdbarch_displaced_step_location_ftype) (struct gdbarch *gdbarch);
00910 extern CORE_ADDR gdbarch_displaced_step_location (struct gdbarch *gdbarch);
00911 extern void set_gdbarch_displaced_step_location (struct gdbarch *gdbarch, gdbarch_displaced_step_location_ftype *displaced_step_location);
00912 
00913 /* Relocate an instruction to execute at a different address.  OLDLOC
00914    is the address in the inferior memory where the instruction to
00915    relocate is currently at.  On input, TO points to the destination
00916    where we want the instruction to be copied (and possibly adjusted)
00917    to.  On output, it points to one past the end of the resulting
00918    instruction(s).  The effect of executing the instruction at TO shall
00919    be the same as if executing it at FROM.  For example, call
00920    instructions that implicitly push the return address on the stack
00921    should be adjusted to return to the instruction after OLDLOC;
00922    relative branches, and other PC-relative instructions need the
00923    offset adjusted; etc. */
00924 
00925 extern int gdbarch_relocate_instruction_p (struct gdbarch *gdbarch);
00926 
00927 typedef void (gdbarch_relocate_instruction_ftype) (struct gdbarch *gdbarch, CORE_ADDR *to, CORE_ADDR from);
00928 extern void gdbarch_relocate_instruction (struct gdbarch *gdbarch, CORE_ADDR *to, CORE_ADDR from);
00929 extern void set_gdbarch_relocate_instruction (struct gdbarch *gdbarch, gdbarch_relocate_instruction_ftype *relocate_instruction);
00930 
00931 /* Refresh overlay mapped state for section OSECT. */
00932 
00933 extern int gdbarch_overlay_update_p (struct gdbarch *gdbarch);
00934 
00935 typedef void (gdbarch_overlay_update_ftype) (struct obj_section *osect);
00936 extern void gdbarch_overlay_update (struct gdbarch *gdbarch, struct obj_section *osect);
00937 extern void set_gdbarch_overlay_update (struct gdbarch *gdbarch, gdbarch_overlay_update_ftype *overlay_update);
00938 
00939 extern int gdbarch_core_read_description_p (struct gdbarch *gdbarch);
00940 
00941 typedef const struct target_desc * (gdbarch_core_read_description_ftype) (struct gdbarch *gdbarch, struct target_ops *target, bfd *abfd);
00942 extern const struct target_desc * gdbarch_core_read_description (struct gdbarch *gdbarch, struct target_ops *target, bfd *abfd);
00943 extern void set_gdbarch_core_read_description (struct gdbarch *gdbarch, gdbarch_core_read_description_ftype *core_read_description);
00944 
00945 /* Handle special encoding of static variables in stabs debug info. */
00946 
00947 extern int gdbarch_static_transform_name_p (struct gdbarch *gdbarch);
00948 
00949 typedef const char * (gdbarch_static_transform_name_ftype) (const char *name);
00950 extern const char * gdbarch_static_transform_name (struct gdbarch *gdbarch, const char *name);
00951 extern void set_gdbarch_static_transform_name (struct gdbarch *gdbarch, gdbarch_static_transform_name_ftype *static_transform_name);
00952 
00953 /* Set if the address in N_SO or N_FUN stabs may be zero. */
00954 
00955 extern int gdbarch_sofun_address_maybe_missing (struct gdbarch *gdbarch);
00956 extern void set_gdbarch_sofun_address_maybe_missing (struct gdbarch *gdbarch, int sofun_address_maybe_missing);
00957 
00958 /* Parse the instruction at ADDR storing in the record execution log
00959    the registers REGCACHE and memory ranges that will be affected when
00960    the instruction executes, along with their current values.
00961    Return -1 if something goes wrong, 0 otherwise. */
00962 
00963 extern int gdbarch_process_record_p (struct gdbarch *gdbarch);
00964 
00965 typedef int (gdbarch_process_record_ftype) (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR addr);
00966 extern int gdbarch_process_record (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR addr);
00967 extern void set_gdbarch_process_record (struct gdbarch *gdbarch, gdbarch_process_record_ftype *process_record);
00968 
00969 /* Save process state after a signal.
00970    Return -1 if something goes wrong, 0 otherwise. */
00971 
00972 extern int gdbarch_process_record_signal_p (struct gdbarch *gdbarch);
00973 
00974 typedef int (gdbarch_process_record_signal_ftype) (struct gdbarch *gdbarch, struct regcache *regcache, enum gdb_signal signal);
00975 extern int gdbarch_process_record_signal (struct gdbarch *gdbarch, struct regcache *regcache, enum gdb_signal signal);
00976 extern void set_gdbarch_process_record_signal (struct gdbarch *gdbarch, gdbarch_process_record_signal_ftype *process_record_signal);
00977 
00978 /* Signal translation: translate inferior's signal (target's) number
00979    into GDB's representation.  The implementation of this method must
00980    be host independent.  IOW, don't rely on symbols of the NAT_FILE
00981    header (the nm-*.h files), the host <signal.h> header, or similar
00982    headers.  This is mainly used when cross-debugging core files ---
00983    "Live" targets hide the translation behind the target interface
00984    (target_wait, target_resume, etc.). */
00985 
00986 extern int gdbarch_gdb_signal_from_target_p (struct gdbarch *gdbarch);
00987 
00988 typedef enum gdb_signal (gdbarch_gdb_signal_from_target_ftype) (struct gdbarch *gdbarch, int signo);
00989 extern enum gdb_signal gdbarch_gdb_signal_from_target (struct gdbarch *gdbarch, int signo);
00990 extern void set_gdbarch_gdb_signal_from_target (struct gdbarch *gdbarch, gdbarch_gdb_signal_from_target_ftype *gdb_signal_from_target);
00991 
00992 /* Signal translation: translate the GDB's internal signal number into
00993    the inferior's signal (target's) representation.  The implementation
00994    of this method must be host independent.  IOW, don't rely on symbols
00995    of the NAT_FILE header (the nm-*.h files), the host <signal.h>
00996    header, or similar headers.
00997    Return the target signal number if found, or -1 if the GDB internal
00998    signal number is invalid. */
00999 
01000 extern int gdbarch_gdb_signal_to_target_p (struct gdbarch *gdbarch);
01001 
01002 typedef int (gdbarch_gdb_signal_to_target_ftype) (struct gdbarch *gdbarch, enum gdb_signal signal);
01003 extern int gdbarch_gdb_signal_to_target (struct gdbarch *gdbarch, enum gdb_signal signal);
01004 extern void set_gdbarch_gdb_signal_to_target (struct gdbarch *gdbarch, gdbarch_gdb_signal_to_target_ftype *gdb_signal_to_target);
01005 
01006 /* Extra signal info inspection.
01007   
01008    Return a type suitable to inspect extra signal information. */
01009 
01010 extern int gdbarch_get_siginfo_type_p (struct gdbarch *gdbarch);
01011 
01012 typedef struct type * (gdbarch_get_siginfo_type_ftype) (struct gdbarch *gdbarch);
01013 extern struct type * gdbarch_get_siginfo_type (struct gdbarch *gdbarch);
01014 extern void set_gdbarch_get_siginfo_type (struct gdbarch *gdbarch, gdbarch_get_siginfo_type_ftype *get_siginfo_type);
01015 
01016 /* Record architecture-specific information from the symbol table. */
01017 
01018 extern int gdbarch_record_special_symbol_p (struct gdbarch *gdbarch);
01019 
01020 typedef void (gdbarch_record_special_symbol_ftype) (struct gdbarch *gdbarch, struct objfile *objfile, asymbol *sym);
01021 extern void gdbarch_record_special_symbol (struct gdbarch *gdbarch, struct objfile *objfile, asymbol *sym);
01022 extern void set_gdbarch_record_special_symbol (struct gdbarch *gdbarch, gdbarch_record_special_symbol_ftype *record_special_symbol);
01023 
01024 /* Function for the 'catch syscall' feature.
01025    Get architecture-specific system calls information from registers. */
01026 
01027 extern int gdbarch_get_syscall_number_p (struct gdbarch *gdbarch);
01028 
01029 typedef LONGEST (gdbarch_get_syscall_number_ftype) (struct gdbarch *gdbarch, ptid_t ptid);
01030 extern LONGEST gdbarch_get_syscall_number (struct gdbarch *gdbarch, ptid_t ptid);
01031 extern void set_gdbarch_get_syscall_number (struct gdbarch *gdbarch, gdbarch_get_syscall_number_ftype *get_syscall_number);
01032 
01033 /* SystemTap related fields and functions.
01034    Prefix used to mark an integer constant on the architecture's assembly
01035    For example, on x86 integer constants are written as:
01036   
01037     $10 ;; integer constant 10
01038   
01039    in this case, this prefix would be the character `$'. */
01040 
01041 extern const char * gdbarch_stap_integer_prefix (struct gdbarch *gdbarch);
01042 extern void set_gdbarch_stap_integer_prefix (struct gdbarch *gdbarch, const char * stap_integer_prefix);
01043 
01044 /* Suffix used to mark an integer constant on the architecture's assembly. */
01045 
01046 extern const char * gdbarch_stap_integer_suffix (struct gdbarch *gdbarch);
01047 extern void set_gdbarch_stap_integer_suffix (struct gdbarch *gdbarch, const char * stap_integer_suffix);
01048 
01049 /* Prefix used to mark a register name on the architecture's assembly.
01050    For example, on x86 the register name is written as:
01051   
01052     %eax ;; register eax
01053   
01054    in this case, this prefix would be the character `%'. */
01055 
01056 extern const char * gdbarch_stap_register_prefix (struct gdbarch *gdbarch);
01057 extern void set_gdbarch_stap_register_prefix (struct gdbarch *gdbarch, const char * stap_register_prefix);
01058 
01059 /* Suffix used to mark a register name on the architecture's assembly */
01060 
01061 extern const char * gdbarch_stap_register_suffix (struct gdbarch *gdbarch);
01062 extern void set_gdbarch_stap_register_suffix (struct gdbarch *gdbarch, const char * stap_register_suffix);
01063 
01064 /* Prefix used to mark a register indirection on the architecture's assembly.
01065    For example, on x86 the register indirection is written as:
01066   
01067     (%eax) ;; indirecting eax
01068   
01069    in this case, this prefix would be the charater `('.
01070   
01071    Please note that we use the indirection prefix also for register
01072    displacement, e.g., `4(%eax)' on x86. */
01073 
01074 extern const char * gdbarch_stap_register_indirection_prefix (struct gdbarch *gdbarch);
01075 extern void set_gdbarch_stap_register_indirection_prefix (struct gdbarch *gdbarch, const char * stap_register_indirection_prefix);
01076 
01077 /* Suffix used to mark a register indirection on the architecture's assembly.
01078    For example, on x86 the register indirection is written as:
01079   
01080     (%eax) ;; indirecting eax
01081   
01082    in this case, this prefix would be the charater `)'.
01083   
01084    Please note that we use the indirection suffix also for register
01085    displacement, e.g., `4(%eax)' on x86. */
01086 
01087 extern const char * gdbarch_stap_register_indirection_suffix (struct gdbarch *gdbarch);
01088 extern void set_gdbarch_stap_register_indirection_suffix (struct gdbarch *gdbarch, const char * stap_register_indirection_suffix);
01089 
01090 /* Prefix used to name a register using GDB's nomenclature.
01091   
01092    For example, on PPC a register is represented by a number in the assembly
01093    language (e.g., `10' is the 10th general-purpose register).  However,
01094    inside GDB this same register has an `r' appended to its name, so the 10th
01095    register would be represented as `r10' internally. */
01096 
01097 extern const char * gdbarch_stap_gdb_register_prefix (struct gdbarch *gdbarch);
01098 extern void set_gdbarch_stap_gdb_register_prefix (struct gdbarch *gdbarch, const char * stap_gdb_register_prefix);
01099 
01100 /* Suffix used to name a register using GDB's nomenclature. */
01101 
01102 extern const char * gdbarch_stap_gdb_register_suffix (struct gdbarch *gdbarch);
01103 extern void set_gdbarch_stap_gdb_register_suffix (struct gdbarch *gdbarch, const char * stap_gdb_register_suffix);
01104 
01105 /* Check if S is a single operand.
01106   
01107    Single operands can be:
01108     - Literal integers, e.g. `$10' on x86
01109     - Register access, e.g. `%eax' on x86
01110     - Register indirection, e.g. `(%eax)' on x86
01111     - Register displacement, e.g. `4(%eax)' on x86
01112   
01113    This function should check for these patterns on the string
01114    and return 1 if some were found, or zero otherwise.  Please try to match
01115    as much info as you can from the string, i.e., if you have to match
01116    something like `(%', do not match just the `('. */
01117 
01118 extern int gdbarch_stap_is_single_operand_p (struct gdbarch *gdbarch);
01119 
01120 typedef int (gdbarch_stap_is_single_operand_ftype) (struct gdbarch *gdbarch, const char *s);
01121 extern int gdbarch_stap_is_single_operand (struct gdbarch *gdbarch, const char *s);
01122 extern void set_gdbarch_stap_is_single_operand (struct gdbarch *gdbarch, gdbarch_stap_is_single_operand_ftype *stap_is_single_operand);
01123 
01124 /* Function used to handle a "special case" in the parser.
01125   
01126    A "special case" is considered to be an unknown token, i.e., a token
01127    that the parser does not know how to parse.  A good example of special
01128    case would be ARM's register displacement syntax:
01129   
01130     [R0, #4]  ;; displacing R0 by 4
01131   
01132    Since the parser assumes that a register displacement is of the form:
01133   
01134     <number> <indirection_prefix> <register_name> <indirection_suffix>
01135   
01136    it means that it will not be able to recognize and parse this odd syntax.
01137    Therefore, we should add a special case function that will handle this token.
01138   
01139    This function should generate the proper expression form of the expression
01140    using GDB's internal expression mechanism (e.g., `write_exp_elt_opcode'
01141    and so on).  It should also return 1 if the parsing was successful, or zero
01142    if the token was not recognized as a special token (in this case, returning
01143    zero means that the special parser is deferring the parsing to the generic
01144    parser), and should advance the buffer pointer (p->arg). */
01145 
01146 extern int gdbarch_stap_parse_special_token_p (struct gdbarch *gdbarch);
01147 
01148 typedef int (gdbarch_stap_parse_special_token_ftype) (struct gdbarch *gdbarch, struct stap_parse_info *p);
01149 extern int gdbarch_stap_parse_special_token (struct gdbarch *gdbarch, struct stap_parse_info *p);
01150 extern void set_gdbarch_stap_parse_special_token (struct gdbarch *gdbarch, gdbarch_stap_parse_special_token_ftype *stap_parse_special_token);
01151 
01152 /* True if the list of shared libraries is one and only for all
01153    processes, as opposed to a list of shared libraries per inferior.
01154    This usually means that all processes, although may or may not share
01155    an address space, will see the same set of symbols at the same
01156    addresses. */
01157 
01158 extern int gdbarch_has_global_solist (struct gdbarch *gdbarch);
01159 extern void set_gdbarch_has_global_solist (struct gdbarch *gdbarch, int has_global_solist);
01160 
01161 /* On some targets, even though each inferior has its own private
01162    address space, the debug interface takes care of making breakpoints
01163    visible to all address spaces automatically.  For such cases,
01164    this property should be set to true. */
01165 
01166 extern int gdbarch_has_global_breakpoints (struct gdbarch *gdbarch);
01167 extern void set_gdbarch_has_global_breakpoints (struct gdbarch *gdbarch, int has_global_breakpoints);
01168 
01169 /* True if inferiors share an address space (e.g., uClinux). */
01170 
01171 typedef int (gdbarch_has_shared_address_space_ftype) (struct gdbarch *gdbarch);
01172 extern int gdbarch_has_shared_address_space (struct gdbarch *gdbarch);
01173 extern void set_gdbarch_has_shared_address_space (struct gdbarch *gdbarch, gdbarch_has_shared_address_space_ftype *has_shared_address_space);
01174 
01175 /* True if a fast tracepoint can be set at an address. */
01176 
01177 typedef int (gdbarch_fast_tracepoint_valid_at_ftype) (struct gdbarch *gdbarch, CORE_ADDR addr, int *isize, char **msg);
01178 extern int gdbarch_fast_tracepoint_valid_at (struct gdbarch *gdbarch, CORE_ADDR addr, int *isize, char **msg);
01179 extern void set_gdbarch_fast_tracepoint_valid_at (struct gdbarch *gdbarch, gdbarch_fast_tracepoint_valid_at_ftype *fast_tracepoint_valid_at);
01180 
01181 /* Return the "auto" target charset. */
01182 
01183 typedef const char * (gdbarch_auto_charset_ftype) (void);
01184 extern const char * gdbarch_auto_charset (struct gdbarch *gdbarch);
01185 extern void set_gdbarch_auto_charset (struct gdbarch *gdbarch, gdbarch_auto_charset_ftype *auto_charset);
01186 
01187 /* Return the "auto" target wide charset. */
01188 
01189 typedef const char * (gdbarch_auto_wide_charset_ftype) (void);
01190 extern const char * gdbarch_auto_wide_charset (struct gdbarch *gdbarch);
01191 extern void set_gdbarch_auto_wide_charset (struct gdbarch *gdbarch, gdbarch_auto_wide_charset_ftype *auto_wide_charset);
01192 
01193 /* If non-empty, this is a file extension that will be opened in place
01194    of the file extension reported by the shared library list.
01195   
01196    This is most useful for toolchains that use a post-linker tool,
01197    where the names of the files run on the target differ in extension
01198    compared to the names of the files GDB should load for debug info. */
01199 
01200 extern const char * gdbarch_solib_symbols_extension (struct gdbarch *gdbarch);
01201 extern void set_gdbarch_solib_symbols_extension (struct gdbarch *gdbarch, const char * solib_symbols_extension);
01202 
01203 /* If true, the target OS has DOS-based file system semantics.  That
01204    is, absolute paths include a drive name, and the backslash is
01205    considered a directory separator. */
01206 
01207 extern int gdbarch_has_dos_based_file_system (struct gdbarch *gdbarch);
01208 extern void set_gdbarch_has_dos_based_file_system (struct gdbarch *gdbarch, int has_dos_based_file_system);
01209 
01210 /* Generate bytecodes to collect the return address in a frame.
01211    Since the bytecodes run on the target, possibly with GDB not even
01212    connected, the full unwinding machinery is not available, and
01213    typically this function will issue bytecodes for one or more likely
01214    places that the return address may be found. */
01215 
01216 typedef void (gdbarch_gen_return_address_ftype) (struct gdbarch *gdbarch, struct agent_expr *ax, struct axs_value *value, CORE_ADDR scope);
01217 extern void gdbarch_gen_return_address (struct gdbarch *gdbarch, struct agent_expr *ax, struct axs_value *value, CORE_ADDR scope);
01218 extern void set_gdbarch_gen_return_address (struct gdbarch *gdbarch, gdbarch_gen_return_address_ftype *gen_return_address);
01219 
01220 /* Implement the "info proc" command. */
01221 
01222 extern int gdbarch_info_proc_p (struct gdbarch *gdbarch);
01223 
01224 typedef void (gdbarch_info_proc_ftype) (struct gdbarch *gdbarch, char *args, enum info_proc_what what);
01225 extern void gdbarch_info_proc (struct gdbarch *gdbarch, char *args, enum info_proc_what what);
01226 extern void set_gdbarch_info_proc (struct gdbarch *gdbarch, gdbarch_info_proc_ftype *info_proc);
01227 
01228 /* Implement the "info proc" command for core files.  Noe that there
01229    are two "info_proc"-like methods on gdbarch -- one for core files,
01230    one for live targets. */
01231 
01232 extern int gdbarch_core_info_proc_p (struct gdbarch *gdbarch);
01233 
01234 typedef void (gdbarch_core_info_proc_ftype) (struct gdbarch *gdbarch, char *args, enum info_proc_what what);
01235 extern void gdbarch_core_info_proc (struct gdbarch *gdbarch, char *args, enum info_proc_what what);
01236 extern void set_gdbarch_core_info_proc (struct gdbarch *gdbarch, gdbarch_core_info_proc_ftype *core_info_proc);
01237 
01238 /* Iterate over all objfiles in the order that makes the most sense
01239    for the architecture to make global symbol searches.
01240   
01241    CB is a callback function where OBJFILE is the objfile to be searched,
01242    and CB_DATA a pointer to user-defined data (the same data that is passed
01243    when calling this gdbarch method).  The iteration stops if this function
01244    returns nonzero.
01245   
01246    CB_DATA is a pointer to some user-defined data to be passed to
01247    the callback.
01248   
01249    If not NULL, CURRENT_OBJFILE corresponds to the objfile being
01250    inspected when the symbol search was requested. */
01251 
01252 typedef void (gdbarch_iterate_over_objfiles_in_search_order_ftype) (struct gdbarch *gdbarch, iterate_over_objfiles_in_search_order_cb_ftype *cb, void *cb_data, struct objfile *current_objfile);
01253 extern void gdbarch_iterate_over_objfiles_in_search_order (struct gdbarch *gdbarch, iterate_over_objfiles_in_search_order_cb_ftype *cb, void *cb_data, struct objfile *current_objfile);
01254 extern void set_gdbarch_iterate_over_objfiles_in_search_order (struct gdbarch *gdbarch, gdbarch_iterate_over_objfiles_in_search_order_ftype *iterate_over_objfiles_in_search_order);
01255 
01256 /* Ravenscar arch-dependent ops. */
01257 
01258 extern struct ravenscar_arch_ops * gdbarch_ravenscar_ops (struct gdbarch *gdbarch);
01259 extern void set_gdbarch_ravenscar_ops (struct gdbarch *gdbarch, struct ravenscar_arch_ops * ravenscar_ops);
01260 
01261 /* Definition for an unknown syscall, used basically in error-cases.  */
01262 #define UNKNOWN_SYSCALL (-1)
01263 
01264 extern struct gdbarch_tdep *gdbarch_tdep (struct gdbarch *gdbarch);
01265 
01266 
01267 /* Mechanism for co-ordinating the selection of a specific
01268    architecture.
01269 
01270    GDB targets (*-tdep.c) can register an interest in a specific
01271    architecture.  Other GDB components can register a need to maintain
01272    per-architecture data.
01273 
01274    The mechanisms below ensures that there is only a loose connection
01275    between the set-architecture command and the various GDB
01276    components.  Each component can independently register their need
01277    to maintain architecture specific data with gdbarch.
01278 
01279    Pragmatics:
01280 
01281    Previously, a single TARGET_ARCHITECTURE_HOOK was provided.  It
01282    didn't scale.
01283 
01284    The more traditional mega-struct containing architecture specific
01285    data for all the various GDB components was also considered.  Since
01286    GDB is built from a variable number of (fairly independent)
01287    components it was determined that the global aproach was not
01288    applicable.  */
01289 
01290 
01291 /* Register a new architectural family with GDB.
01292 
01293    Register support for the specified ARCHITECTURE with GDB.  When
01294    gdbarch determines that the specified architecture has been
01295    selected, the corresponding INIT function is called.
01296 
01297    --
01298 
01299    The INIT function takes two parameters: INFO which contains the
01300    information available to gdbarch about the (possibly new)
01301    architecture; ARCHES which is a list of the previously created
01302    ``struct gdbarch'' for this architecture.
01303 
01304    The INFO parameter is, as far as possible, be pre-initialized with
01305    information obtained from INFO.ABFD or the global defaults.
01306 
01307    The ARCHES parameter is a linked list (sorted most recently used)
01308    of all the previously created architures for this architecture
01309    family.  The (possibly NULL) ARCHES->gdbarch can used to access
01310    values from the previously selected architecture for this
01311    architecture family.
01312 
01313    The INIT function shall return any of: NULL - indicating that it
01314    doesn't recognize the selected architecture; an existing ``struct
01315    gdbarch'' from the ARCHES list - indicating that the new
01316    architecture is just a synonym for an earlier architecture (see
01317    gdbarch_list_lookup_by_info()); a newly created ``struct gdbarch''
01318    - that describes the selected architecture (see gdbarch_alloc()).
01319 
01320    The DUMP_TDEP function shall print out all target specific values.
01321    Care should be taken to ensure that the function works in both the
01322    multi-arch and non- multi-arch cases.  */
01323 
01324 struct gdbarch_list
01325 {
01326   struct gdbarch *gdbarch;
01327   struct gdbarch_list *next;
01328 };
01329 
01330 struct gdbarch_info
01331 {
01332   /* Use default: NULL (ZERO).  */
01333   const struct bfd_arch_info *bfd_arch_info;
01334 
01335   /* Use default: BFD_ENDIAN_UNKNOWN (NB: is not ZERO).  */
01336   int byte_order;
01337 
01338   int byte_order_for_code;
01339 
01340   /* Use default: NULL (ZERO).  */
01341   bfd *abfd;
01342 
01343   /* Use default: NULL (ZERO).  */
01344   struct gdbarch_tdep_info *tdep_info;
01345 
01346   /* Use default: GDB_OSABI_UNINITIALIZED (-1).  */
01347   enum gdb_osabi osabi;
01348 
01349   /* Use default: NULL (ZERO).  */
01350   const struct target_desc *target_desc;
01351 };
01352 
01353 typedef struct gdbarch *(gdbarch_init_ftype) (struct gdbarch_info info, struct gdbarch_list *arches);
01354 typedef void (gdbarch_dump_tdep_ftype) (struct gdbarch *gdbarch, struct ui_file *file);
01355 
01356 /* DEPRECATED - use gdbarch_register() */
01357 extern void register_gdbarch_init (enum bfd_architecture architecture, gdbarch_init_ftype *);
01358 
01359 extern void gdbarch_register (enum bfd_architecture architecture,
01360                               gdbarch_init_ftype *,
01361                               gdbarch_dump_tdep_ftype *);
01362 
01363 
01364 /* Return a freshly allocated, NULL terminated, array of the valid
01365    architecture names.  Since architectures are registered during the
01366    _initialize phase this function only returns useful information
01367    once initialization has been completed.  */
01368 
01369 extern const char **gdbarch_printable_names (void);
01370 
01371 
01372 /* Helper function.  Search the list of ARCHES for a GDBARCH that
01373    matches the information provided by INFO.  */
01374 
01375 extern struct gdbarch_list *gdbarch_list_lookup_by_info (struct gdbarch_list *arches, const struct gdbarch_info *info);
01376 
01377 
01378 /* Helper function.  Create a preliminary ``struct gdbarch''.  Perform
01379    basic initialization using values obtained from the INFO and TDEP
01380    parameters.  set_gdbarch_*() functions are called to complete the
01381    initialization of the object.  */
01382 
01383 extern struct gdbarch *gdbarch_alloc (const struct gdbarch_info *info, struct gdbarch_tdep *tdep);
01384 
01385 
01386 /* Helper function.  Free a partially-constructed ``struct gdbarch''.
01387    It is assumed that the caller freeds the ``struct
01388    gdbarch_tdep''.  */
01389 
01390 extern void gdbarch_free (struct gdbarch *);
01391 
01392 
01393 /* Helper function.  Allocate memory from the ``struct gdbarch''
01394    obstack.  The memory is freed when the corresponding architecture
01395    is also freed.  */
01396 
01397 extern void *gdbarch_obstack_zalloc (struct gdbarch *gdbarch, long size);
01398 #define GDBARCH_OBSTACK_CALLOC(GDBARCH, NR, TYPE) ((TYPE *) gdbarch_obstack_zalloc ((GDBARCH), (NR) * sizeof (TYPE)))
01399 #define GDBARCH_OBSTACK_ZALLOC(GDBARCH, TYPE) ((TYPE *) gdbarch_obstack_zalloc ((GDBARCH), sizeof (TYPE)))
01400 
01401 
01402 /* Helper function.  Force an update of the current architecture.
01403 
01404    The actual architecture selected is determined by INFO, ``(gdb) set
01405    architecture'' et.al., the existing architecture and BFD's default
01406    architecture.  INFO should be initialized to zero and then selected
01407    fields should be updated.
01408 
01409    Returns non-zero if the update succeeds.  */
01410 
01411 extern int gdbarch_update_p (struct gdbarch_info info);
01412 
01413 
01414 /* Helper function.  Find an architecture matching info.
01415 
01416    INFO should be initialized using gdbarch_info_init, relevant fields
01417    set, and then finished using gdbarch_info_fill.
01418 
01419    Returns the corresponding architecture, or NULL if no matching
01420    architecture was found.  */
01421 
01422 extern struct gdbarch *gdbarch_find_by_info (struct gdbarch_info info);
01423 
01424 
01425 /* Helper function.  Set the target gdbarch to "gdbarch".  */
01426 
01427 extern void set_target_gdbarch (struct gdbarch *gdbarch);
01428 
01429 
01430 /* Register per-architecture data-pointer.
01431 
01432    Reserve space for a per-architecture data-pointer.  An identifier
01433    for the reserved data-pointer is returned.  That identifer should
01434    be saved in a local static variable.
01435 
01436    Memory for the per-architecture data shall be allocated using
01437    gdbarch_obstack_zalloc.  That memory will be deleted when the
01438    corresponding architecture object is deleted.
01439 
01440    When a previously created architecture is re-selected, the
01441    per-architecture data-pointer for that previous architecture is
01442    restored.  INIT() is not re-called.
01443 
01444    Multiple registrarants for any architecture are allowed (and
01445    strongly encouraged).  */
01446 
01447 struct gdbarch_data;
01448 
01449 typedef void *(gdbarch_data_pre_init_ftype) (struct obstack *obstack);
01450 extern struct gdbarch_data *gdbarch_data_register_pre_init (gdbarch_data_pre_init_ftype *init);
01451 typedef void *(gdbarch_data_post_init_ftype) (struct gdbarch *gdbarch);
01452 extern struct gdbarch_data *gdbarch_data_register_post_init (gdbarch_data_post_init_ftype *init);
01453 extern void deprecated_set_gdbarch_data (struct gdbarch *gdbarch,
01454                                          struct gdbarch_data *data,
01455                                          void *pointer);
01456 
01457 extern void *gdbarch_data (struct gdbarch *gdbarch, struct gdbarch_data *);
01458 
01459 
01460 /* Set the dynamic target-system-dependent parameters (architecture,
01461    byte-order, ...) using information found in the BFD.  */
01462 
01463 extern void set_gdbarch_from_file (bfd *);
01464 
01465 
01466 /* Initialize the current architecture to the "first" one we find on
01467    our list.  */
01468 
01469 extern void initialize_current_architecture (void);
01470 
01471 /* gdbarch trace variable */
01472 extern unsigned int gdbarch_debug;
01473 
01474 extern void gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file);
01475 
01476 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines