* gdbarch.sh (target_gdbarch): Remove macro.

(get_target_gdbarch): Rename to target_gdbarch.
	* gdbarch.c, gdbarch.h: Rebuild.
	* ada-tasks.c, aix-thread.c, amd64-linux-nat.c, arch-utils.c,
	arm-tdep.c, auxv.c, breakpoint.c, bsd-uthread.c, corefile.c,
	darwin-nat-info.c, dcache.c, dsrec.c, exec.c, fbsd-nat.c,
	filesystem.c, gcore.c, gnu-nat.c, i386-darwin-nat.c, i386-nat.c,
	ia64-vms-tdep.c, inf-ptrace.c, infcmd.c, jit.c, linux-nat.c,
	linux-tdep.c, linux-thread-db.c, m32r-rom.c, memattr.c,
	mep-tdep.c, microblaze-tdep.c, mips-linux-nat.c,
	mips-linux-tdep.c, mips-tdep.c, monitor.c, moxie-tdep.c,
	nto-procfs.c, nto-tdep.c, ppc-linux-nat.c, proc-service.c,
	procfs.c, progspace.c, ravenscar-thread.c, record.c,
	remote-m32r-sdi.c, remote-mips.c, remote-sim.c, remote.c,
	rl78-tdep.c, rs6000-nat.c, rx-tdep.c, s390-nat.c, sol-thread.c,
	solib-darwin.c, solib-dsbt.c, solib-frv.c, solib-ia64-hpux.c,
	solib-irix.c, solib-pa64.c, solib-som.c, solib-spu.c,
	solib-sunos.c, solib-svr4.c, solib.c, spu-linux-nat.c,
	spu-multiarch.c, spu-tdep.c, symfile-mem.c, symfile.c, symtab.c,
	target-descriptions.c, target.c, target.h, tracepoint.c,
	windows-nat.c, windows-tdep.c, xcoffsolib.c, cli/cli-dump.c,
	common/agent.c, mi/mi-interp.c, python/py-finishbreakpoint.c,
	python/py-inferior.c, python/python.c: Update.
This commit is contained in:
Tom Tromey 2012-11-09 19:58:03 +00:00
parent 0420f52b94
commit f5656eadf4
86 changed files with 410 additions and 386 deletions

View file

@ -1,3 +1,29 @@
2012-11-09 Tom Tromey <tromey@redhat.com>
* gdbarch.sh (target_gdbarch): Remove macro.
(get_target_gdbarch): Rename to target_gdbarch.
* gdbarch.c, gdbarch.h: Rebuild.
* ada-tasks.c, aix-thread.c, amd64-linux-nat.c, arch-utils.c,
arm-tdep.c, auxv.c, breakpoint.c, bsd-uthread.c, corefile.c,
darwin-nat-info.c, dcache.c, dsrec.c, exec.c, fbsd-nat.c,
filesystem.c, gcore.c, gnu-nat.c, i386-darwin-nat.c, i386-nat.c,
ia64-vms-tdep.c, inf-ptrace.c, infcmd.c, jit.c, linux-nat.c,
linux-tdep.c, linux-thread-db.c, m32r-rom.c, memattr.c,
mep-tdep.c, microblaze-tdep.c, mips-linux-nat.c,
mips-linux-tdep.c, mips-tdep.c, monitor.c, moxie-tdep.c,
nto-procfs.c, nto-tdep.c, ppc-linux-nat.c, proc-service.c,
procfs.c, progspace.c, ravenscar-thread.c, record.c,
remote-m32r-sdi.c, remote-mips.c, remote-sim.c, remote.c,
rl78-tdep.c, rs6000-nat.c, rx-tdep.c, s390-nat.c, sol-thread.c,
solib-darwin.c, solib-dsbt.c, solib-frv.c, solib-ia64-hpux.c,
solib-irix.c, solib-pa64.c, solib-som.c, solib-spu.c,
solib-sunos.c, solib-svr4.c, solib.c, spu-linux-nat.c,
spu-multiarch.c, spu-tdep.c, symfile-mem.c, symfile.c, symtab.c,
target-descriptions.c, target.c, target.h, tracepoint.c,
windows-nat.c, windows-tdep.c, xcoffsolib.c, cli/cli-dump.c,
common/agent.c, mi/mi-interp.c, python/py-finishbreakpoint.c,
python/py-inferior.c, python/python.c: Update.
2012-11-09 Andrew Burgess <aburgess@broadcom.com> 2012-11-09 Andrew Burgess <aburgess@broadcom.com>
* source.c (print_source_lines_base): Add fullname field giving * source.c (print_source_lines_base): Add fullname field giving

View file

@ -893,7 +893,7 @@ ada_tasks_inferior_data_sniffer (struct ada_tasks_inferior_data *data)
contains debug information on the task type (due to implicit with of contains debug information on the task type (due to implicit with of
Ada.Tasking). */ Ada.Tasking). */
data->known_tasks_element = data->known_tasks_element =
builtin_type (target_gdbarch)->builtin_data_ptr; builtin_type (target_gdbarch ())->builtin_data_ptr;
data->known_tasks_length = MAX_NUMBER_OF_KNOWN_TASKS; data->known_tasks_length = MAX_NUMBER_OF_KNOWN_TASKS;
return; return;
} }
@ -924,7 +924,7 @@ ada_tasks_inferior_data_sniffer (struct ada_tasks_inferior_data *data)
/* Fallback to default values. */ /* Fallback to default values. */
data->known_tasks_element = data->known_tasks_element =
builtin_type (target_gdbarch)->builtin_data_ptr; builtin_type (target_gdbarch ())->builtin_data_ptr;
data->known_tasks_length = 1; data->known_tasks_length = 1;
return; return;
} }
@ -1173,7 +1173,7 @@ info_task (struct ui_out *uiout, char *taskno_str, struct inferior *inf)
/* Print the Ada task ID. */ /* Print the Ada task ID. */
printf_filtered (_("Ada Task: %s\n"), printf_filtered (_("Ada Task: %s\n"),
paddress (target_gdbarch, task_info->task_id)); paddress (target_gdbarch (), task_info->task_id));
/* Print the name of the task. */ /* Print the name of the task. */
if (task_info->name[0] != '\0') if (task_info->name[0] != '\0')

View file

@ -887,7 +887,7 @@ pd_enable (void)
return; return;
/* Check application word size. */ /* Check application word size. */
arch64 = register_size (target_gdbarch, 0) == 8; arch64 = register_size (target_gdbarch (), 0) == 8;
/* Check whether the application is pthreaded. */ /* Check whether the application is pthreaded. */
stub_name = NULL; stub_name = NULL;
@ -901,7 +901,7 @@ pd_enable (void)
if (!(ms = lookup_minimal_symbol (stub_name, NULL, NULL))) if (!(ms = lookup_minimal_symbol (stub_name, NULL, NULL)))
return; return;
pd_brk_addr = SYMBOL_VALUE_ADDRESS (ms); pd_brk_addr = SYMBOL_VALUE_ADDRESS (ms);
if (!create_thread_event_breakpoint (target_gdbarch, pd_brk_addr)) if (!create_thread_event_breakpoint (target_gdbarch (), pd_brk_addr))
return; return;
/* Prepare for thread debugging. */ /* Prepare for thread debugging. */

View file

@ -443,7 +443,7 @@ ps_err_e
ps_get_thread_area (const struct ps_prochandle *ph, ps_get_thread_area (const struct ps_prochandle *ph,
lwpid_t lwpid, int idx, void **base) lwpid_t lwpid, int idx, void **base)
{ {
if (gdbarch_bfd_arch_info (target_gdbarch)->bits_per_word == 32) if (gdbarch_bfd_arch_info (target_gdbarch ())->bits_per_word == 32)
{ {
/* The full structure is found in <asm-i386/ldt.h>. The second /* The full structure is found in <asm-i386/ldt.h>. The second
integer is the LDT's base_address and that is used to locate integer is the LDT's base_address and that is used to locate

View file

@ -506,7 +506,7 @@ gdbarch_update_p (struct gdbarch_info info)
/* If it is the same old architecture, accept the request (but don't /* If it is the same old architecture, accept the request (but don't
swap anything). */ swap anything). */
if (new_gdbarch == target_gdbarch) if (new_gdbarch == target_gdbarch ())
{ {
if (gdbarch_debug) if (gdbarch_debug)
fprintf_unfiltered (gdb_stdlog, "gdbarch_update_p: " fprintf_unfiltered (gdb_stdlog, "gdbarch_update_p: "
@ -757,7 +757,7 @@ get_current_arch (void)
if (has_stack_frames ()) if (has_stack_frames ())
return get_frame_arch (get_selected_frame (NULL)); return get_frame_arch (get_selected_frame (NULL));
else else
return target_gdbarch; return target_gdbarch ();
} }
int int

View file

@ -9195,7 +9195,7 @@ arm_update_current_architecture (void)
struct gdbarch_info info; struct gdbarch_info info;
/* If the current architecture is not ARM, we have nothing to do. */ /* If the current architecture is not ARM, we have nothing to do. */
if (gdbarch_bfd_arch_info (target_gdbarch)->arch != bfd_arch_arm) if (gdbarch_bfd_arch_info (target_gdbarch ())->arch != bfd_arch_arm)
return; return;
/* Update the architecture. */ /* Update the architecture. */
@ -9229,10 +9229,10 @@ static void
show_fp_model (struct ui_file *file, int from_tty, show_fp_model (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value) struct cmd_list_element *c, const char *value)
{ {
struct gdbarch_tdep *tdep = gdbarch_tdep (target_gdbarch); struct gdbarch_tdep *tdep = gdbarch_tdep (target_gdbarch ());
if (arm_fp_model == ARM_FLOAT_AUTO if (arm_fp_model == ARM_FLOAT_AUTO
&& gdbarch_bfd_arch_info (target_gdbarch)->arch == bfd_arch_arm) && gdbarch_bfd_arch_info (target_gdbarch ())->arch == bfd_arch_arm)
fprintf_filtered (file, _("\ fprintf_filtered (file, _("\
The current ARM floating point model is \"auto\" (currently \"%s\").\n"), The current ARM floating point model is \"auto\" (currently \"%s\").\n"),
fp_model_strings[tdep->fp_model]); fp_model_strings[tdep->fp_model]);
@ -9266,10 +9266,10 @@ static void
arm_show_abi (struct ui_file *file, int from_tty, arm_show_abi (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value) struct cmd_list_element *c, const char *value)
{ {
struct gdbarch_tdep *tdep = gdbarch_tdep (target_gdbarch); struct gdbarch_tdep *tdep = gdbarch_tdep (target_gdbarch ());
if (arm_abi_global == ARM_ABI_AUTO if (arm_abi_global == ARM_ABI_AUTO
&& gdbarch_bfd_arch_info (target_gdbarch)->arch == bfd_arch_arm) && gdbarch_bfd_arch_info (target_gdbarch ())->arch == bfd_arch_arm)
fprintf_filtered (file, _("\ fprintf_filtered (file, _("\
The current ARM ABI is \"auto\" (currently \"%s\").\n"), The current ARM ABI is \"auto\" (currently \"%s\").\n"),
arm_abi_strings[tdep->arm_abi]); arm_abi_strings[tdep->arm_abi]);
@ -9292,7 +9292,7 @@ static void
arm_show_force_mode (struct ui_file *file, int from_tty, arm_show_force_mode (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value) struct cmd_list_element *c, const char *value)
{ {
struct gdbarch_tdep *tdep = gdbarch_tdep (target_gdbarch); struct gdbarch_tdep *tdep = gdbarch_tdep (target_gdbarch ());
fprintf_filtered (file, fprintf_filtered (file,
_("The current execution mode assumed " _("The current execution mode assumed "

View file

@ -76,7 +76,7 @@ ld_so_xfer_auxv (gdb_byte *readbuf,
{ {
struct minimal_symbol *msym; struct minimal_symbol *msym;
CORE_ADDR data_address, pointer_address; CORE_ADDR data_address, pointer_address;
struct type *ptr_type = builtin_type (target_gdbarch)->builtin_data_ptr; struct type *ptr_type = builtin_type (target_gdbarch ())->builtin_data_ptr;
size_t ptr_size = TYPE_LENGTH (ptr_type); size_t ptr_size = TYPE_LENGTH (ptr_type);
size_t auxv_pair_size = 2 * ptr_size; size_t auxv_pair_size = 2 * ptr_size;
gdb_byte *ptr_buf = alloca (ptr_size); gdb_byte *ptr_buf = alloca (ptr_size);
@ -240,9 +240,9 @@ static int
default_auxv_parse (struct target_ops *ops, gdb_byte **readptr, default_auxv_parse (struct target_ops *ops, gdb_byte **readptr,
gdb_byte *endptr, CORE_ADDR *typep, CORE_ADDR *valp) gdb_byte *endptr, CORE_ADDR *typep, CORE_ADDR *valp)
{ {
const int sizeof_auxv_field = gdbarch_ptr_bit (target_gdbarch) const int sizeof_auxv_field = gdbarch_ptr_bit (target_gdbarch ())
/ TARGET_CHAR_BIT; / TARGET_CHAR_BIT;
const enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch); const enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
gdb_byte *ptr = *readptr; gdb_byte *ptr = *readptr;
if (endptr == ptr) if (endptr == ptr)
@ -479,7 +479,7 @@ fprint_target_auxv (struct ui_file *file, struct target_ops *ops)
fprintf_filtered (file, "%s\n", plongest (val)); fprintf_filtered (file, "%s\n", plongest (val));
break; break;
case hex: case hex:
fprintf_filtered (file, "%s\n", paddress (target_gdbarch, val)); fprintf_filtered (file, "%s\n", paddress (target_gdbarch (), val));
break; break;
case str: case str:
{ {
@ -487,8 +487,8 @@ fprint_target_auxv (struct ui_file *file, struct target_ops *ops)
get_user_print_options (&opts); get_user_print_options (&opts);
if (opts.addressprint) if (opts.addressprint)
fprintf_filtered (file, "%s ", paddress (target_gdbarch, val)); fprintf_filtered (file, "%s ", paddress (target_gdbarch (), val));
val_print_string (builtin_type (target_gdbarch)->builtin_char, val_print_string (builtin_type (target_gdbarch ())->builtin_char,
NULL, val, -1, file, &opts); NULL, val, -1, file, &opts);
fprintf_filtered (file, "\n"); fprintf_filtered (file, "\n");
} }

View file

@ -2792,7 +2792,7 @@ update_inserted_breakpoint_locations (void)
to select an inferior to insert breakpoint to. In fact, even to select an inferior to insert breakpoint to. In fact, even
if we aren't attached to any process yet, we should still if we aren't attached to any process yet, we should still
insert breakpoints. */ insert breakpoints. */
if (!gdbarch_has_global_breakpoints (target_gdbarch) if (!gdbarch_has_global_breakpoints (target_gdbarch ())
&& ptid_equal (inferior_ptid, null_ptid)) && ptid_equal (inferior_ptid, null_ptid))
continue; continue;
@ -2851,7 +2851,7 @@ insert_breakpoint_locations (void)
to select an inferior to insert breakpoint to. In fact, even to select an inferior to insert breakpoint to. In fact, even
if we aren't attached to any process yet, we should still if we aren't attached to any process yet, we should still
insert breakpoints. */ insert breakpoints. */
if (!gdbarch_has_global_breakpoints (target_gdbarch) if (!gdbarch_has_global_breakpoints (target_gdbarch ())
&& ptid_equal (inferior_ptid, null_ptid)) && ptid_equal (inferior_ptid, null_ptid))
continue; continue;
@ -3732,7 +3732,7 @@ breakpoint_init_inferior (enum inf_context context)
/* If breakpoint locations are shared across processes, then there's /* If breakpoint locations are shared across processes, then there's
nothing to do. */ nothing to do. */
if (gdbarch_has_global_breakpoints (target_gdbarch)) if (gdbarch_has_global_breakpoints (target_gdbarch ()))
return; return;
ALL_BP_LOCATIONS (bl, blp_tmp) ALL_BP_LOCATIONS (bl, blp_tmp)
@ -5936,7 +5936,7 @@ print_one_breakpoint_location (struct breakpoint *b,
if (loc != NULL if (loc != NULL
&& !header_of_multiple && !header_of_multiple
&& (allflag && (allflag
|| (!gdbarch_has_global_breakpoints (target_gdbarch) || (!gdbarch_has_global_breakpoints (target_gdbarch ())
&& (number_of_program_spaces () > 1 && (number_of_program_spaces () > 1
|| number_of_inferiors () > 1) || number_of_inferiors () > 1)
/* LOC is for existing B, it cannot be in /* LOC is for existing B, it cannot be in
@ -6596,7 +6596,7 @@ static int
breakpoint_address_match (struct address_space *aspace1, CORE_ADDR addr1, breakpoint_address_match (struct address_space *aspace1, CORE_ADDR addr1,
struct address_space *aspace2, CORE_ADDR addr2) struct address_space *aspace2, CORE_ADDR addr2)
{ {
return ((gdbarch_has_global_breakpoints (target_gdbarch) return ((gdbarch_has_global_breakpoints (target_gdbarch ())
|| aspace1 == aspace2) || aspace1 == aspace2)
&& addr1 == addr2); && addr1 == addr2);
} }
@ -6611,7 +6611,7 @@ breakpoint_address_match_range (struct address_space *aspace1, CORE_ADDR addr1,
int len1, struct address_space *aspace2, int len1, struct address_space *aspace2,
CORE_ADDR addr2) CORE_ADDR addr2)
{ {
return ((gdbarch_has_global_breakpoints (target_gdbarch) return ((gdbarch_has_global_breakpoints (target_gdbarch ())
|| aspace1 == aspace2) || aspace1 == aspace2)
&& addr2 >= addr1 && addr2 < addr1 + len1); && addr2 >= addr1 && addr2 < addr1 + len1);
} }
@ -12529,7 +12529,7 @@ update_global_location_list (int should_insert)
if (breakpoints_always_inserted_mode () if (breakpoints_always_inserted_mode ()
&& (have_live_inferiors () && (have_live_inferiors ()
|| (gdbarch_has_global_breakpoints (target_gdbarch)))) || (gdbarch_has_global_breakpoints (target_gdbarch ()))))
{ {
if (should_insert) if (should_insert)
insert_breakpoint_locations (); insert_breakpoint_locations ();

View file

@ -93,7 +93,7 @@ bsd_uthread_set_collect_uthread (struct gdbarch *gdbarch,
static void static void
bsd_uthread_check_magic (CORE_ADDR addr) bsd_uthread_check_magic (CORE_ADDR addr)
{ {
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
ULONGEST magic = read_memory_unsigned_integer (addr, 4, byte_order); ULONGEST magic = read_memory_unsigned_integer (addr, 4, byte_order);
if (magic != BSD_UTHREAD_PTHREAD_MAGIC) if (magic != BSD_UTHREAD_PTHREAD_MAGIC)
@ -137,7 +137,7 @@ bsd_uthread_lookup_address (const char *name, struct objfile *objfile)
static int static int
bsd_uthread_lookup_offset (const char *name, struct objfile *objfile) bsd_uthread_lookup_offset (const char *name, struct objfile *objfile)
{ {
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
CORE_ADDR addr; CORE_ADDR addr;
addr = bsd_uthread_lookup_address (name, objfile); addr = bsd_uthread_lookup_address (name, objfile);
@ -150,7 +150,7 @@ bsd_uthread_lookup_offset (const char *name, struct objfile *objfile)
static CORE_ADDR static CORE_ADDR
bsd_uthread_read_memory_address (CORE_ADDR addr) bsd_uthread_read_memory_address (CORE_ADDR addr)
{ {
struct type *ptr_type = builtin_type (target_gdbarch)->builtin_data_ptr; struct type *ptr_type = builtin_type (target_gdbarch ())->builtin_data_ptr;
return read_memory_typed_address (addr, ptr_type); return read_memory_typed_address (addr, ptr_type);
} }
@ -161,7 +161,7 @@ bsd_uthread_read_memory_address (CORE_ADDR addr)
static int static int
bsd_uthread_activate (struct objfile *objfile) bsd_uthread_activate (struct objfile *objfile)
{ {
struct gdbarch *gdbarch = target_gdbarch; struct gdbarch *gdbarch = target_gdbarch ();
struct bsd_uthread_ops *ops = gdbarch_data (gdbarch, bsd_uthread_data); struct bsd_uthread_ops *ops = gdbarch_data (gdbarch, bsd_uthread_data);
/* Skip if the thread stratum has already been activated. */ /* Skip if the thread stratum has already been activated. */
@ -349,7 +349,7 @@ static ptid_t
bsd_uthread_wait (struct target_ops *ops, bsd_uthread_wait (struct target_ops *ops,
ptid_t ptid, struct target_waitstatus *status, int options) ptid_t ptid, struct target_waitstatus *status, int options)
{ {
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
CORE_ADDR addr; CORE_ADDR addr;
struct target_ops *beneath = find_target_beneath (ops); struct target_ops *beneath = find_target_beneath (ops);
@ -407,7 +407,7 @@ bsd_uthread_resume (struct target_ops *ops,
static int static int
bsd_uthread_thread_alive (struct target_ops *ops, ptid_t ptid) bsd_uthread_thread_alive (struct target_ops *ops, ptid_t ptid)
{ {
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
struct target_ops *beneath = find_target_beneath (ops); struct target_ops *beneath = find_target_beneath (ops);
CORE_ADDR addr = ptid_get_tid (inferior_ptid); CORE_ADDR addr = ptid_get_tid (inferior_ptid);
@ -484,7 +484,7 @@ static char *bsd_uthread_state[] =
static char * static char *
bsd_uthread_extra_thread_info (struct thread_info *info) bsd_uthread_extra_thread_info (struct thread_info *info)
{ {
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
CORE_ADDR addr = ptid_get_tid (info->ptid); CORE_ADDR addr = ptid_get_tid (info->ptid);
if (addr != 0) if (addr != 0)

View file

@ -486,10 +486,10 @@ restore_section_callback (bfd *ibfd, asection *isec, void *args)
if (data->load_offset != 0 || data->load_start != 0 || data->load_end != 0) if (data->load_offset != 0 || data->load_start != 0 || data->load_end != 0)
printf_filtered (" into memory (%s to %s)\n", printf_filtered (" into memory (%s to %s)\n",
paddress (target_gdbarch, paddress (target_gdbarch (),
(unsigned long) sec_start (unsigned long) sec_start
+ sec_offset + data->load_offset), + sec_offset + data->load_offset),
paddress (target_gdbarch, paddress (target_gdbarch (),
(unsigned long) sec_start + sec_offset (unsigned long) sec_start + sec_offset
+ data->load_offset + sec_load_count)); + data->load_offset + sec_load_count));
else else

View file

@ -125,7 +125,7 @@ agent_get_helper_thread_id (void)
(unsigned char *) &helper_thread_id, (unsigned char *) &helper_thread_id,
sizeof helper_thread_id)) sizeof helper_thread_id))
#else #else
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
gdb_byte buf[4]; gdb_byte buf[4];
if (target_read_memory (ipa_sym_addrs.addr_helper_thread_id, if (target_read_memory (ipa_sym_addrs.addr_helper_thread_id,
@ -332,7 +332,7 @@ agent_capability_check (enum agent_capa agent_capa)
(unsigned char *) &agent_capability, (unsigned char *) &agent_capability,
sizeof agent_capability)) sizeof agent_capability))
#else #else
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
gdb_byte buf[4]; gdb_byte buf[4];
if (target_read_memory (ipa_sym_addrs.addr_capability, if (target_read_memory (ipa_sym_addrs.addr_capability,

View file

@ -203,11 +203,11 @@ memory_error (int status, CORE_ADDR memaddr)
bounds. */ bounds. */
throw_error (MEMORY_ERROR, throw_error (MEMORY_ERROR,
_("Cannot access memory at address %s"), _("Cannot access memory at address %s"),
paddress (target_gdbarch, memaddr)); paddress (target_gdbarch (), memaddr));
else else
throw_error (MEMORY_ERROR, throw_error (MEMORY_ERROR,
_("Error accessing memory address %s: %s."), _("Error accessing memory address %s: %s."),
paddress (target_gdbarch, memaddr), paddress (target_gdbarch (), memaddr),
safe_strerror (status)); safe_strerror (status));
} }

View file

@ -573,8 +573,8 @@ darwin_debug_regions (task_t task, mach_vm_address_t address, int max)
if (print) if (print)
{ {
printf_filtered (_("%s-%s %s/%s %s %s %s"), printf_filtered (_("%s-%s %s/%s %s %s %s"),
paddress (target_gdbarch, prev_address), paddress (target_gdbarch (), prev_address),
paddress (target_gdbarch, prev_address + prev_size), paddress (target_gdbarch (), prev_address + prev_size),
unparse_protection (prev_info.protection), unparse_protection (prev_info.protection),
unparse_protection (prev_info.max_protection), unparse_protection (prev_info.max_protection),
unparse_inheritance (prev_info.inheritance), unparse_inheritance (prev_info.inheritance),
@ -623,7 +623,7 @@ darwin_debug_regions_recurse (task_t task)
table_chain = make_cleanup_ui_out_table_begin_end (uiout, 9, -1, "regions"); table_chain = make_cleanup_ui_out_table_begin_end (uiout, 9, -1, "regions");
if (gdbarch_addr_bit (target_gdbarch) <= 32) if (gdbarch_addr_bit (target_gdbarch ()) <= 32)
{ {
ui_out_table_header (uiout, 10, ui_left, "start", "Start"); ui_out_table_header (uiout, 10, ui_left, "start", "Start");
ui_out_table_header (uiout, 10, ui_left, "end", "End"); ui_out_table_header (uiout, 10, ui_left, "end", "End");
@ -659,8 +659,8 @@ darwin_debug_regions_recurse (task_t task)
break; break;
row_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "regions-row"); row_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "regions-row");
ui_out_field_core_addr (uiout, "start", target_gdbarch, r_start); ui_out_field_core_addr (uiout, "start", target_gdbarch (), r_start);
ui_out_field_core_addr (uiout, "end", target_gdbarch, r_start + r_size); ui_out_field_core_addr (uiout, "end", target_gdbarch (), r_start + r_size);
ui_out_field_string (uiout, "min-prot", ui_out_field_string (uiout, "min-prot",
unparse_protection (r_info.protection)); unparse_protection (r_info.protection));
ui_out_field_string (uiout, "max-prot", ui_out_field_string (uiout, "max-prot",

View file

@ -589,7 +589,7 @@ dcache_print_line (int index)
db = (struct dcache_block *) n->value; db = (struct dcache_block *) n->value;
printf_filtered (_("Line %d: address %s [%d hits]\n"), printf_filtered (_("Line %d: address %s [%d hits]\n"),
index, paddress (target_gdbarch, db->addr), db->refs); index, paddress (target_gdbarch (), db->addr), db->refs);
for (j = 0; j < last_cache->line_size; j++) for (j = 0; j < last_cache->line_size; j++)
{ {
@ -647,7 +647,7 @@ dcache_info (char *exp, int tty)
struct dcache_block *db = (struct dcache_block *) n->value; struct dcache_block *db = (struct dcache_block *) n->value;
printf_filtered (_("Line %d: address %s [%d hits]\n"), printf_filtered (_("Line %d: address %s [%d hits]\n"),
i, paddress (target_gdbarch, db->addr), db->refs); i, paddress (target_gdbarch (), db->addr), db->refs);
i++; i++;
refcount += db->refs; refcount += db->refs;

View file

@ -104,8 +104,8 @@ load_srec (struct serial *desc, const char *file, bfd_vma load_offset,
have also been used. cagney 1999-09-01 */ have also been used. cagney 1999-09-01 */
printf_filtered ("%s\t: %s .. %s ", printf_filtered ("%s\t: %s .. %s ",
section_name, section_name,
paddress (target_gdbarch, addr), paddress (target_gdbarch (), addr),
paddress (target_gdbarch, addr + size)); paddress (target_gdbarch (), addr + size));
gdb_flush (gdb_stdout); gdb_flush (gdb_stdout);
data_count += size; data_count += size;
@ -259,7 +259,7 @@ make_srec (char *srec, CORE_ADDR targ_addr, bfd *abfd, asection *sect,
else else
internal_error (__FILE__, __LINE__, internal_error (__FILE__, __LINE__,
_("make_srec: Bad address (%s), or bad flags (0x%x)."), _("make_srec: Bad address (%s), or bad flags (0x%x)."),
paddress (target_gdbarch, targ_addr), flags); paddress (target_gdbarch (), targ_addr), flags);
/* Now that we know the address size, we can figure out how much /* Now that we know the address size, we can figure out how much
data this record can hold. */ data this record can hold. */

View file

@ -767,7 +767,7 @@ exec_files_info (struct target_ops *t)
if (vmap) if (vmap)
{ {
int addr_size = gdbarch_addr_bit (target_gdbarch) / 8; int addr_size = gdbarch_addr_bit (target_gdbarch ()) / 8;
struct vmap *vp; struct vmap *vp;
printf_unfiltered (_("\tMapping info for file `%s'.\n"), vmap->name); printf_unfiltered (_("\tMapping info for file `%s'.\n"), vmap->name);

View file

@ -125,7 +125,7 @@ fbsd_find_memory_regions (find_memory_region_ftype func, void *obfd)
{ {
fprintf_filtered (gdb_stdout, fprintf_filtered (gdb_stdout,
"Save segment, %ld bytes at %s (%c%c%c)\n", "Save segment, %ld bytes at %s (%c%c%c)\n",
size, paddress (target_gdbarch, start), size, paddress (target_gdbarch (), start),
read ? 'r' : '-', read ? 'r' : '-',
write ? 'w' : '-', write ? 'w' : '-',
exec ? 'x' : '-'); exec ? 'x' : '-');

View file

@ -39,7 +39,7 @@ effective_target_file_system_kind (void)
{ {
if (target_file_system_kind == file_system_kind_auto) if (target_file_system_kind == file_system_kind_auto)
{ {
if (gdbarch_has_dos_based_file_system (target_gdbarch)) if (gdbarch_has_dos_based_file_system (target_gdbarch ()))
return file_system_kind_dos_based; return file_system_kind_dos_based;
else else
return file_system_kind_unix; return file_system_kind_unix;

View file

@ -75,10 +75,10 @@ write_gcore_file (bfd *obfd)
/* FIXME: uweigand/2011-10-06: All architectures that support core file /* FIXME: uweigand/2011-10-06: All architectures that support core file
generation should be converted to gdbarch_make_corefile_notes; at that generation should be converted to gdbarch_make_corefile_notes; at that
point, the target vector method can be removed. */ point, the target vector method can be removed. */
if (!gdbarch_make_corefile_notes_p (target_gdbarch)) if (!gdbarch_make_corefile_notes_p (target_gdbarch ()))
note_data = target_make_corefile_notes (obfd, &note_size); note_data = target_make_corefile_notes (obfd, &note_size);
else else
note_data = gdbarch_make_corefile_notes (target_gdbarch, obfd, &note_size); note_data = gdbarch_make_corefile_notes (target_gdbarch (), obfd, &note_size);
if (note_data == NULL || note_size == 0) if (note_data == NULL || note_size == 0)
error (_("Target does not support core file generation.")); error (_("Target does not support core file generation."));
@ -165,7 +165,7 @@ default_gcore_mach (void)
return 0; return 0;
#else #else
const struct bfd_arch_info *bfdarch = gdbarch_bfd_arch_info (target_gdbarch); const struct bfd_arch_info *bfdarch = gdbarch_bfd_arch_info (target_gdbarch ());
if (bfdarch != NULL) if (bfdarch != NULL)
return bfdarch->mach; return bfdarch->mach;
@ -179,7 +179,7 @@ default_gcore_mach (void)
static enum bfd_architecture static enum bfd_architecture
default_gcore_arch (void) default_gcore_arch (void)
{ {
const struct bfd_arch_info *bfdarch = gdbarch_bfd_arch_info (target_gdbarch); const struct bfd_arch_info *bfdarch = gdbarch_bfd_arch_info (target_gdbarch ());
if (bfdarch != NULL) if (bfdarch != NULL)
return bfdarch->arch; return bfdarch->arch;
@ -193,8 +193,8 @@ static const char *
default_gcore_target (void) default_gcore_target (void)
{ {
/* The gdbarch may define a target to use for core files. */ /* The gdbarch may define a target to use for core files. */
if (gdbarch_gcore_bfd_target_p (target_gdbarch)) if (gdbarch_gcore_bfd_target_p (target_gdbarch ()))
return gdbarch_gcore_bfd_target (target_gdbarch); return gdbarch_gcore_bfd_target (target_gdbarch ());
/* Otherwise, try to fall back to the exec_bfd target. This will probably /* Otherwise, try to fall back to the exec_bfd target. This will probably
not work for non-ELF targets. */ not work for non-ELF targets. */
@ -398,7 +398,7 @@ gcore_create_callback (CORE_ADDR vaddr, unsigned long size, int read,
if (info_verbose) if (info_verbose)
{ {
fprintf_filtered (gdb_stdout, "Ignore segment, %s bytes at %s\n", fprintf_filtered (gdb_stdout, "Ignore segment, %s bytes at %s\n",
plongest (size), paddress (target_gdbarch, vaddr)); plongest (size), paddress (target_gdbarch (), vaddr));
} }
return 0; return 0;
@ -458,7 +458,7 @@ gcore_create_callback (CORE_ADDR vaddr, unsigned long size, int read,
if (info_verbose) if (info_verbose)
{ {
fprintf_filtered (gdb_stdout, "Save segment, %s bytes at %s\n", fprintf_filtered (gdb_stdout, "Save segment, %s bytes at %s\n",
plongest (size), paddress (target_gdbarch, vaddr)); plongest (size), paddress (target_gdbarch (), vaddr));
} }
bfd_set_section_size (obfd, osec, size); bfd_set_section_size (obfd, osec, size);
@ -554,7 +554,7 @@ gcore_copy_callback (bfd *obfd, asection *osec, void *ignored)
warning (_("Memory read failed for corefile " warning (_("Memory read failed for corefile "
"section, %s bytes at %s."), "section, %s bytes at %s."),
plongest (size), plongest (size),
paddress (target_gdbarch, bfd_section_vma (obfd, osec))); paddress (target_gdbarch (), bfd_section_vma (obfd, osec)));
break; break;
} }
if (!bfd_set_section_contents (obfd, osec, memhunk, offset, size)) if (!bfd_set_section_contents (obfd, osec, memhunk, offset, size))
@ -575,8 +575,8 @@ static int
gcore_memory_sections (bfd *obfd) gcore_memory_sections (bfd *obfd)
{ {
/* Try gdbarch method first, then fall back to target method. */ /* Try gdbarch method first, then fall back to target method. */
if (!gdbarch_find_memory_regions_p (target_gdbarch) if (!gdbarch_find_memory_regions_p (target_gdbarch ())
|| gdbarch_find_memory_regions (target_gdbarch, || gdbarch_find_memory_regions (target_gdbarch (),
gcore_create_callback, obfd) != 0) gcore_create_callback, obfd) != 0)
{ {
if (target_find_memory_regions (gcore_create_callback, obfd) != 0) if (target_find_memory_regions (gcore_create_callback, obfd) != 0)

View file

@ -4675,10 +4675,10 @@ deprecated_target_gdbarch_select_hack (struct gdbarch *new_gdbarch)
registers_changed (); registers_changed ();
} }
/* Helper for 'target_gdbarch'. */ /* Return the current inferior's arch. */
struct gdbarch * struct gdbarch *
get_target_gdbarch (void) target_gdbarch (void)
{ {
return current_inferior ()->gdbarch; return current_inferior ()->gdbarch;
} }

View file

@ -71,8 +71,7 @@ struct stap_parse_info;
gdbarch. */ gdbarch. */
/* This is a convenience wrapper for 'current_inferior ()->gdbarch'. */ /* This is a convenience wrapper for 'current_inferior ()->gdbarch'. */
#define target_gdbarch get_target_gdbarch () extern struct gdbarch *target_gdbarch (void);
extern struct gdbarch *get_target_gdbarch (void);
/* The initial, default architecture. It uses host values (for want of a better /* The initial, default architecture. It uses host values (for want of a better
choice). */ choice). */

View file

@ -1089,8 +1089,7 @@ struct stap_parse_info;
gdbarch. */ gdbarch. */
/* This is a convenience wrapper for 'current_inferior ()->gdbarch'. */ /* This is a convenience wrapper for 'current_inferior ()->gdbarch'. */
#define target_gdbarch get_target_gdbarch () extern struct gdbarch *target_gdbarch (void);
extern struct gdbarch *get_target_gdbarch (void);
/* The initial, default architecture. It uses host values (for want of a better /* The initial, default architecture. It uses host values (for want of a better
choice). */ choice). */
@ -2291,10 +2290,10 @@ deprecated_target_gdbarch_select_hack (struct gdbarch *new_gdbarch)
registers_changed (); registers_changed ();
} }
/* Helper for 'target_gdbarch'. */ /* Return the current inferior's arch. */
struct gdbarch * struct gdbarch *
get_target_gdbarch (void) target_gdbarch (void)
{ {
return current_inferior ()->gdbarch; return current_inferior ()->gdbarch;
} }

View file

@ -2491,7 +2491,7 @@ gnu_xfer_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len, int write,
{ {
inf_debug (gnu_current_inf, "%s %s[%d] %s %s", inf_debug (gnu_current_inf, "%s %s[%d] %s %s",
write ? "writing" : "reading", write ? "writing" : "reading",
paddress (target_gdbarch, memaddr), len, paddress (target_gdbarch (), memaddr), len,
write ? "<--" : "-->", host_address_to_string (myaddr)); write ? "<--" : "-->", host_address_to_string (myaddr));
if (write) if (write)
return gnu_write_inferior (task, memaddr, myaddr, len); return gnu_write_inferior (task, memaddr, myaddr, len);

View file

@ -415,7 +415,7 @@ i386_darwin_dr_get_control (void)
void void
darwin_check_osabi (darwin_inferior *inf, thread_t thread) darwin_check_osabi (darwin_inferior *inf, thread_t thread)
{ {
if (gdbarch_osabi (target_gdbarch) == GDB_OSABI_UNKNOWN) if (gdbarch_osabi (target_gdbarch ()) == GDB_OSABI_UNKNOWN)
{ {
/* Attaching to a process. Let's figure out what kind it is. */ /* Attaching to a process. Let's figure out what kind it is. */
x86_thread_state_t gp_regs; x86_thread_state_t gp_regs;
@ -433,7 +433,7 @@ darwin_check_osabi (darwin_inferior *inf, thread_t thread)
gdbarch_info_init (&info); gdbarch_info_init (&info);
gdbarch_info_fill (&info); gdbarch_info_fill (&info);
info.byte_order = gdbarch_byte_order (target_gdbarch); info.byte_order = gdbarch_byte_order (target_gdbarch ());
info.osabi = GDB_OSABI_DARWIN; info.osabi = GDB_OSABI_DARWIN;
if (gp_regs.tsh.flavor == x86_THREAD_STATE64) if (gp_regs.tsh.flavor == x86_THREAD_STATE64)
info.bfd_arch_info = bfd_lookup_arch (bfd_arch_i386, info.bfd_arch_info = bfd_lookup_arch (bfd_arch_i386,
@ -457,7 +457,7 @@ darwin_check_osabi (darwin_inferior *inf, thread_t thread)
static int static int
i386_darwin_sstep_at_sigreturn (x86_thread_state_t *regs) i386_darwin_sstep_at_sigreturn (x86_thread_state_t *regs)
{ {
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
static const gdb_byte darwin_syscall[] = { 0xcd, 0x80 }; /* int 0x80 */ static const gdb_byte darwin_syscall[] = { 0xcd, 0x80 }; /* int 0x80 */
gdb_byte buf[sizeof (darwin_syscall)]; gdb_byte buf[sizeof (darwin_syscall)];
@ -490,7 +490,7 @@ i386_darwin_sstep_at_sigreturn (x86_thread_state_t *regs)
static int static int
amd64_darwin_sstep_at_sigreturn (x86_thread_state_t *regs) amd64_darwin_sstep_at_sigreturn (x86_thread_state_t *regs)
{ {
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
static const gdb_byte darwin_syscall[] = { 0x0f, 0x05 }; /* syscall */ static const gdb_byte darwin_syscall[] = { 0x0f, 0x05 }; /* syscall */
gdb_byte buf[sizeof (darwin_syscall)]; gdb_byte buf[sizeof (darwin_syscall)];

View file

@ -318,7 +318,7 @@ i386_show_dr (struct i386_debug_reg_state *state,
const char *func, CORE_ADDR addr, const char *func, CORE_ADDR addr,
int len, enum target_hw_bp_type type) int len, enum target_hw_bp_type type)
{ {
int addr_size = gdbarch_addr_bit (target_gdbarch) / 8; int addr_size = gdbarch_addr_bit (target_gdbarch ()) / 8;
int i; int i;
puts_unfiltered (func); puts_unfiltered (func);

View file

@ -33,7 +33,7 @@ ia64_vms_find_proc_info_x (unw_addr_space_t as, unw_word_t ip,
unw_proc_info_t *pi, unw_proc_info_t *pi,
int need_unwind_info, void *arg) int need_unwind_info, void *arg)
{ {
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
unw_dyn_info_t di; unw_dyn_info_t di;
int ret; int ret;
gdb_byte buf[32]; gdb_byte buf[32];

View file

@ -649,11 +649,11 @@ static int
inf_ptrace_auxv_parse (struct target_ops *ops, gdb_byte **readptr, inf_ptrace_auxv_parse (struct target_ops *ops, gdb_byte **readptr,
gdb_byte *endptr, CORE_ADDR *typep, CORE_ADDR *valp) gdb_byte *endptr, CORE_ADDR *typep, CORE_ADDR *valp)
{ {
struct type *int_type = builtin_type (target_gdbarch)->builtin_int; struct type *int_type = builtin_type (target_gdbarch ())->builtin_int;
struct type *ptr_type = builtin_type (target_gdbarch)->builtin_data_ptr; struct type *ptr_type = builtin_type (target_gdbarch ())->builtin_data_ptr;
const int sizeof_auxv_type = TYPE_LENGTH (int_type); const int sizeof_auxv_type = TYPE_LENGTH (int_type);
const int sizeof_auxv_val = TYPE_LENGTH (ptr_type); const int sizeof_auxv_val = TYPE_LENGTH (ptr_type);
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
gdb_byte *ptr = *readptr; gdb_byte *ptr = *readptr;
if (endptr == ptr) if (endptr == ptr)

View file

@ -469,7 +469,7 @@ post_create_inferior (struct target_ops *target, int from_tty)
/* If the solist is global across processes, there's no need to /* If the solist is global across processes, there's no need to
refetch it here. */ refetch it here. */
if (!gdbarch_has_global_solist (target_gdbarch)) if (!gdbarch_has_global_solist (target_gdbarch ()))
{ {
#ifdef SOLIB_ADD #ifdef SOLIB_ADD
SOLIB_ADD (NULL, 0, target, auto_solib_add); SOLIB_ADD (NULL, 0, target, auto_solib_add);
@ -1839,7 +1839,7 @@ program_info (char *args, int from_tty)
target_files_info (); target_files_info ();
printf_filtered (_("Program stopped at %s.\n"), printf_filtered (_("Program stopped at %s.\n"),
paddress (target_gdbarch, stop_pc)); paddress (target_gdbarch (), stop_pc));
if (tp->control.stop_step) if (tp->control.stop_step)
printf_filtered (_("It stopped after being stepped.\n")); printf_filtered (_("It stopped after being stepped.\n"));
else if (stat != 0) else if (stat != 0)
@ -2542,7 +2542,7 @@ attach_command (char *args, int from_tty)
dont_repeat (); /* Not for the faint of heart */ dont_repeat (); /* Not for the faint of heart */
if (gdbarch_has_global_solist (target_gdbarch)) if (gdbarch_has_global_solist (target_gdbarch ()))
/* Don't complain if all processes share the same symbol /* Don't complain if all processes share the same symbol
space. */ space. */
; ;
@ -2732,7 +2732,7 @@ detach_command (char *args, int from_tty)
/* If the solist is global across inferiors, don't clear it when we /* If the solist is global across inferiors, don't clear it when we
detach from a single inferior. */ detach from a single inferior. */
if (!gdbarch_has_global_solist (target_gdbarch)) if (!gdbarch_has_global_solist (target_gdbarch ()))
no_shared_libraries (NULL, from_tty); no_shared_libraries (NULL, from_tty);
/* If we still have inferiors to debug, then don't mess with their /* If we still have inferiors to debug, then don't mess with their

View file

@ -757,7 +757,7 @@ jit_object_close_impl (struct gdb_symbol_callbacks *cb,
priv_data = cb->priv_data; priv_data = cb->priv_data;
objfile = allocate_objfile (NULL, 0); objfile = allocate_objfile (NULL, 0);
objfile->gdbarch = target_gdbarch; objfile->gdbarch = target_gdbarch ();
terminate_minimal_symbol_table (objfile); terminate_minimal_symbol_table (objfile);
@ -1290,7 +1290,7 @@ jit_inferior_init (struct gdbarch *gdbarch)
void void
jit_inferior_created_hook (void) jit_inferior_created_hook (void)
{ {
jit_inferior_init (target_gdbarch); jit_inferior_init (target_gdbarch ());
} }
/* Exported routine to call to re-set the jit breakpoints, /* Exported routine to call to re-set the jit breakpoints,
@ -1299,7 +1299,7 @@ jit_inferior_created_hook (void)
void void
jit_breakpoint_re_set (void) jit_breakpoint_re_set (void)
{ {
jit_breakpoint_re_set_internal (target_gdbarch, jit_breakpoint_re_set_internal (target_gdbarch (),
get_jit_inferior_data ()); get_jit_inferior_data ());
} }

View file

@ -4376,7 +4376,7 @@ linux_nat_make_corefile_notes (bfd *obfd, int *note_size)
{ {
/* FIXME: uweigand/2011-10-06: Once all GNU/Linux architectures have been /* FIXME: uweigand/2011-10-06: Once all GNU/Linux architectures have been
converted to gdbarch_core_regset_sections, this function can go away. */ converted to gdbarch_core_regset_sections, this function can go away. */
return linux_make_corefile_notes (target_gdbarch, obfd, note_size, return linux_make_corefile_notes (target_gdbarch (), obfd, note_size,
linux_nat_collect_thread_registers); linux_nat_collect_thread_registers);
} }
@ -4431,7 +4431,7 @@ linux_proc_xfer_partial (struct target_ops *ops, enum target_object object,
static LONGEST static LONGEST
spu_enumerate_spu_ids (int pid, gdb_byte *buf, ULONGEST offset, LONGEST len) spu_enumerate_spu_ids (int pid, gdb_byte *buf, ULONGEST offset, LONGEST len)
{ {
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
LONGEST pos = 0; LONGEST pos = 0;
LONGEST written = 0; LONGEST written = 0;
char path[128]; char path[128];
@ -4640,7 +4640,7 @@ linux_xfer_partial (struct target_ops *ops, enum target_object object,
if (object == TARGET_OBJECT_MEMORY) if (object == TARGET_OBJECT_MEMORY)
{ {
int addr_bit = gdbarch_addr_bit (target_gdbarch); int addr_bit = gdbarch_addr_bit (target_gdbarch ());
if (addr_bit < (sizeof (ULONGEST) * HOST_CHAR_BIT)) if (addr_bit < (sizeof (ULONGEST) * HOST_CHAR_BIT))
offset &= ((ULONGEST) 1 << addr_bit) - 1; offset &= ((ULONGEST) 1 << addr_bit) - 1;

View file

@ -667,7 +667,7 @@ linux_spu_make_corefile_notes (bfd *obfd, char *note_data, int *note_size)
"proxydma_info", "proxydma_info",
}; };
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
gdb_byte *spu_ids; gdb_byte *spu_ids;
LONGEST i, j, size; LONGEST i, j, size;

View file

@ -544,13 +544,13 @@ enable_thread_event (int event, CORE_ADDR *bp)
/* Set up the breakpoint. */ /* Set up the breakpoint. */
gdb_assert (exec_bfd); gdb_assert (exec_bfd);
(*bp) = (gdbarch_convert_from_func_ptr_addr (*bp) = (gdbarch_convert_from_func_ptr_addr
(target_gdbarch, (target_gdbarch (),
/* Do proper sign extension for the target. */ /* Do proper sign extension for the target. */
(bfd_get_sign_extend_vma (exec_bfd) > 0 (bfd_get_sign_extend_vma (exec_bfd) > 0
? (CORE_ADDR) (intptr_t) notify.u.bptaddr ? (CORE_ADDR) (intptr_t) notify.u.bptaddr
: (CORE_ADDR) (uintptr_t) notify.u.bptaddr), : (CORE_ADDR) (uintptr_t) notify.u.bptaddr),
&current_target)); &current_target));
create_thread_event_breakpoint (target_gdbarch, *bp); create_thread_event_breakpoint (target_gdbarch (), *bp);
return TD_OK; return TD_OK;
} }

View file

@ -79,7 +79,7 @@ m32r_load_section (bfd *abfd, asection *s, void *obj)
unsigned int *data_count = obj; unsigned int *data_count = obj;
if (s->flags & SEC_LOAD) if (s->flags & SEC_LOAD)
{ {
int addr_size = gdbarch_addr_bit (target_gdbarch) / 8; int addr_size = gdbarch_addr_bit (target_gdbarch ()) / 8;
bfd_size_type section_size = bfd_section_size (abfd, s); bfd_size_type section_size = bfd_section_size (abfd, s);
bfd_vma section_base = bfd_section_lma (abfd, s); bfd_vma section_base = bfd_section_lma (abfd, s);
unsigned int buffer, i; unsigned int buffer, i;
@ -89,7 +89,7 @@ m32r_load_section (bfd *abfd, asection *s, void *obj)
printf_filtered ("Loading section %s, size 0x%lx lma ", printf_filtered ("Loading section %s, size 0x%lx lma ",
bfd_section_name (abfd, s), bfd_section_name (abfd, s),
(unsigned long) section_size); (unsigned long) section_size);
fputs_filtered (paddress (target_gdbarch, section_base), gdb_stdout); fputs_filtered (paddress (target_gdbarch (), section_base), gdb_stdout);
printf_filtered ("\n"); printf_filtered ("\n");
gdb_flush (gdb_stdout); gdb_flush (gdb_stdout);
monitor_printf ("%s mw\r", phex_nz (section_base, addr_size)); monitor_printf ("%s mw\r", phex_nz (section_base, addr_size));
@ -149,7 +149,7 @@ m32r_load (char *filename, int from_tty)
printf_filtered ("Loading section %s, size 0x%lx vma ", printf_filtered ("Loading section %s, size 0x%lx vma ",
bfd_section_name (abfd, s), section_size); bfd_section_name (abfd, s), section_size);
fputs_filtered (paddress (target_gdbarch, section_base), gdb_stdout); fputs_filtered (paddress (target_gdbarch (), section_base), gdb_stdout);
printf_filtered ("\n"); printf_filtered ("\n");
gdb_flush (gdb_stdout); gdb_flush (gdb_stdout);
monitor_printf ("%x mw\r", section_base); monitor_printf ("%x mw\r", section_base);
@ -548,7 +548,7 @@ m32r_upload_command (char *args, int from_tty)
printf_filtered ("Loading section %s, size 0x%lx lma ", printf_filtered ("Loading section %s, size 0x%lx lma ",
bfd_section_name (abfd, s), bfd_section_name (abfd, s),
(unsigned long) section_size); (unsigned long) section_size);
fputs_filtered (paddress (target_gdbarch, section_base), fputs_filtered (paddress (target_gdbarch (), section_base),
gdb_stdout); gdb_stdout);
printf_filtered ("\n"); printf_filtered ("\n");
gdb_flush (gdb_stdout); gdb_flush (gdb_stdout);

View file

@ -431,10 +431,10 @@ mem_info_command (char *args, int from_tty)
printf_filtered ("Num "); printf_filtered ("Num ");
printf_filtered ("Enb "); printf_filtered ("Enb ");
printf_filtered ("Low Addr "); printf_filtered ("Low Addr ");
if (gdbarch_addr_bit (target_gdbarch) > 32) if (gdbarch_addr_bit (target_gdbarch ()) > 32)
printf_filtered (" "); printf_filtered (" ");
printf_filtered ("High Addr "); printf_filtered ("High Addr ");
if (gdbarch_addr_bit (target_gdbarch) > 32) if (gdbarch_addr_bit (target_gdbarch ()) > 32)
printf_filtered (" "); printf_filtered (" ");
printf_filtered ("Attrs "); printf_filtered ("Attrs ");
printf_filtered ("\n"); printf_filtered ("\n");
@ -446,14 +446,14 @@ mem_info_command (char *args, int from_tty)
printf_filtered ("%-3d %-3c\t", printf_filtered ("%-3d %-3c\t",
m->number, m->number,
m->enabled_p ? 'y' : 'n'); m->enabled_p ? 'y' : 'n');
if (gdbarch_addr_bit (target_gdbarch) <= 32) if (gdbarch_addr_bit (target_gdbarch ()) <= 32)
tmp = hex_string_custom ((unsigned long) m->lo, 8); tmp = hex_string_custom ((unsigned long) m->lo, 8);
else else
tmp = hex_string_custom ((unsigned long) m->lo, 16); tmp = hex_string_custom ((unsigned long) m->lo, 16);
printf_filtered ("%s ", tmp); printf_filtered ("%s ", tmp);
if (gdbarch_addr_bit (target_gdbarch) <= 32) if (gdbarch_addr_bit (target_gdbarch ()) <= 32)
{ {
if (m->hi == 0) if (m->hi == 0)
tmp = "0x100000000"; tmp = "0x100000000";

View file

@ -263,7 +263,7 @@ me_module_register_set (CONFIG_ATTR me_module,
mask contains any of the me_module's coprocessor ISAs, mask contains any of the me_module's coprocessor ISAs,
specifically excluding the generic coprocessor register sets. */ specifically excluding the generic coprocessor register sets. */
CGEN_CPU_DESC desc = gdbarch_tdep (target_gdbarch)->cpu_desc; CGEN_CPU_DESC desc = gdbarch_tdep (target_gdbarch ())->cpu_desc;
const CGEN_HW_ENTRY *hw; const CGEN_HW_ENTRY *hw;
if (me_module == CONFIG_NONE) if (me_module == CONFIG_NONE)
@ -854,7 +854,7 @@ current_me_module (void)
return regval; return regval;
} }
else else
return gdbarch_tdep (target_gdbarch)->me_module; return gdbarch_tdep (target_gdbarch ())->me_module;
} }

View file

@ -778,7 +778,7 @@ mi_solib_loaded (struct so_list *solib)
struct mi_interp *mi = top_level_interpreter_data (); struct mi_interp *mi = top_level_interpreter_data ();
target_terminal_ours (); target_terminal_ours ();
if (gdbarch_has_global_solist (target_gdbarch)) if (gdbarch_has_global_solist (target_gdbarch ()))
fprintf_unfiltered (mi->event_channel, fprintf_unfiltered (mi->event_channel,
"library-loaded,id=\"%s\",target-name=\"%s\"," "library-loaded,id=\"%s\",target-name=\"%s\","
"host-name=\"%s\",symbols-loaded=\"%d\"", "host-name=\"%s\",symbols-loaded=\"%d\"",
@ -802,7 +802,7 @@ mi_solib_unloaded (struct so_list *solib)
struct mi_interp *mi = top_level_interpreter_data (); struct mi_interp *mi = top_level_interpreter_data ();
target_terminal_ours (); target_terminal_ours ();
if (gdbarch_has_global_solist (target_gdbarch)) if (gdbarch_has_global_solist (target_gdbarch ()))
fprintf_unfiltered (mi->event_channel, fprintf_unfiltered (mi->event_channel,
"library-unloaded,id=\"%s\",target-name=\"%s\"," "library-unloaded,id=\"%s\",target-name=\"%s\","
"host-name=\"%s\"", "host-name=\"%s\"",
@ -865,7 +865,7 @@ mi_memory_changed (struct inferior *inferior, CORE_ADDR memaddr,
ui_out_redirect (mi_uiout, mi->event_channel); ui_out_redirect (mi_uiout, mi->event_channel);
ui_out_field_fmt (mi_uiout, "thread-group", "i%d", inferior->num); ui_out_field_fmt (mi_uiout, "thread-group", "i%d", inferior->num);
ui_out_field_core_addr (mi_uiout, "addr", target_gdbarch, memaddr); ui_out_field_core_addr (mi_uiout, "addr", target_gdbarch (), memaddr);
ui_out_field_fmt (mi_uiout, "len", "0x%zx", len); ui_out_field_fmt (mi_uiout, "len", "0x%zx", len);
/* Append 'type=code' into notification if MEMADDR falls in the range of /* Append 'type=code' into notification if MEMADDR falls in the range of

View file

@ -123,7 +123,7 @@ microblaze_register_type (struct gdbarch *gdbarch, int regnum)
static unsigned long static unsigned long
microblaze_fetch_instruction (CORE_ADDR pc) microblaze_fetch_instruction (CORE_ADDR pc)
{ {
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
gdb_byte buf[4]; gdb_byte buf[4];
/* If we can't read the instruction at PC, return zero. */ /* If we can't read the instruction at PC, return zero. */

View file

@ -688,7 +688,7 @@ mips_show_dr (const char *func, CORE_ADDR addr,
puts_unfiltered (func); puts_unfiltered (func);
if (addr || len) if (addr || len)
printf_unfiltered (" (addr=%s, len=%d, type=%s)", printf_unfiltered (" (addr=%s, len=%d, type=%s)",
paddress (target_gdbarch, addr), len, paddress (target_gdbarch (), addr), len,
type == hw_write ? "data-write" type == hw_write ? "data-write"
: (type == hw_read ? "data-read" : (type == hw_read ? "data-read"
: (type == hw_access ? "data-read/write" : (type == hw_access ? "data-read/write"
@ -698,9 +698,9 @@ mips_show_dr (const char *func, CORE_ADDR addr,
for (i = 0; i < MAX_DEBUG_REGISTER; i++) for (i = 0; i < MAX_DEBUG_REGISTER; i++)
printf_unfiltered ("\tDR%d: lo=%s, hi=%s\n", i, printf_unfiltered ("\tDR%d: lo=%s, hi=%s\n", i,
paddress (target_gdbarch, paddress (target_gdbarch (),
get_watchlo (&watch_mirror, i)), get_watchlo (&watch_mirror, i)),
paddress (target_gdbarch, paddress (target_gdbarch (),
get_watchhi (&watch_mirror, i))); get_watchhi (&watch_mirror, i)));
} }

View file

@ -682,8 +682,8 @@ mips_linux_in_dynsym_stub (CORE_ADDR pc, char *name)
{ {
unsigned char buf[28], *p; unsigned char buf[28], *p;
ULONGEST insn, insn1; ULONGEST insn, insn1;
int n64 = (mips_abi (target_gdbarch) == MIPS_ABI_N64); int n64 = (mips_abi (target_gdbarch ()) == MIPS_ABI_N64);
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
read_memory (pc - 12, buf, 28); read_memory (pc - 12, buf, 28);

View file

@ -1087,7 +1087,7 @@ static void
show_mask_address (struct ui_file *file, int from_tty, show_mask_address (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value) struct cmd_list_element *c, const char *value)
{ {
struct gdbarch_tdep *tdep = gdbarch_tdep (target_gdbarch); struct gdbarch_tdep *tdep = gdbarch_tdep (target_gdbarch ());
deprecated_show_value_hack (file, from_tty, c, value); deprecated_show_value_hack (file, from_tty, c, value);
switch (mask_address_var) switch (mask_address_var)
@ -6652,7 +6652,7 @@ show_mipsfpu_command (char *args, int from_tty)
{ {
char *fpu; char *fpu;
if (gdbarch_bfd_arch_info (target_gdbarch)->arch != bfd_arch_mips) if (gdbarch_bfd_arch_info (target_gdbarch ())->arch != bfd_arch_mips)
{ {
printf_unfiltered printf_unfiltered
("The MIPS floating-point coprocessor is unknown " ("The MIPS floating-point coprocessor is unknown "
@ -6660,7 +6660,7 @@ show_mipsfpu_command (char *args, int from_tty)
return; return;
} }
switch (MIPS_FPU_TYPE (target_gdbarch)) switch (MIPS_FPU_TYPE (target_gdbarch ()))
{ {
case MIPS_FPU_SINGLE: case MIPS_FPU_SINGLE:
fpu = "single-precision"; fpu = "single-precision";
@ -8681,7 +8681,7 @@ show_mips_abi (struct ui_file *file,
struct cmd_list_element *ignored_cmd, struct cmd_list_element *ignored_cmd,
const char *ignored_value) const char *ignored_value)
{ {
if (gdbarch_bfd_arch_info (target_gdbarch)->arch != bfd_arch_mips) if (gdbarch_bfd_arch_info (target_gdbarch ())->arch != bfd_arch_mips)
fprintf_filtered fprintf_filtered
(file, (file,
"The MIPS ABI is unknown because the current architecture " "The MIPS ABI is unknown because the current architecture "
@ -8689,7 +8689,7 @@ show_mips_abi (struct ui_file *file,
else else
{ {
enum mips_abi global_abi = global_mips_abi (); enum mips_abi global_abi = global_mips_abi ();
enum mips_abi actual_abi = mips_abi (target_gdbarch); enum mips_abi actual_abi = mips_abi (target_gdbarch ());
const char *actual_abi_str = mips_abi_strings[actual_abi]; const char *actual_abi_str = mips_abi_strings[actual_abi];
if (global_abi == MIPS_ABI_UNKNOWN) if (global_abi == MIPS_ABI_UNKNOWN)

View file

@ -217,11 +217,11 @@ monitor_error (char *function, char *message,
if (final_char) if (final_char)
error (_("%s (%s): %s: %s%c"), error (_("%s (%s): %s: %s%c"),
function, paddress (target_gdbarch, memaddr), function, paddress (target_gdbarch (), memaddr),
message, safe_string, final_char); message, safe_string, final_char);
else else
error (_("%s (%s): %s: %s"), error (_("%s (%s): %s: %s"),
function, paddress (target_gdbarch, memaddr), function, paddress (target_gdbarch (), memaddr),
message, safe_string); message, safe_string);
} }
@ -256,7 +256,7 @@ fromhex (int a)
static void static void
monitor_vsprintf (char *sndbuf, char *pattern, va_list args) monitor_vsprintf (char *sndbuf, char *pattern, va_list args)
{ {
int addr_bit = gdbarch_addr_bit (target_gdbarch); int addr_bit = gdbarch_addr_bit (target_gdbarch ());
char format[10]; char format[10];
char fmt; char fmt;
char *p; char *p;
@ -1440,15 +1440,15 @@ monitor_files_info (struct target_ops *ops)
static int static int
monitor_write_memory (CORE_ADDR memaddr, char *myaddr, int len) monitor_write_memory (CORE_ADDR memaddr, char *myaddr, int len)
{ {
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
unsigned int val, hostval; unsigned int val, hostval;
char *cmd; char *cmd;
int i; int i;
monitor_debug ("MON write %d %s\n", len, paddress (target_gdbarch, memaddr)); monitor_debug ("MON write %d %s\n", len, paddress (target_gdbarch (), memaddr));
if (current_monitor->flags & MO_ADDR_BITS_REMOVE) if (current_monitor->flags & MO_ADDR_BITS_REMOVE)
memaddr = gdbarch_addr_bits_remove (target_gdbarch, memaddr); memaddr = gdbarch_addr_bits_remove (target_gdbarch (), memaddr);
/* Use memory fill command for leading 0 bytes. */ /* Use memory fill command for leading 0 bytes. */
@ -1707,7 +1707,7 @@ monitor_write_memory_block (CORE_ADDR memaddr, char *myaddr, int len)
static int static int
monitor_read_memory_single (CORE_ADDR memaddr, char *myaddr, int len) monitor_read_memory_single (CORE_ADDR memaddr, char *myaddr, int len)
{ {
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
unsigned int val; unsigned int val;
char membuf[sizeof (int) * 2 + 1]; char membuf[sizeof (int) * 2 + 1];
char *p; char *p;
@ -1852,11 +1852,11 @@ monitor_read_memory (CORE_ADDR memaddr, char *myaddr, int len)
} }
monitor_debug ("MON read block ta(%s) ha(%s) %d\n", monitor_debug ("MON read block ta(%s) ha(%s) %d\n",
paddress (target_gdbarch, memaddr), paddress (target_gdbarch (), memaddr),
host_address_to_string (myaddr), len); host_address_to_string (myaddr), len);
if (current_monitor->flags & MO_ADDR_BITS_REMOVE) if (current_monitor->flags & MO_ADDR_BITS_REMOVE)
memaddr = gdbarch_addr_bits_remove (target_gdbarch, memaddr); memaddr = gdbarch_addr_bits_remove (target_gdbarch (), memaddr);
if (current_monitor->flags & MO_GETMEM_READ_SINGLE) if (current_monitor->flags & MO_GETMEM_READ_SINGLE)
return monitor_read_memory_single (memaddr, myaddr, len); return monitor_read_memory_single (memaddr, myaddr, len);

View file

@ -505,7 +505,7 @@ moxie_process_readu (CORE_ADDR addr, char *buf,
if (record_debug) if (record_debug)
printf_unfiltered (_("Process record: error reading memory at " printf_unfiltered (_("Process record: error reading memory at "
"addr 0x%s len = %d.\n"), "addr 0x%s len = %d.\n"),
paddress (target_gdbarch, addr), length); paddress (target_gdbarch (), addr), length);
return -1; return -1;
} }
@ -528,7 +528,7 @@ moxie_process_record (struct gdbarch *gdbarch, struct regcache *regcache,
if (record_debug > 1) if (record_debug > 1)
fprintf_unfiltered (gdb_stdlog, "Process record: moxie_process_record " fprintf_unfiltered (gdb_stdlog, "Process record: moxie_process_record "
"addr = 0x%s\n", "addr = 0x%s\n",
paddress (target_gdbarch, addr)); paddress (target_gdbarch (), addr));
inst = (uint16_t) moxie_process_readu (addr, buf, 2, byte_order); inst = (uint16_t) moxie_process_readu (addr, buf, 2, byte_order);

View file

@ -197,7 +197,7 @@ procfs_open (char *arg, int from_tty)
{ {
if (sysinfo->type != if (sysinfo->type !=
nto_map_arch_to_cputype (gdbarch_bfd_arch_info nto_map_arch_to_cputype (gdbarch_bfd_arch_info
(target_gdbarch)->arch_name)) (target_gdbarch ())->arch_name))
error (_("Invalid target CPU.")); error (_("Invalid target CPU."));
} }
} }

View file

@ -94,14 +94,14 @@ nto_find_and_open_solib (char *solib, unsigned o_flags, char **temp_pathname)
"%s/lib:%s/usr/lib:%s/usr/photon/lib:%s/usr/photon/dll:%s/lib/dll" "%s/lib:%s/usr/lib:%s/usr/photon/lib:%s/usr/photon/dll:%s/lib/dll"
nto_root = nto_target (); nto_root = nto_target ();
if (strcmp (gdbarch_bfd_arch_info (target_gdbarch)->arch_name, "i386") == 0) if (strcmp (gdbarch_bfd_arch_info (target_gdbarch ())->arch_name, "i386") == 0)
{ {
arch = "x86"; arch = "x86";
endian = ""; endian = "";
} }
else if (strcmp (gdbarch_bfd_arch_info (target_gdbarch)->arch_name, else if (strcmp (gdbarch_bfd_arch_info (target_gdbarch ())->arch_name,
"rs6000") == 0 "rs6000") == 0
|| strcmp (gdbarch_bfd_arch_info (target_gdbarch)->arch_name, || strcmp (gdbarch_bfd_arch_info (target_gdbarch ())->arch_name,
"powerpc") == 0) "powerpc") == 0)
{ {
arch = "ppc"; arch = "ppc";
@ -109,8 +109,8 @@ nto_find_and_open_solib (char *solib, unsigned o_flags, char **temp_pathname)
} }
else else
{ {
arch = gdbarch_bfd_arch_info (target_gdbarch)->arch_name; arch = gdbarch_bfd_arch_info (target_gdbarch ())->arch_name;
endian = gdbarch_byte_order (target_gdbarch) endian = gdbarch_byte_order (target_gdbarch ())
== BFD_ENDIAN_BIG ? "be" : "le"; == BFD_ENDIAN_BIG ? "be" : "le";
} }
@ -150,14 +150,14 @@ nto_init_solib_absolute_prefix (void)
const char *arch; const char *arch;
nto_root = nto_target (); nto_root = nto_target ();
if (strcmp (gdbarch_bfd_arch_info (target_gdbarch)->arch_name, "i386") == 0) if (strcmp (gdbarch_bfd_arch_info (target_gdbarch ())->arch_name, "i386") == 0)
{ {
arch = "x86"; arch = "x86";
endian = ""; endian = "";
} }
else if (strcmp (gdbarch_bfd_arch_info (target_gdbarch)->arch_name, else if (strcmp (gdbarch_bfd_arch_info (target_gdbarch ())->arch_name,
"rs6000") == 0 "rs6000") == 0
|| strcmp (gdbarch_bfd_arch_info (target_gdbarch)->arch_name, || strcmp (gdbarch_bfd_arch_info (target_gdbarch ())->arch_name,
"powerpc") == 0) "powerpc") == 0)
{ {
arch = "ppc"; arch = "ppc";
@ -165,8 +165,8 @@ nto_init_solib_absolute_prefix (void)
} }
else else
{ {
arch = gdbarch_bfd_arch_info (target_gdbarch)->arch_name; arch = gdbarch_bfd_arch_info (target_gdbarch ())->arch_name;
endian = gdbarch_byte_order (target_gdbarch) endian = gdbarch_byte_order (target_gdbarch ())
== BFD_ENDIAN_BIG ? "be" : "le"; == BFD_ENDIAN_BIG ? "be" : "le";
} }
@ -261,7 +261,7 @@ lm_addr (struct so_list *so)
if (so->lm_info->l_addr == (CORE_ADDR)-1) if (so->lm_info->l_addr == (CORE_ADDR)-1)
{ {
struct link_map_offsets *lmo = nto_fetch_link_map_offsets (); struct link_map_offsets *lmo = nto_fetch_link_map_offsets ();
struct type *ptr_type = builtin_type (target_gdbarch)->builtin_data_ptr; struct type *ptr_type = builtin_type (target_gdbarch ())->builtin_data_ptr;
so->lm_info->l_addr = so->lm_info->l_addr =
extract_typed_address (so->lm_info->lm + lmo->l_addr_offset, ptr_type); extract_typed_address (so->lm_info->lm + lmo->l_addr_offset, ptr_type);
@ -272,12 +272,12 @@ lm_addr (struct so_list *so)
static CORE_ADDR static CORE_ADDR
nto_truncate_ptr (CORE_ADDR addr) nto_truncate_ptr (CORE_ADDR addr)
{ {
if (gdbarch_ptr_bit (target_gdbarch) == sizeof (CORE_ADDR) * 8) if (gdbarch_ptr_bit (target_gdbarch ()) == sizeof (CORE_ADDR) * 8)
/* We don't need to truncate anything, and the bit twiddling below /* We don't need to truncate anything, and the bit twiddling below
will fail due to overflow problems. */ will fail due to overflow problems. */
return addr; return addr;
else else
return addr & (((CORE_ADDR) 1 << gdbarch_ptr_bit (target_gdbarch)) - 1); return addr & (((CORE_ADDR) 1 << gdbarch_ptr_bit (target_gdbarch ())) - 1);
} }
static Elf_Internal_Phdr * static Elf_Internal_Phdr *

View file

@ -2394,7 +2394,7 @@ ppc_linux_auxv_parse (struct target_ops *ops, gdb_byte **readptr,
gdb_byte *endptr, CORE_ADDR *typep, CORE_ADDR *valp) gdb_byte *endptr, CORE_ADDR *typep, CORE_ADDR *valp)
{ {
int sizeof_auxv_field = ppc_linux_target_wordsize (); int sizeof_auxv_field = ppc_linux_target_wordsize ();
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
gdb_byte *ptr = *readptr; gdb_byte *ptr = *readptr;
if (endptr == ptr) if (endptr == ptr)

View file

@ -269,7 +269,7 @@ ps_lgetregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, prgregset_t gregset)
struct regcache *regcache; struct regcache *regcache;
inferior_ptid = BUILD_LWP (lwpid, ptid_get_pid (ph->ptid)); inferior_ptid = BUILD_LWP (lwpid, ptid_get_pid (ph->ptid));
regcache = get_thread_arch_regcache (inferior_ptid, target_gdbarch); regcache = get_thread_arch_regcache (inferior_ptid, target_gdbarch ());
target_fetch_registers (regcache, -1); target_fetch_registers (regcache, -1);
fill_gregset (regcache, (gdb_gregset_t *) gregset, -1); fill_gregset (regcache, (gdb_gregset_t *) gregset, -1);
@ -288,7 +288,7 @@ ps_lsetregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, const prgregset_t gregset)
struct regcache *regcache; struct regcache *regcache;
inferior_ptid = BUILD_LWP (lwpid, ptid_get_pid (ph->ptid)); inferior_ptid = BUILD_LWP (lwpid, ptid_get_pid (ph->ptid));
regcache = get_thread_arch_regcache (inferior_ptid, target_gdbarch); regcache = get_thread_arch_regcache (inferior_ptid, target_gdbarch ());
supply_gregset (regcache, (const gdb_gregset_t *) gregset); supply_gregset (regcache, (const gdb_gregset_t *) gregset);
target_store_registers (regcache, -1); target_store_registers (regcache, -1);
@ -308,7 +308,7 @@ ps_lgetfpregs (gdb_ps_prochandle_t ph, lwpid_t lwpid,
struct regcache *regcache; struct regcache *regcache;
inferior_ptid = BUILD_LWP (lwpid, ptid_get_pid (ph->ptid)); inferior_ptid = BUILD_LWP (lwpid, ptid_get_pid (ph->ptid));
regcache = get_thread_arch_regcache (inferior_ptid, target_gdbarch); regcache = get_thread_arch_regcache (inferior_ptid, target_gdbarch ());
target_fetch_registers (regcache, -1); target_fetch_registers (regcache, -1);
fill_fpregset (regcache, (gdb_fpregset_t *) fpregset, -1); fill_fpregset (regcache, (gdb_fpregset_t *) fpregset, -1);
@ -328,7 +328,7 @@ ps_lsetfpregs (gdb_ps_prochandle_t ph, lwpid_t lwpid,
struct regcache *regcache; struct regcache *regcache;
inferior_ptid = BUILD_LWP (lwpid, ptid_get_pid (ph->ptid)); inferior_ptid = BUILD_LWP (lwpid, ptid_get_pid (ph->ptid));
regcache = get_thread_arch_regcache (inferior_ptid, target_gdbarch); regcache = get_thread_arch_regcache (inferior_ptid, target_gdbarch ());
supply_fpregset (regcache, (const gdb_fpregset_t *) fpregset); supply_fpregset (regcache, (const gdb_fpregset_t *) fpregset);
target_store_registers (regcache, -1); target_store_registers (regcache, -1);

View file

@ -159,7 +159,7 @@ static int
procfs_auxv_parse (struct target_ops *ops, gdb_byte **readptr, procfs_auxv_parse (struct target_ops *ops, gdb_byte **readptr,
gdb_byte *endptr, CORE_ADDR *typep, CORE_ADDR *valp) gdb_byte *endptr, CORE_ADDR *typep, CORE_ADDR *valp)
{ {
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
gdb_byte *ptr = *readptr; gdb_byte *ptr = *readptr;
if (endptr == ptr) if (endptr == ptr)
@ -1206,12 +1206,12 @@ proc_watchpoint_address (procinfo *pi, CORE_ADDR *addr)
return 0; return 0;
#ifdef NEW_PROC_API #ifdef NEW_PROC_API
*addr = (CORE_ADDR) gdbarch_pointer_to_address (target_gdbarch, *addr = (CORE_ADDR) gdbarch_pointer_to_address (target_gdbarch (),
builtin_type (target_gdbarch)->builtin_data_ptr, builtin_type (target_gdbarch ())->builtin_data_ptr,
(gdb_byte *) &pi->prstatus.pr_lwp.pr_info.si_addr); (gdb_byte *) &pi->prstatus.pr_lwp.pr_info.si_addr);
#else #else
*addr = (CORE_ADDR) gdbarch_pointer_to_address (target_gdbarch, *addr = (CORE_ADDR) gdbarch_pointer_to_address (target_gdbarch (),
builtin_type (target_gdbarch)->builtin_data_ptr, builtin_type (target_gdbarch ())->builtin_data_ptr,
(gdb_byte *) &pi->prstatus.pr_info.si_addr); (gdb_byte *) &pi->prstatus.pr_info.si_addr);
#endif #endif
return 1; return 1;
@ -2455,11 +2455,11 @@ proc_parent_pid (procinfo *pi)
static void * static void *
procfs_address_to_host_pointer (CORE_ADDR addr) procfs_address_to_host_pointer (CORE_ADDR addr)
{ {
struct type *ptr_type = builtin_type (target_gdbarch)->builtin_data_ptr; struct type *ptr_type = builtin_type (target_gdbarch ())->builtin_data_ptr;
void *ptr; void *ptr;
gdb_assert (sizeof (ptr) == TYPE_LENGTH (ptr_type)); gdb_assert (sizeof (ptr) == TYPE_LENGTH (ptr_type));
gdbarch_address_to_pointer (target_gdbarch, ptr_type, gdbarch_address_to_pointer (target_gdbarch (), ptr_type,
(gdb_byte *) &ptr, addr); (gdb_byte *) &ptr, addr);
return ptr; return ptr;
} }
@ -3430,7 +3430,7 @@ remove_dbx_link_breakpoint (void)
if (dbx_link_bpt_addr == 0) if (dbx_link_bpt_addr == 0)
return; return;
if (deprecated_remove_raw_breakpoint (target_gdbarch, dbx_link_bpt) != 0) if (deprecated_remove_raw_breakpoint (target_gdbarch (), dbx_link_bpt) != 0)
warning (_("Unable to remove __dbx_link breakpoint.")); warning (_("Unable to remove __dbx_link breakpoint."));
dbx_link_bpt_addr = 0; dbx_link_bpt_addr = 0;
@ -3503,7 +3503,7 @@ insert_dbx_link_bpt_in_file (int fd, CORE_ADDR ignored)
{ {
/* Insert the breakpoint. */ /* Insert the breakpoint. */
dbx_link_bpt_addr = sym_addr; dbx_link_bpt_addr = sym_addr;
dbx_link_bpt = deprecated_insert_raw_breakpoint (target_gdbarch, NULL, dbx_link_bpt = deprecated_insert_raw_breakpoint (target_gdbarch (), NULL,
sym_addr); sym_addr);
if (dbx_link_bpt == NULL) if (dbx_link_bpt == NULL)
{ {
@ -4118,7 +4118,7 @@ invalidate_cache (procinfo *parent, procinfo *pi, void *ptr)
if (!proc_set_gregs (pi)) /* flush gregs cache */ if (!proc_set_gregs (pi)) /* flush gregs cache */
proc_warn (pi, "target_resume, set_gregs", proc_warn (pi, "target_resume, set_gregs",
__LINE__); __LINE__);
if (gdbarch_fp0_regnum (target_gdbarch) >= 0) if (gdbarch_fp0_regnum (target_gdbarch ()) >= 0)
if (pi->fpregs_dirty) if (pi->fpregs_dirty)
if (parent == NULL || if (parent == NULL ||
proc_get_current_thread (parent) != pi->tid) proc_get_current_thread (parent) != pi->tid)
@ -4396,7 +4396,7 @@ procfs_mourn_inferior (struct target_ops *ops)
if (dbx_link_bpt != NULL) if (dbx_link_bpt != NULL)
{ {
deprecated_remove_raw_breakpoint (target_gdbarch, dbx_link_bpt); deprecated_remove_raw_breakpoint (target_gdbarch (), dbx_link_bpt);
dbx_link_bpt_addr = 0; dbx_link_bpt_addr = 0;
dbx_link_bpt = NULL; dbx_link_bpt = NULL;
} }
@ -4881,7 +4881,7 @@ procfs_can_use_hw_breakpoint (int type, int cnt, int othertype)
procfs_address_to_host_pointer will reveal that an internal error procfs_address_to_host_pointer will reveal that an internal error
will be generated when the host and target pointer sizes are will be generated when the host and target pointer sizes are
different. */ different. */
struct type *ptr_type = builtin_type (target_gdbarch)->builtin_data_ptr; struct type *ptr_type = builtin_type (target_gdbarch ())->builtin_data_ptr;
if (sizeof (void *) != TYPE_LENGTH (ptr_type)) if (sizeof (void *) != TYPE_LENGTH (ptr_type))
return 0; return 0;
@ -4938,7 +4938,7 @@ procfs_insert_watchpoint (CORE_ADDR addr, int len, int type,
struct expression *cond) struct expression *cond)
{ {
if (!target_have_steppable_watchpoint if (!target_have_steppable_watchpoint
&& !gdbarch_have_nonsteppable_watchpoint (target_gdbarch)) && !gdbarch_have_nonsteppable_watchpoint (target_gdbarch ()))
{ {
/* When a hardware watchpoint fires off the PC will be left at /* When a hardware watchpoint fires off the PC will be left at
the instruction following the one which caused the the instruction following the one which caused the
@ -5138,7 +5138,7 @@ info_mappings_callback (struct prmap *map, find_memory_region_ftype ignore,
pr_off = map->pr_off; pr_off = map->pr_off;
#endif #endif
if (gdbarch_addr_bit (target_gdbarch) == 32) if (gdbarch_addr_bit (target_gdbarch ()) == 32)
printf_filtered ("\t%#10lx %#10lx %#10lx %#10x %7s\n", printf_filtered ("\t%#10lx %#10lx %#10lx %#10x %7s\n",
(unsigned long) map->pr_vaddr, (unsigned long) map->pr_vaddr,
(unsigned long) map->pr_vaddr + map->pr_size - 1, (unsigned long) map->pr_vaddr + map->pr_size - 1,
@ -5165,7 +5165,7 @@ info_proc_mappings (procinfo *pi, int summary)
return; /* No output for summary mode. */ return; /* No output for summary mode. */
printf_filtered (_("Mapped address spaces:\n\n")); printf_filtered (_("Mapped address spaces:\n\n"));
if (gdbarch_ptr_bit (target_gdbarch) == 32) if (gdbarch_ptr_bit (target_gdbarch ()) == 32)
printf_filtered ("\t%10s %10s %10s %10s %7s\n", printf_filtered ("\t%10s %10s %10s %10s %7s\n",
"Start Addr", "Start Addr",
" End Addr", " End Addr",

View file

@ -75,7 +75,7 @@ new_address_space (void)
struct address_space * struct address_space *
maybe_new_address_space (void) maybe_new_address_space (void)
{ {
int shared_aspace = gdbarch_has_shared_address_space (target_gdbarch); int shared_aspace = gdbarch_has_shared_address_space (target_gdbarch ());
if (shared_aspace) if (shared_aspace)
{ {
@ -148,7 +148,7 @@ release_program_space (struct program_space *pspace)
no_shared_libraries (NULL, 0); no_shared_libraries (NULL, 0);
exec_close (); exec_close ();
free_all_objfiles (); free_all_objfiles ();
if (!gdbarch_has_shared_address_space (target_gdbarch)) if (!gdbarch_has_shared_address_space (target_gdbarch ()))
free_address_space (pspace->aspace); free_address_space (pspace->aspace);
resize_section_table (&pspace->target_sections, resize_section_table (&pspace->target_sections,
-resize_section_table (&pspace->target_sections, 0)); -resize_section_table (&pspace->target_sections, 0));
@ -432,7 +432,7 @@ number_of_program_spaces (void)
void void
update_address_spaces (void) update_address_spaces (void)
{ {
int shared_aspace = gdbarch_has_shared_address_space (target_gdbarch); int shared_aspace = gdbarch_has_shared_address_space (target_gdbarch ());
struct program_space *pspace; struct program_space *pspace;
struct inferior *inf; struct inferior *inf;
@ -454,7 +454,7 @@ update_address_spaces (void)
} }
for (inf = inferior_list; inf; inf = inf->next) for (inf = inferior_list; inf; inf = inf->next)
if (gdbarch_has_global_solist (target_gdbarch)) if (gdbarch_has_global_solist (target_gdbarch ()))
inf->aspace = maybe_new_address_space (); inf->aspace = maybe_new_address_space ();
else else
inf->aspace = inf->pspace->aspace; inf->aspace = inf->pspace->aspace;

View file

@ -392,7 +392,7 @@ bpfinishpy_handle_stop (struct bpstats *bs, int print_frame)
static void static void
bpfinishpy_handle_exit (struct inferior *inf) bpfinishpy_handle_exit (struct inferior *inf)
{ {
struct cleanup *cleanup = ensure_python_env (target_gdbarch, struct cleanup *cleanup = ensure_python_env (target_gdbarch (),
current_language); current_language);
iterate_over_breakpoints (bpfinishpy_detect_out_scope_cb, NULL); iterate_over_breakpoints (bpfinishpy_detect_out_scope_cb, NULL);

View file

@ -101,7 +101,7 @@ python_on_resume (ptid_t ptid)
{ {
struct cleanup *cleanup; struct cleanup *cleanup;
cleanup = ensure_python_env (target_gdbarch, current_language); cleanup = ensure_python_env (target_gdbarch (), current_language);
if (emit_continue_event (ptid) < 0) if (emit_continue_event (ptid) < 0)
gdbpy_print_stack (); gdbpy_print_stack ();
@ -115,7 +115,7 @@ python_inferior_exit (struct inferior *inf)
struct cleanup *cleanup; struct cleanup *cleanup;
const LONGEST *exit_code = NULL; const LONGEST *exit_code = NULL;
cleanup = ensure_python_env (target_gdbarch, current_language); cleanup = ensure_python_env (target_gdbarch (), current_language);
if (inf->has_exit_code) if (inf->has_exit_code)
exit_code = &inf->exit_code; exit_code = &inf->exit_code;

View file

@ -1280,7 +1280,7 @@ finalize_python (void *ignore)
clearer to make the needed calls explicitly here than to create a clearer to make the needed calls explicitly here than to create a
cleanup and then mysteriously discard it. */ cleanup and then mysteriously discard it. */
PyGILState_Ensure (); PyGILState_Ensure ();
python_gdbarch = target_gdbarch; python_gdbarch = target_gdbarch ();
python_language = current_language; python_language = current_language;
Py_Finalize (); Py_Finalize ();

View file

@ -166,7 +166,7 @@ get_running_thread_id (void)
char *buf; char *buf;
CORE_ADDR object_addr; CORE_ADDR object_addr;
struct type *builtin_type_void_data_ptr = struct type *builtin_type_void_data_ptr =
builtin_type (target_gdbarch)->builtin_data_ptr; builtin_type (target_gdbarch ())->builtin_data_ptr;
if (!object_msym) if (!object_msym)
return 0; return 0;

View file

@ -512,14 +512,14 @@ record_arch_list_add_mem (CORE_ADDR addr, int len)
fprintf_unfiltered (gdb_stdlog, fprintf_unfiltered (gdb_stdlog,
"Process record: add mem addr = %s len = %d to " "Process record: add mem addr = %s len = %d to "
"record list.\n", "record list.\n",
paddress (target_gdbarch, addr), len); paddress (target_gdbarch (), addr), len);
if (!addr) /* FIXME: Why? Some arch must permit it... */ if (!addr) /* FIXME: Why? Some arch must permit it... */
return 0; return 0;
rec = record_mem_alloc (addr, len); rec = record_mem_alloc (addr, len);
if (record_read_memory (target_gdbarch, addr, record_get_loc (rec), len)) if (record_read_memory (target_gdbarch (), addr, record_get_loc (rec), len))
{ {
record_mem_release (rec); record_mem_release (rec);
return -1; return -1;
@ -874,7 +874,7 @@ record_open_1 (char *name, int from_tty)
error (_("Process record target can't debug inferior in non-stop mode " error (_("Process record target can't debug inferior in non-stop mode "
"(non-stop).")); "(non-stop)."));
if (!gdbarch_process_record_p (target_gdbarch)) if (!gdbarch_process_record_p (target_gdbarch ()))
error (_("Process record: the current architecture doesn't support " error (_("Process record: the current architecture doesn't support "
"record function.")); "record function."));
@ -1686,7 +1686,7 @@ record_xfer_partial (struct target_ops *ops, enum target_object object,
if (!query (_("Because GDB is in replay mode, writing to memory " if (!query (_("Because GDB is in replay mode, writing to memory "
"will make the execution log unusable from this " "will make the execution log unusable from this "
"point onward. Write memory at address %s?"), "point onward. Write memory at address %s?"),
paddress (target_gdbarch, offset))) paddress (target_gdbarch (), offset)))
error (_("Process record canceled the operation.")); error (_("Process record canceled the operation."));
/* Destroy the record from here forward. */ /* Destroy the record from here forward. */

View file

@ -487,7 +487,7 @@ m32r_resume (struct target_ops *ops,
else else
{ {
buf[0] = SDI_WRITE_MEMORY; buf[0] = SDI_WRITE_MEMORY;
if (gdbarch_byte_order (target_gdbarch) == BFD_ENDIAN_BIG) if (gdbarch_byte_order (target_gdbarch ()) == BFD_ENDIAN_BIG)
store_long_parameter (buf + 1, pc_addr); store_long_parameter (buf + 1, pc_addr);
else else
store_long_parameter (buf + 1, pc_addr - 1); store_long_parameter (buf + 1, pc_addr - 1);
@ -527,7 +527,7 @@ m32r_resume (struct target_ops *ops,
continue; continue;
/* Set PBP. */ /* Set PBP. */
if (gdbarch_byte_order (target_gdbarch) == BFD_ENDIAN_BIG) if (gdbarch_byte_order (target_gdbarch ()) == BFD_ENDIAN_BIG)
send_three_arg_cmd (SDI_WRITE_MEMORY, 0xffff8000 + 4 * i, 4, send_three_arg_cmd (SDI_WRITE_MEMORY, 0xffff8000 + 4 * i, 4,
0x00000006); 0x00000006);
else else
@ -554,7 +554,7 @@ m32r_resume (struct target_ops *ops,
store_long_parameter (buf + 5, 4); store_long_parameter (buf + 5, 4);
if ((bp_addr & 2) == 0 && bp_addr != (pc_addr & 0xfffffffc)) if ((bp_addr & 2) == 0 && bp_addr != (pc_addr & 0xfffffffc))
{ {
if (gdbarch_byte_order (target_gdbarch) == BFD_ENDIAN_BIG) if (gdbarch_byte_order (target_gdbarch ()) == BFD_ENDIAN_BIG)
{ {
buf[9] = dbt_bp_entry[0]; buf[9] = dbt_bp_entry[0];
buf[10] = dbt_bp_entry[1]; buf[10] = dbt_bp_entry[1];
@ -571,7 +571,7 @@ m32r_resume (struct target_ops *ops,
} }
else else
{ {
if (gdbarch_byte_order (target_gdbarch) == BFD_ENDIAN_BIG) if (gdbarch_byte_order (target_gdbarch ()) == BFD_ENDIAN_BIG)
{ {
if ((bp_addr & 2) == 0) if ((bp_addr & 2) == 0)
{ {
@ -618,7 +618,7 @@ m32r_resume (struct target_ops *ops,
continue; continue;
/* DBC register. */ /* DBC register. */
if (gdbarch_byte_order (target_gdbarch) == BFD_ENDIAN_BIG) if (gdbarch_byte_order (target_gdbarch ()) == BFD_ENDIAN_BIG)
{ {
switch (ab_type[i]) switch (ab_type[i])
{ {
@ -760,7 +760,7 @@ m32r_wait (struct target_ops *ops,
if (last_pc_addr != 0xffffffff) if (last_pc_addr != 0xffffffff)
{ {
buf[0] = SDI_WRITE_MEMORY; buf[0] = SDI_WRITE_MEMORY;
if (gdbarch_byte_order (target_gdbarch) == BFD_ENDIAN_BIG) if (gdbarch_byte_order (target_gdbarch ()) == BFD_ENDIAN_BIG)
store_long_parameter (buf + 1, last_pc_addr); store_long_parameter (buf + 1, last_pc_addr);
else else
store_long_parameter (buf + 1, last_pc_addr - 1); store_long_parameter (buf + 1, last_pc_addr - 1);
@ -789,7 +789,7 @@ m32r_wait (struct target_ops *ops,
address, we have to take care of it later. */ address, we have to take care of it later. */
if ((pc_addr & 0x2) != 0) if ((pc_addr & 0x2) != 0)
{ {
if (gdbarch_byte_order (target_gdbarch) == BFD_ENDIAN_BIG) if (gdbarch_byte_order (target_gdbarch ()) == BFD_ENDIAN_BIG)
{ {
if ((bp_data[i][2] & 0x80) != 0) if ((bp_data[i][2] & 0x80) != 0)
{ {
@ -851,7 +851,7 @@ m32r_wait (struct target_ops *ops,
c = serial_readchar (sdi_desc, SDI_TIMEOUT); c = serial_readchar (sdi_desc, SDI_TIMEOUT);
if (c != '-' && recv_data (buf, 4) != -1) if (c != '-' && recv_data (buf, 4) != -1)
{ {
if (gdbarch_byte_order (target_gdbarch) == BFD_ENDIAN_BIG) if (gdbarch_byte_order (target_gdbarch ()) == BFD_ENDIAN_BIG)
{ {
if ((buf[3] & 0x1) == 0x1) if ((buf[3] & 0x1) == 0x1)
hit_watchpoint_addr = ab_address[i]; hit_watchpoint_addr = ab_address[i];
@ -1055,10 +1055,10 @@ m32r_xfer_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len,
{ {
if (write) if (write)
fprintf_unfiltered (gdb_stdlog, "m32r_xfer_memory(%s,%d,write)\n", fprintf_unfiltered (gdb_stdlog, "m32r_xfer_memory(%s,%d,write)\n",
paddress (target_gdbarch, memaddr), len); paddress (target_gdbarch (), memaddr), len);
else else
fprintf_unfiltered (gdb_stdlog, "m32r_xfer_memory(%s,%d,read)\n", fprintf_unfiltered (gdb_stdlog, "m32r_xfer_memory(%s,%d,read)\n",
paddress (target_gdbarch, memaddr), len); paddress (target_gdbarch (), memaddr), len);
} }
if (write) if (write)
@ -1424,7 +1424,7 @@ m32r_insert_watchpoint (CORE_ADDR addr, int len, int type,
if (remote_debug) if (remote_debug)
fprintf_unfiltered (gdb_stdlog, "m32r_insert_watchpoint(%s,%d,%d)\n", fprintf_unfiltered (gdb_stdlog, "m32r_insert_watchpoint(%s,%d,%d)\n",
paddress (target_gdbarch, addr), len, type); paddress (target_gdbarch (), addr), len, type);
for (i = 0; i < MAX_ACCESS_BREAKS; i++) for (i = 0; i < MAX_ACCESS_BREAKS; i++)
{ {
@ -1449,7 +1449,7 @@ m32r_remove_watchpoint (CORE_ADDR addr, int len, int type,
if (remote_debug) if (remote_debug)
fprintf_unfiltered (gdb_stdlog, "m32r_remove_watchpoint(%s,%d,%d)\n", fprintf_unfiltered (gdb_stdlog, "m32r_remove_watchpoint(%s,%d,%d)\n",
paddress (target_gdbarch, addr), len, type); paddress (target_gdbarch (), addr), len, type);
for (i = 0; i < MAX_ACCESS_BREAKS; i++) for (i = 0; i < MAX_ACCESS_BREAKS; i++)
{ {

View file

@ -1242,7 +1242,7 @@ mips_request (int cmd,
int timeout, int timeout,
char *buff) char *buff)
{ {
int addr_size = gdbarch_addr_bit (target_gdbarch) / 8; int addr_size = gdbarch_addr_bit (target_gdbarch ()) / 8;
char myBuff[DATA_MAXLEN + 1]; char myBuff[DATA_MAXLEN + 1];
char response_string[17]; char response_string[17];
int len; int len;
@ -1663,10 +1663,10 @@ static void
mips_open (char *name, int from_tty) mips_open (char *name, int from_tty)
{ {
const char *monitor_prompt = NULL; const char *monitor_prompt = NULL;
if (gdbarch_bfd_arch_info (target_gdbarch) != NULL if (gdbarch_bfd_arch_info (target_gdbarch ()) != NULL
&& gdbarch_bfd_arch_info (target_gdbarch)->arch == bfd_arch_mips) && gdbarch_bfd_arch_info (target_gdbarch ())->arch == bfd_arch_mips)
{ {
switch (gdbarch_bfd_arch_info (target_gdbarch)->mach) switch (gdbarch_bfd_arch_info (target_gdbarch ())->mach)
{ {
case bfd_mach_mips4100: case bfd_mach_mips4100:
case bfd_mach_mips4300: case bfd_mach_mips4300:
@ -2147,7 +2147,7 @@ static int
mips_xfer_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len, int write, mips_xfer_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len, int write,
struct mem_attrib *attrib, struct target_ops *target) struct mem_attrib *attrib, struct target_ops *target)
{ {
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
int i; int i;
CORE_ADDR addr; CORE_ADDR addr;
int count; int count;
@ -2479,7 +2479,7 @@ static int
mips_check_lsi_error (CORE_ADDR addr, int rerrflg) mips_check_lsi_error (CORE_ADDR addr, int rerrflg)
{ {
struct lsi_error *err; struct lsi_error *err;
const char *saddr = paddress (target_gdbarch, addr); const char *saddr = paddress (target_gdbarch (), addr);
if (rerrflg == 0) /* no error */ if (rerrflg == 0) /* no error */
return 0; return 0;
@ -2547,13 +2547,13 @@ mips_common_breakpoint (%s): Unknown error: 0x%x\n",
static int static int
mips_common_breakpoint (int set, CORE_ADDR addr, int len, enum break_type type) mips_common_breakpoint (int set, CORE_ADDR addr, int len, enum break_type type)
{ {
int addr_size = gdbarch_addr_bit (target_gdbarch) / 8; int addr_size = gdbarch_addr_bit (target_gdbarch ()) / 8;
char buf[DATA_MAXLEN + 1]; char buf[DATA_MAXLEN + 1];
char cmd, rcmd; char cmd, rcmd;
int rpid, rerrflg, rresponse, rlen; int rpid, rerrflg, rresponse, rlen;
int nfields; int nfields;
addr = gdbarch_addr_bits_remove (target_gdbarch, addr); addr = gdbarch_addr_bits_remove (target_gdbarch (), addr);
if (mips_monitor == MON_LSI) if (mips_monitor == MON_LSI)
{ {
@ -2581,7 +2581,7 @@ mips_common_breakpoint (int set, CORE_ADDR addr, int len, enum break_type type)
{ {
warning (_("\ warning (_("\
mips_common_breakpoint: Attempt to clear bogus breakpoint at %s"), mips_common_breakpoint: Attempt to clear bogus breakpoint at %s"),
paddress (target_gdbarch, addr)); paddress (target_gdbarch (), addr));
return 1; return 1;
} }
@ -2732,7 +2732,7 @@ mips_common_breakpoint: Attempt to clear bogus breakpoint at %s"),
if (rresponse != 22) /* invalid argument */ if (rresponse != 22) /* invalid argument */
fprintf_unfiltered (gdb_stderr, "\ fprintf_unfiltered (gdb_stderr, "\
mips_common_breakpoint (%s): Got error: 0x%x\n", mips_common_breakpoint (%s): Got error: 0x%x\n",
paddress (target_gdbarch, addr), rresponse); paddress (target_gdbarch (), addr), rresponse);
return 1; return 1;
} }
} }
@ -2765,7 +2765,7 @@ send_srec (char *srec, int len, CORE_ADDR addr)
case 0x15: /* NACK */ case 0x15: /* NACK */
fprintf_unfiltered (gdb_stderr, fprintf_unfiltered (gdb_stderr,
"Download got a NACK at byte %s! Retrying.\n", "Download got a NACK at byte %s! Retrying.\n",
paddress (target_gdbarch, addr)); paddress (target_gdbarch (), addr));
continue; continue;
default: default:
error (_("Download got unexpected ack char: 0x%x, retrying."), error (_("Download got unexpected ack char: 0x%x, retrying."),

View file

@ -1098,7 +1098,7 @@ gdbsim_xfer_inferior_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len,
printf_filtered ("gdbsim_xfer_inferior_memory: myaddr 0x"); printf_filtered ("gdbsim_xfer_inferior_memory: myaddr 0x");
gdb_print_host_address (myaddr, gdb_stdout); gdb_print_host_address (myaddr, gdb_stdout);
printf_filtered (", memaddr %s, len %d, write %d\n", printf_filtered (", memaddr %s, len %d, write %d\n",
paddress (target_gdbarch, memaddr), len, write); paddress (target_gdbarch (), memaddr), len, write);
if (remote_debug && write) if (remote_debug && write)
dump_mem (myaddr, len); dump_mem (myaddr, len);
} }

View file

@ -397,9 +397,9 @@ struct packet_reg
long regnum; /* GDB's internal register number. */ long regnum; /* GDB's internal register number. */
LONGEST pnum; /* Remote protocol register number. */ LONGEST pnum; /* Remote protocol register number. */
int in_g_packet; /* Always part of G packet. */ int in_g_packet; /* Always part of G packet. */
/* long size in bytes; == register_size (target_gdbarch, regnum); /* long size in bytes; == register_size (target_gdbarch (), regnum);
at present. */ at present. */
/* char *name; == gdbarch_register_name (target_gdbarch, regnum); /* char *name; == gdbarch_register_name (target_gdbarch (), regnum);
at present. */ at present. */
}; };
@ -484,7 +484,7 @@ remote_get_noisy_reply (char **buf_p,
TRY_CATCH (ex, RETURN_MASK_ALL) TRY_CATCH (ex, RETURN_MASK_ALL)
{ {
gdbarch_relocate_instruction (target_gdbarch, &to, from); gdbarch_relocate_instruction (target_gdbarch (), &to, from);
} }
if (ex.reason >= 0) if (ex.reason >= 0)
{ {
@ -525,7 +525,7 @@ static struct gdbarch_data *remote_gdbarch_data_handle;
static struct remote_arch_state * static struct remote_arch_state *
get_remote_arch_state (void) get_remote_arch_state (void)
{ {
return gdbarch_data (target_gdbarch, remote_gdbarch_data_handle); return gdbarch_data (target_gdbarch (), remote_gdbarch_data_handle);
} }
/* Fetch the global remote target state. */ /* Fetch the global remote target state. */
@ -698,7 +698,7 @@ get_remote_packet_size (void)
static struct packet_reg * static struct packet_reg *
packet_reg_from_regnum (struct remote_arch_state *rsa, long regnum) packet_reg_from_regnum (struct remote_arch_state *rsa, long regnum)
{ {
if (regnum < 0 && regnum >= gdbarch_num_regs (target_gdbarch)) if (regnum < 0 && regnum >= gdbarch_num_regs (target_gdbarch ()))
return NULL; return NULL;
else else
{ {
@ -714,7 +714,7 @@ packet_reg_from_pnum (struct remote_arch_state *rsa, LONGEST pnum)
{ {
int i; int i;
for (i = 0; i < gdbarch_num_regs (target_gdbarch); i++) for (i = 0; i < gdbarch_num_regs (target_gdbarch ()); i++)
{ {
struct packet_reg *r = &rsa->regs[i]; struct packet_reg *r = &rsa->regs[i];
@ -1481,7 +1481,7 @@ remote_add_inferior (int fake_pid_p, int pid, int attached)
if (attached == -1) if (attached == -1)
attached = remote_query_attached (pid); attached = remote_query_attached (pid);
if (gdbarch_has_global_solist (target_gdbarch)) if (gdbarch_has_global_solist (target_gdbarch ()))
{ {
/* If the target shares code across all inferiors, then every /* If the target shares code across all inferiors, then every
attach adds a new inferior. */ attach adds a new inferior. */
@ -3338,7 +3338,7 @@ remote_start_remote (int from_tty, struct target_ops *target, int extended_p)
/* On OSs where the list of libraries is global to all /* On OSs where the list of libraries is global to all
processes, we fetch them early. */ processes, we fetch them early. */
if (gdbarch_has_global_solist (target_gdbarch)) if (gdbarch_has_global_solist (target_gdbarch ()))
solib_add (NULL, from_tty, target, auto_solib_add); solib_add (NULL, from_tty, target, auto_solib_add);
if (non_stop) if (non_stop)
@ -3420,7 +3420,7 @@ remote_start_remote (int from_tty, struct target_ops *target, int extended_p)
supported for non-stop; it could be, but it is tricky if supported for non-stop; it could be, but it is tricky if
there are no stopped threads when we connect. */ there are no stopped threads when we connect. */
if (remote_read_description_p (target) if (remote_read_description_p (target)
&& gdbarch_target_desc (target_gdbarch) == NULL) && gdbarch_target_desc (target_gdbarch ()) == NULL)
{ {
target_clear_description (); target_clear_description ();
target_find_description (); target_find_description ();
@ -3539,7 +3539,7 @@ remote_start_remote (int from_tty, struct target_ops *target, int extended_p)
rs->starting_up = 0; rs->starting_up = 0;
/* If breakpoints are global, insert them now. */ /* If breakpoints are global, insert them now. */
if (gdbarch_has_global_breakpoints (target_gdbarch) if (gdbarch_has_global_breakpoints (target_gdbarch ())
&& breakpoints_always_inserted_mode ()) && breakpoints_always_inserted_mode ())
insert_breakpoints (); insert_breakpoints ();
} }
@ -3619,12 +3619,12 @@ remote_check_symbols (struct objfile *objfile)
xsnprintf (msg, get_remote_packet_size (), "qSymbol::%s", &reply[8]); xsnprintf (msg, get_remote_packet_size (), "qSymbol::%s", &reply[8]);
else else
{ {
int addr_size = gdbarch_addr_bit (target_gdbarch) / 8; int addr_size = gdbarch_addr_bit (target_gdbarch ()) / 8;
CORE_ADDR sym_addr = SYMBOL_VALUE_ADDRESS (sym); CORE_ADDR sym_addr = SYMBOL_VALUE_ADDRESS (sym);
/* If this is a function address, return the start of code /* If this is a function address, return the start of code
instead of any data function descriptor. */ instead of any data function descriptor. */
sym_addr = gdbarch_convert_from_func_ptr_addr (target_gdbarch, sym_addr = gdbarch_convert_from_func_ptr_addr (target_gdbarch (),
sym_addr, sym_addr,
&current_target); &current_target);
@ -5407,10 +5407,10 @@ Packet: '%s'\n"),
cached_reg.num = reg->regnum; cached_reg.num = reg->regnum;
fieldsize = hex2bin (p, cached_reg.data, fieldsize = hex2bin (p, cached_reg.data,
register_size (target_gdbarch, register_size (target_gdbarch (),
reg->regnum)); reg->regnum));
p += 2 * fieldsize; p += 2 * fieldsize;
if (fieldsize < register_size (target_gdbarch, if (fieldsize < register_size (target_gdbarch (),
reg->regnum)) reg->regnum))
warning (_("Remote reply is too short: %s"), buf); warning (_("Remote reply is too short: %s"), buf);
@ -5604,7 +5604,7 @@ process_stop_reply (struct stop_reply *stop_reply,
if (stop_reply->regcache) if (stop_reply->regcache)
{ {
struct regcache *regcache struct regcache *regcache
= get_thread_arch_regcache (ptid, target_gdbarch); = get_thread_arch_regcache (ptid, target_gdbarch ());
cached_reg_t *reg; cached_reg_t *reg;
int ix; int ix;
@ -6318,7 +6318,7 @@ remote_address_masked (CORE_ADDR addr)
/* If "remoteaddresssize" was not set, default to target address size. */ /* If "remoteaddresssize" was not set, default to target address size. */
if (!address_size) if (!address_size)
address_size = gdbarch_addr_bit (target_gdbarch); address_size = gdbarch_addr_bit (target_gdbarch ());
if (address_size > 0 if (address_size > 0
&& address_size < (sizeof (ULONGEST) * 8)) && address_size < (sizeof (ULONGEST) * 8))
@ -6854,7 +6854,7 @@ static void
remote_flash_erase (struct target_ops *ops, remote_flash_erase (struct target_ops *ops,
ULONGEST address, LONGEST length) ULONGEST address, LONGEST length)
{ {
int addr_size = gdbarch_addr_bit (target_gdbarch) / 8; int addr_size = gdbarch_addr_bit (target_gdbarch ()) / 8;
int saved_remote_timeout = remote_timeout; int saved_remote_timeout = remote_timeout;
enum packet_result ret; enum packet_result ret;
struct cleanup *back_to = make_cleanup (restore_remote_timeout, struct cleanup *back_to = make_cleanup (restore_remote_timeout,
@ -8378,12 +8378,12 @@ compare_sections_command (char *args, int from_tty)
if (res == -1) if (res == -1)
error (_("target memory fault, section %s, range %s -- %s"), sectname, error (_("target memory fault, section %s, range %s -- %s"), sectname,
paddress (target_gdbarch, lma), paddress (target_gdbarch (), lma),
paddress (target_gdbarch, lma + size)); paddress (target_gdbarch (), lma + size));
printf_filtered ("Section %s, range %s -- %s: ", sectname, printf_filtered ("Section %s, range %s -- %s: ", sectname,
paddress (target_gdbarch, lma), paddress (target_gdbarch (), lma),
paddress (target_gdbarch, lma + size)); paddress (target_gdbarch (), lma + size));
if (res) if (res)
printf_filtered ("matched.\n"); printf_filtered ("matched.\n");
else else
@ -8739,7 +8739,7 @@ remote_search_memory (struct target_ops* ops,
const gdb_byte *pattern, ULONGEST pattern_len, const gdb_byte *pattern, ULONGEST pattern_len,
CORE_ADDR *found_addrp) CORE_ADDR *found_addrp)
{ {
int addr_size = gdbarch_addr_bit (target_gdbarch) / 8; int addr_size = gdbarch_addr_bit (target_gdbarch ()) / 8;
struct remote_state *rs = get_remote_state (); struct remote_state *rs = get_remote_state ();
int max_size = get_memory_write_packet_size (); int max_size = get_memory_write_packet_size ();
struct packet_config *packet = struct packet_config *packet =
@ -9273,7 +9273,7 @@ static int
remote_read_description_p (struct target_ops *target) remote_read_description_p (struct target_ops *target)
{ {
struct remote_g_packet_data *data struct remote_g_packet_data *data
= gdbarch_data (target_gdbarch, remote_g_packet_data_handle); = gdbarch_data (target_gdbarch (), remote_g_packet_data_handle);
if (!VEC_empty (remote_g_packet_guess_s, data->guesses)) if (!VEC_empty (remote_g_packet_guess_s, data->guesses))
return 1; return 1;
@ -9285,7 +9285,7 @@ static const struct target_desc *
remote_read_description (struct target_ops *target) remote_read_description (struct target_ops *target)
{ {
struct remote_g_packet_data *data struct remote_g_packet_data *data
= gdbarch_data (target_gdbarch, remote_g_packet_data_handle); = gdbarch_data (target_gdbarch (), remote_g_packet_data_handle);
/* Do not try this during initial connection, when we do not know /* Do not try this during initial connection, when we do not know
whether there is a running but stopped thread. */ whether there is a running but stopped thread. */
@ -10279,7 +10279,7 @@ remote_download_tracepoint (struct bp_location *loc)
{ {
int isize; int isize;
if (gdbarch_fast_tracepoint_valid_at (target_gdbarch, if (gdbarch_fast_tracepoint_valid_at (target_gdbarch (),
tpaddr, &isize, NULL)) tpaddr, &isize, NULL))
xsnprintf (buf + strlen (buf), BUF_SIZE - strlen (buf), ":F%x", xsnprintf (buf + strlen (buf), BUF_SIZE - strlen (buf), ":F%x",
isize); isize);

View file

@ -616,7 +616,7 @@ check_for_saved (void *result_untyped, pv_t addr, CORE_ADDR size,
if (value.kind == pvk_register if (value.kind == pvk_register
&& value.k == 0 && value.k == 0
&& pv_is_register (addr, RL78_SP_REGNUM) && pv_is_register (addr, RL78_SP_REGNUM)
&& size == register_size (target_gdbarch, value.reg)) && size == register_size (target_gdbarch (), value.reg))
result->reg_offset[value.reg] = addr.k; result->reg_offset[value.reg] = addr.k;
} }
@ -643,7 +643,7 @@ rl78_analyze_prologue (CORE_ADDR start_pc,
result->reg_offset[rn] = 1; result->reg_offset[rn] = 1;
} }
stack = make_pv_area (RL78_SP_REGNUM, gdbarch_addr_bit (target_gdbarch)); stack = make_pv_area (RL78_SP_REGNUM, gdbarch_addr_bit (target_gdbarch ()));
back_to = make_cleanup_free_pv_area (stack); back_to = make_cleanup_free_pv_area (stack);
/* The call instruction has saved the return address on the stack. */ /* The call instruction has saved the return address on the stack. */

View file

@ -76,7 +76,7 @@
#ifndef ARCH3264 #ifndef ARCH3264
# define ARCH64() 0 # define ARCH64() 0
#else #else
# define ARCH64() (register_size (target_gdbarch, 0) == 8) # define ARCH64() (register_size (target_gdbarch (), 0) == 8)
#endif #endif
/* Union of 32-bit and 64-bit versions of ld_info. */ /* Union of 32-bit and 64-bit versions of ld_info. */

View file

@ -154,7 +154,7 @@ check_for_saved (void *result_untyped, pv_t addr, CORE_ADDR size, pv_t value)
if (value.kind == pvk_register if (value.kind == pvk_register
&& value.k == 0 && value.k == 0
&& pv_is_register (addr, RX_SP_REGNUM) && pv_is_register (addr, RX_SP_REGNUM)
&& size == register_size (target_gdbarch, value.reg)) && size == register_size (target_gdbarch (), value.reg))
result->reg_offset[value.reg] = addr.k; result->reg_offset[value.reg] = addr.k;
} }
@ -207,7 +207,7 @@ rx_analyze_prologue (CORE_ADDR start_pc,
result->reg_offset[rn] = 1; result->reg_offset[rn] = 1;
} }
stack = make_pv_area (RX_SP_REGNUM, gdbarch_addr_bit (target_gdbarch)); stack = make_pv_area (RX_SP_REGNUM, gdbarch_addr_bit (target_gdbarch ()));
back_to = make_cleanup_free_pv_area (stack); back_to = make_cleanup_free_pv_area (stack);
/* The call instruction has saved the return address on the stack. */ /* The call instruction has saved the return address on the stack. */

View file

@ -601,7 +601,7 @@ s390_auxv_parse (struct target_ops *ops, gdb_byte **readptr,
gdb_byte *endptr, CORE_ADDR *typep, CORE_ADDR *valp) gdb_byte *endptr, CORE_ADDR *typep, CORE_ADDR *valp)
{ {
int sizeof_auxv_field = s390_target_wordsize (); int sizeof_auxv_field = s390_target_wordsize ();
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
gdb_byte *ptr = *readptr; gdb_byte *ptr = *readptr;
if (endptr == ptr) if (endptr == ptr)

View file

@ -861,7 +861,7 @@ ps_lgetregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, prgregset_t gregset)
old_chain = save_inferior_ptid (); old_chain = save_inferior_ptid ();
inferior_ptid = BUILD_LWP (lwpid, PIDGET (inferior_ptid)); inferior_ptid = BUILD_LWP (lwpid, PIDGET (inferior_ptid));
regcache = get_thread_arch_regcache (inferior_ptid, target_gdbarch); regcache = get_thread_arch_regcache (inferior_ptid, target_gdbarch ());
target_fetch_registers (regcache, -1); target_fetch_registers (regcache, -1);
fill_gregset (regcache, (gdb_gregset_t *) gregset, -1); fill_gregset (regcache, (gdb_gregset_t *) gregset, -1);
@ -883,7 +883,7 @@ ps_lsetregs (gdb_ps_prochandle_t ph, lwpid_t lwpid,
old_chain = save_inferior_ptid (); old_chain = save_inferior_ptid ();
inferior_ptid = BUILD_LWP (lwpid, PIDGET (inferior_ptid)); inferior_ptid = BUILD_LWP (lwpid, PIDGET (inferior_ptid));
regcache = get_thread_arch_regcache (inferior_ptid, target_gdbarch); regcache = get_thread_arch_regcache (inferior_ptid, target_gdbarch ());
supply_gregset (regcache, (const gdb_gregset_t *) gregset); supply_gregset (regcache, (const gdb_gregset_t *) gregset);
target_store_registers (regcache, -1); target_store_registers (regcache, -1);
@ -917,7 +917,7 @@ ps_lgetfpregs (gdb_ps_prochandle_t ph, lwpid_t lwpid,
old_chain = save_inferior_ptid (); old_chain = save_inferior_ptid ();
inferior_ptid = BUILD_LWP (lwpid, PIDGET (inferior_ptid)); inferior_ptid = BUILD_LWP (lwpid, PIDGET (inferior_ptid));
regcache = get_thread_arch_regcache (inferior_ptid, target_gdbarch); regcache = get_thread_arch_regcache (inferior_ptid, target_gdbarch ());
target_fetch_registers (regcache, -1); target_fetch_registers (regcache, -1);
fill_fpregset (regcache, (gdb_fpregset_t *) fpregset, -1); fill_fpregset (regcache, (gdb_fpregset_t *) fpregset, -1);
@ -939,7 +939,7 @@ ps_lsetfpregs (gdb_ps_prochandle_t ph, lwpid_t lwpid,
old_chain = save_inferior_ptid (); old_chain = save_inferior_ptid ();
inferior_ptid = BUILD_LWP (lwpid, PIDGET (inferior_ptid)); inferior_ptid = BUILD_LWP (lwpid, PIDGET (inferior_ptid));
regcache = get_thread_arch_regcache (inferior_ptid, target_gdbarch); regcache = get_thread_arch_regcache (inferior_ptid, target_gdbarch ());
supply_fpregset (regcache, (const gdb_fpregset_t *) fpregset); supply_fpregset (regcache, (const gdb_fpregset_t *) fpregset);
target_store_registers (regcache, -1); target_store_registers (regcache, -1);
@ -1119,7 +1119,7 @@ info_cb (const td_thrhandle_t *th, void *s)
SYMBOL_PRINT_NAME (msym)); SYMBOL_PRINT_NAME (msym));
else else
printf_filtered (" startfunc: %s\n", printf_filtered (" startfunc: %s\n",
paddress (target_gdbarch, ti.ti_startfunc)); paddress (target_gdbarch (), ti.ti_startfunc));
} }
/* If thread is asleep, print function that went to sleep. */ /* If thread is asleep, print function that went to sleep. */
@ -1132,7 +1132,7 @@ info_cb (const td_thrhandle_t *th, void *s)
SYMBOL_PRINT_NAME (msym)); SYMBOL_PRINT_NAME (msym));
else else
printf_filtered (" - Sleep func: %s\n", printf_filtered (" - Sleep func: %s\n",
paddress (target_gdbarch, ti.ti_startfunc)); paddress (target_gdbarch (), ti.ti_startfunc));
} }
/* Wrap up line, if necessary. */ /* Wrap up line, if necessary. */

View file

@ -127,8 +127,8 @@ static void
darwin_load_image_infos (struct darwin_info *info) darwin_load_image_infos (struct darwin_info *info)
{ {
gdb_byte buf[24]; gdb_byte buf[24];
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
struct type *ptr_type = builtin_type (target_gdbarch)->builtin_data_ptr; struct type *ptr_type = builtin_type (target_gdbarch ())->builtin_data_ptr;
int len; int len;
/* If the structure address is not known, don't continue. */ /* If the structure address is not known, don't continue. */
@ -245,8 +245,8 @@ open_symbol_file_object (void *from_ttyp)
static struct so_list * static struct so_list *
darwin_current_sos (void) darwin_current_sos (void)
{ {
struct type *ptr_type = builtin_type (target_gdbarch)->builtin_data_ptr; struct type *ptr_type = builtin_type (target_gdbarch ())->builtin_data_ptr;
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
int ptr_len = TYPE_LENGTH (ptr_type); int ptr_len = TYPE_LENGTH (ptr_type);
unsigned int image_info_size; unsigned int image_info_size;
struct so_list *head = NULL; struct so_list *head = NULL;
@ -378,7 +378,7 @@ darwin_solib_get_all_image_info_addr_at_init (struct darwin_info *info)
make_cleanup_bfd_unref (dyld_bfd); make_cleanup_bfd_unref (dyld_bfd);
sub = bfd_mach_o_fat_extract (dyld_bfd, bfd_object, sub = bfd_mach_o_fat_extract (dyld_bfd, bfd_object,
gdbarch_bfd_arch_info (target_gdbarch)); gdbarch_bfd_arch_info (target_gdbarch ()));
if (sub) if (sub)
{ {
dyld_bfd = sub; dyld_bfd = sub;
@ -420,7 +420,7 @@ darwin_solib_read_all_image_info_addr (struct darwin_info *info)
{ {
gdb_byte buf[8 + 8 + 4]; gdb_byte buf[8 + 8 + 4];
LONGEST len; LONGEST len;
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
len = target_read (&current_target, TARGET_OBJECT_DARWIN_DYLD_INFO, NULL, len = target_read (&current_target, TARGET_OBJECT_DARWIN_DYLD_INFO, NULL,
buf, 0, sizeof (buf)); buf, 0, sizeof (buf));
@ -450,7 +450,7 @@ darwin_solib_create_inferior_hook (int from_tty)
darwin_load_image_infos (info); darwin_load_image_infos (info);
if (darwin_dyld_version_ok (info)) if (darwin_dyld_version_ok (info))
create_solib_event_breakpoint (target_gdbarch, info->all_image.notifier); create_solib_event_breakpoint (target_gdbarch (), info->all_image.notifier);
} }
static void static void
@ -515,7 +515,7 @@ darwin_bfd_open (char *pathname)
abfd = solib_bfd_fopen (found_pathname, found_file); abfd = solib_bfd_fopen (found_pathname, found_file);
res = bfd_mach_o_fat_extract (abfd, bfd_object, res = bfd_mach_o_fat_extract (abfd, bfd_object,
gdbarch_bfd_arch_info (target_gdbarch)); gdbarch_bfd_arch_info (target_gdbarch ()));
if (!res) if (!res)
{ {
make_cleanup_bfd_unref (abfd); make_cleanup_bfd_unref (abfd);

View file

@ -212,13 +212,13 @@ dsbt_print_loadmap (struct int_elf32_dsbt_loadmap *map)
for (i = 0; i < map->nsegs; i++) for (i = 0; i < map->nsegs; i++)
printf_filtered ("%s:%s -> %s:%s\n", printf_filtered ("%s:%s -> %s:%s\n",
print_core_address (target_gdbarch, print_core_address (target_gdbarch (),
map->segs[i].p_vaddr), map->segs[i].p_vaddr),
print_core_address (target_gdbarch, print_core_address (target_gdbarch (),
map->segs[i].p_vaddr map->segs[i].p_vaddr
+ map->segs[i].p_memsz), + map->segs[i].p_memsz),
print_core_address (target_gdbarch, map->segs[i].addr), print_core_address (target_gdbarch (), map->segs[i].addr),
print_core_address (target_gdbarch, map->segs[i].addr print_core_address (target_gdbarch (), map->segs[i].addr
+ map->segs[i].p_memsz)); + map->segs[i].p_memsz));
} }
} }
@ -228,7 +228,7 @@ dsbt_print_loadmap (struct int_elf32_dsbt_loadmap *map)
static struct int_elf32_dsbt_loadmap * static struct int_elf32_dsbt_loadmap *
decode_loadmap (gdb_byte *buf) decode_loadmap (gdb_byte *buf)
{ {
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
struct ext_elf32_dsbt_loadmap *ext_ldmbuf; struct ext_elf32_dsbt_loadmap *ext_ldmbuf;
struct int_elf32_dsbt_loadmap *int_ldmbuf; struct int_elf32_dsbt_loadmap *int_ldmbuf;
@ -327,7 +327,7 @@ dsbt_get_initial_loadmaps (void)
static struct int_elf32_dsbt_loadmap * static struct int_elf32_dsbt_loadmap *
fetch_loadmap (CORE_ADDR ldmaddr) fetch_loadmap (CORE_ADDR ldmaddr)
{ {
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
struct ext_elf32_dsbt_loadmap ext_ldmbuf_partial; struct ext_elf32_dsbt_loadmap ext_ldmbuf_partial;
struct ext_elf32_dsbt_loadmap *ext_ldmbuf; struct ext_elf32_dsbt_loadmap *ext_ldmbuf;
struct int_elf32_dsbt_loadmap *int_ldmbuf; struct int_elf32_dsbt_loadmap *int_ldmbuf;
@ -496,7 +496,7 @@ scan_dyntag (int dyntag, bfd *abfd, CORE_ADDR *ptr)
gdb_byte ptr_buf[8]; gdb_byte ptr_buf[8];
CORE_ADDR ptr_addr; CORE_ADDR ptr_addr;
ptr_type = builtin_type (target_gdbarch)->builtin_data_ptr; ptr_type = builtin_type (target_gdbarch ())->builtin_data_ptr;
ptr_addr = dyn_addr + (buf - bufstart) + arch_size / 8; ptr_addr = dyn_addr + (buf - bufstart) + arch_size / 8;
if (target_read_memory (ptr_addr, ptr_buf, arch_size / 8) == 0) if (target_read_memory (ptr_addr, ptr_buf, arch_size / 8) == 0)
dyn_ptr = extract_typed_address (ptr_buf, ptr_type); dyn_ptr = extract_typed_address (ptr_buf, ptr_type);
@ -555,7 +555,7 @@ displacement_from_map (struct int_elf32_dsbt_loadmap *map,
static CORE_ADDR static CORE_ADDR
lm_base (void) lm_base (void)
{ {
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
struct minimal_symbol *got_sym; struct minimal_symbol *got_sym;
CORE_ADDR addr; CORE_ADDR addr;
gdb_byte buf[TIC6X_PTR_SIZE]; gdb_byte buf[TIC6X_PTR_SIZE];
@ -635,7 +635,7 @@ lm_base (void)
static struct so_list * static struct so_list *
dsbt_current_sos (void) dsbt_current_sos (void)
{ {
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
CORE_ADDR lm_addr; CORE_ADDR lm_addr;
struct so_list *sos_head = NULL; struct so_list *sos_head = NULL;
struct so_list **sos_next_ptr = &sos_head; struct so_list **sos_next_ptr = &sos_head;
@ -814,7 +814,7 @@ cmp_name (asymbol *sym, void *data)
static int static int
enable_break2 (void) enable_break2 (void)
{ {
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
int success = 0; int success = 0;
char **bkpt_namep; char **bkpt_namep;
asection *interp_sect; asection *interp_sect;
@ -965,7 +965,7 @@ enable_break2 (void)
remove_solib_event_breakpoints (); remove_solib_event_breakpoints ();
/* Now (finally!) create the solib breakpoint. */ /* Now (finally!) create the solib breakpoint. */
create_solib_event_breakpoint (target_gdbarch, addr); create_solib_event_breakpoint (target_gdbarch (), addr);
info->enable_break2_done = 1; info->enable_break2_done = 1;
@ -1007,7 +1007,7 @@ enable_break (void)
return 0; return 0;
} }
create_solib_event_breakpoint (target_gdbarch, create_solib_event_breakpoint (target_gdbarch (),
SYMBOL_VALUE_ADDRESS (start)); SYMBOL_VALUE_ADDRESS (start));
if (solib_dsbt_debug) if (solib_dsbt_debug)

View file

@ -98,7 +98,7 @@ struct int_elf32_fdpic_loadmap {
static struct int_elf32_fdpic_loadmap * static struct int_elf32_fdpic_loadmap *
fetch_loadmap (CORE_ADDR ldmaddr) fetch_loadmap (CORE_ADDR ldmaddr)
{ {
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
struct ext_elf32_fdpic_loadmap ext_ldmbuf_partial; struct ext_elf32_fdpic_loadmap ext_ldmbuf_partial;
struct ext_elf32_fdpic_loadmap *ext_ldmbuf; struct ext_elf32_fdpic_loadmap *ext_ldmbuf;
struct int_elf32_fdpic_loadmap *int_ldmbuf; struct int_elf32_fdpic_loadmap *int_ldmbuf;
@ -265,7 +265,7 @@ static CORE_ADDR main_lm_addr = 0;
static CORE_ADDR static CORE_ADDR
lm_base (void) lm_base (void)
{ {
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
struct minimal_symbol *got_sym; struct minimal_symbol *got_sym;
CORE_ADDR addr; CORE_ADDR addr;
gdb_byte buf[FRV_PTR_SIZE]; gdb_byte buf[FRV_PTR_SIZE];
@ -317,7 +317,7 @@ lm_base (void)
static struct so_list * static struct so_list *
frv_current_sos (void) frv_current_sos (void)
{ {
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
CORE_ADDR lm_addr, mgot; CORE_ADDR lm_addr, mgot;
struct so_list *sos_head = NULL; struct so_list *sos_head = NULL;
struct so_list **sos_next_ptr = &sos_head; struct so_list **sos_next_ptr = &sos_head;
@ -518,7 +518,7 @@ static int enable_break2_done = 0;
static int static int
enable_break2 (void) enable_break2 (void)
{ {
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
int success = 0; int success = 0;
char **bkpt_namep; char **bkpt_namep;
asection *interp_sect; asection *interp_sect;
@ -569,7 +569,7 @@ enable_break2 (void)
return 0; return 0;
} }
status = frv_fdpic_loadmap_addresses (target_gdbarch, status = frv_fdpic_loadmap_addresses (target_gdbarch (),
&interp_loadmap_addr, 0); &interp_loadmap_addr, 0);
if (status < 0) if (status < 0)
{ {
@ -703,7 +703,7 @@ enable_break2 (void)
remove_solib_event_breakpoints (); remove_solib_event_breakpoints ();
/* Now (finally!) create the solib breakpoint. */ /* Now (finally!) create the solib breakpoint. */
create_solib_event_breakpoint (target_gdbarch, addr); create_solib_event_breakpoint (target_gdbarch (), addr);
enable_break2_done = 1; enable_break2_done = 1;
@ -751,7 +751,7 @@ enable_break (void)
return 0; return 0;
} }
create_solib_event_breakpoint (target_gdbarch, create_solib_event_breakpoint (target_gdbarch (),
symfile_objfile->ei.entry_point); symfile_objfile->ei.entry_point);
if (solib_frv_debug) if (solib_frv_debug)
@ -782,7 +782,7 @@ frv_relocate_main_executable (void)
int changed; int changed;
struct obj_section *osect; struct obj_section *osect;
status = frv_fdpic_loadmap_addresses (target_gdbarch, status = frv_fdpic_loadmap_addresses (target_gdbarch (),
&interp_addr, &exec_addr); &interp_addr, &exec_addr);
if (status < 0 || (exec_addr == 0 && interp_addr == 0)) if (status < 0 || (exec_addr == 0 && interp_addr == 0))
@ -1021,7 +1021,7 @@ find_canonical_descriptor_in_load_object
(CORE_ADDR entry_point, CORE_ADDR got_value, const char *name, bfd *abfd, (CORE_ADDR entry_point, CORE_ADDR got_value, const char *name, bfd *abfd,
struct lm_info *lm) struct lm_info *lm)
{ {
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
arelent *rel; arelent *rel;
unsigned int i; unsigned int i;
CORE_ADDR addr = 0; CORE_ADDR addr = 0;

View file

@ -396,7 +396,7 @@ ia64_hpux_clear_solib (void)
static CORE_ADDR static CORE_ADDR
ia64_hpux_get_load_info_addr (void) ia64_hpux_get_load_info_addr (void)
{ {
struct type *data_ptr_type = builtin_type (target_gdbarch)->builtin_data_ptr; struct type *data_ptr_type = builtin_type (target_gdbarch ())->builtin_data_ptr;
CORE_ADDR addr; CORE_ADDR addr;
int status; int status;

View file

@ -142,7 +142,7 @@ extract_mips_address (void *addr, int len, enum bfd_endian byte_order)
static struct lm_info static struct lm_info
fetch_lm_info (CORE_ADDR addr) fetch_lm_info (CORE_ADDR addr)
{ {
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
struct lm_info li; struct lm_info li;
union irix_obj_info buf; union irix_obj_info buf;
@ -306,7 +306,7 @@ disable_break (void)
/* Note that breakpoint address and original contents are in our address /* Note that breakpoint address and original contents are in our address
space, so we just need to write the original contents back. */ space, so we just need to write the original contents back. */
if (deprecated_remove_raw_breakpoint (target_gdbarch, base_breakpoint) != 0) if (deprecated_remove_raw_breakpoint (target_gdbarch (), base_breakpoint) != 0)
{ {
status = 0; status = 0;
} }
@ -339,7 +339,7 @@ enable_break (void)
if (!entry_point_address_query (&entry_point)) if (!entry_point_address_query (&entry_point))
return 0; return 0;
base_breakpoint = deprecated_insert_raw_breakpoint (target_gdbarch, base_breakpoint = deprecated_insert_raw_breakpoint (target_gdbarch (),
aspace, entry_point); aspace, entry_point);
if (base_breakpoint != NULL) if (base_breakpoint != NULL)
@ -453,8 +453,8 @@ irix_solib_create_inferior_hook (int from_tty)
static struct so_list * static struct so_list *
irix_current_sos (void) irix_current_sos (void)
{ {
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
int addr_size = gdbarch_addr_bit (target_gdbarch) / TARGET_CHAR_BIT; int addr_size = gdbarch_addr_bit (target_gdbarch ()) / TARGET_CHAR_BIT;
CORE_ADDR lma; CORE_ADDR lma;
char addr_buf[8]; char addr_buf[8];
struct so_list *head = 0; struct so_list *head = 0;
@ -545,8 +545,8 @@ irix_current_sos (void)
static int static int
irix_open_symbol_file_object (void *from_ttyp) irix_open_symbol_file_object (void *from_ttyp)
{ {
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
int addr_size = gdbarch_addr_bit (target_gdbarch) / TARGET_CHAR_BIT; int addr_size = gdbarch_addr_bit (target_gdbarch ()) / TARGET_CHAR_BIT;
CORE_ADDR lma; CORE_ADDR lma;
char addr_buf[8]; char addr_buf[8];
struct lm_info lm; struct lm_info lm;

View file

@ -391,7 +391,7 @@ manpage for methods to privately map shared library text."));
/* Create the shared library breakpoint. */ /* Create the shared library breakpoint. */
{ {
struct breakpoint *b struct breakpoint *b
= create_solib_event_breakpoint (target_gdbarch, sym_addr); = create_solib_event_breakpoint (target_gdbarch (), sym_addr);
/* The breakpoint is actually hard-coded into the dynamic linker, /* The breakpoint is actually hard-coded into the dynamic linker,
so we don't need to actually insert a breakpoint instruction so we don't need to actually insert a breakpoint instruction

View file

@ -185,7 +185,7 @@ struct {
static void static void
som_solib_create_inferior_hook (int from_tty) som_solib_create_inferior_hook (int from_tty)
{ {
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
struct minimal_symbol *msymbol; struct minimal_symbol *msymbol;
unsigned int dld_flags, status, have_endo; unsigned int dld_flags, status, have_endo;
asection *shlib_info; asection *shlib_info;
@ -288,7 +288,7 @@ Suggest linking with /opt/langtools/lib/end.o.\n\
GDB will be unable to track shl_load/shl_unload calls")); GDB will be unable to track shl_load/shl_unload calls"));
goto keep_going; goto keep_going;
} }
create_solib_event_breakpoint (target_gdbarch, create_solib_event_breakpoint (target_gdbarch (),
SYMBOL_VALUE_ADDRESS (msymbol)); SYMBOL_VALUE_ADDRESS (msymbol));
/* We have all the support usually found in end.o, so we can track /* We have all the support usually found in end.o, so we can track
@ -353,7 +353,7 @@ manpage for methods to privately map shared library text."));
anaddr = SYMBOL_VALUE_ADDRESS (msymbol); anaddr = SYMBOL_VALUE_ADDRESS (msymbol);
/* Make the breakpoint at "_start" a shared library event breakpoint. */ /* Make the breakpoint at "_start" a shared library event breakpoint. */
create_solib_event_breakpoint (target_gdbarch, anaddr); create_solib_event_breakpoint (target_gdbarch (), anaddr);
clear_symtab_users (0); clear_symtab_users (0);
} }
@ -525,7 +525,7 @@ struct dld_list {
static CORE_ADDR static CORE_ADDR
link_map_start (void) link_map_start (void)
{ {
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
struct minimal_symbol *sym; struct minimal_symbol *sym;
CORE_ADDR addr; CORE_ADDR addr;
char buf[4]; char buf[4];
@ -575,7 +575,7 @@ match_main (const char *name)
static struct so_list * static struct so_list *
som_current_sos (void) som_current_sos (void)
{ {
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
CORE_ADDR lm; CORE_ADDR lm;
struct so_list *head = 0; struct so_list *head = 0;
struct so_list **link_ptr = &head; struct so_list **link_ptr = &head;
@ -642,27 +642,27 @@ som_current_sos (void)
#ifdef SOLIB_SOM_DBG #ifdef SOLIB_SOM_DBG
printf ("\n+ library \"%s\" is described at %s\n", new->so_name, printf ("\n+ library \"%s\" is described at %s\n", new->so_name,
paddress (target_gdbarch, lm)); paddress (target_gdbarch (), lm));
printf (" 'version' is %d\n", new->lm_info->struct_version); printf (" 'version' is %d\n", new->lm_info->struct_version);
printf (" 'bind_mode' is %d\n", new->lm_info->bind_mode); printf (" 'bind_mode' is %d\n", new->lm_info->bind_mode);
printf (" 'library_version' is %d\n", printf (" 'library_version' is %d\n",
new->lm_info->library_version); new->lm_info->library_version);
printf (" 'text_addr' is %s\n", printf (" 'text_addr' is %s\n",
paddress (target_gdbarch, new->lm_info->text_addr)); paddress (target_gdbarch (), new->lm_info->text_addr));
printf (" 'text_link_addr' is %s\n", printf (" 'text_link_addr' is %s\n",
paddress (target_gdbarch, new->lm_info->text_link_addr)); paddress (target_gdbarch (), new->lm_info->text_link_addr));
printf (" 'text_end' is %s\n", printf (" 'text_end' is %s\n",
paddress (target_gdbarch, new->lm_info->text_end)); paddress (target_gdbarch (), new->lm_info->text_end));
printf (" 'data_start' is %s\n", printf (" 'data_start' is %s\n",
paddress (target_gdbarch, new->lm_info->data_start)); paddress (target_gdbarch (), new->lm_info->data_start));
printf (" 'bss_start' is %s\n", printf (" 'bss_start' is %s\n",
paddress (target_gdbarch, new->lm_info->bss_start)); paddress (target_gdbarch (), new->lm_info->bss_start));
printf (" 'data_end' is %s\n", printf (" 'data_end' is %s\n",
paddress (target_gdbarch, new->lm_info->data_end)); paddress (target_gdbarch (), new->lm_info->data_end));
printf (" 'got_value' is %s\n", printf (" 'got_value' is %s\n",
paddress (target_gdbarch, new->lm_info->got_value)); paddress (target_gdbarch (), new->lm_info->got_value));
printf (" 'tsd_start_addr' is %s\n", printf (" 'tsd_start_addr' is %s\n",
paddress (target_gdbarch, new->lm_info->tsd_start_addr)); paddress (target_gdbarch (), new->lm_info->tsd_start_addr));
#endif #endif
new->addr_low = lmi->text_addr; new->addr_low = lmi->text_addr;
@ -692,7 +692,7 @@ som_current_sos (void)
static int static int
som_open_symbol_file_object (void *from_ttyp) som_open_symbol_file_object (void *from_ttyp)
{ {
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
CORE_ADDR lm, l_name; CORE_ADDR lm, l_name;
char *filename; char *filename;
int errcode; int errcode;

View file

@ -158,7 +158,7 @@ append_ocl_sos (struct so_list **link_ptr)
static struct so_list * static struct so_list *
spu_current_sos (void) spu_current_sos (void)
{ {
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
struct so_list *head; struct so_list *head;
struct so_list **link_ptr; struct so_list **link_ptr;
@ -418,9 +418,9 @@ spu_enable_break (struct objfile *objfile)
{ {
CORE_ADDR addr = SYMBOL_VALUE_ADDRESS (spe_event_sym); CORE_ADDR addr = SYMBOL_VALUE_ADDRESS (spe_event_sym);
addr = gdbarch_convert_from_func_ptr_addr (target_gdbarch, addr, addr = gdbarch_convert_from_func_ptr_addr (target_gdbarch (), addr,
&current_target); &current_target);
create_solib_event_breakpoint (target_gdbarch, addr); create_solib_event_breakpoint (target_gdbarch (), addr);
return 1; return 1;
} }

View file

@ -121,7 +121,7 @@ static char *main_name_list[] =
#define SOLIB_EXTRACT_ADDRESS(MEMBER) \ #define SOLIB_EXTRACT_ADDRESS(MEMBER) \
extract_unsigned_integer (&(MEMBER), sizeof (MEMBER), \ extract_unsigned_integer (&(MEMBER), sizeof (MEMBER), \
gdbarch_byte_order (target_gdbarch)) gdbarch_byte_order (target_gdbarch ()))
/* local data declarations */ /* local data declarations */
@ -141,7 +141,7 @@ static CORE_ADDR flag_addr;
static CORE_ADDR static CORE_ADDR
lm_addr (struct so_list *so) lm_addr (struct so_list *so)
{ {
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
int lm_addr_offset = offsetof (struct link_map, lm_addr); int lm_addr_offset = offsetof (struct link_map, lm_addr);
int lm_addr_size = fieldsize (struct link_map, lm_addr); int lm_addr_size = fieldsize (struct link_map, lm_addr);
@ -152,7 +152,7 @@ lm_addr (struct so_list *so)
static CORE_ADDR static CORE_ADDR
lm_next (struct so_list *so) lm_next (struct so_list *so)
{ {
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
int lm_next_offset = offsetof (struct link_map, lm_next); int lm_next_offset = offsetof (struct link_map, lm_next);
int lm_next_size = fieldsize (struct link_map, lm_next); int lm_next_size = fieldsize (struct link_map, lm_next);
@ -164,7 +164,7 @@ lm_next (struct so_list *so)
static CORE_ADDR static CORE_ADDR
lm_name (struct so_list *so) lm_name (struct so_list *so)
{ {
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
int lm_name_offset = offsetof (struct link_map, lm_name); int lm_name_offset = offsetof (struct link_map, lm_name);
int lm_name_size = fieldsize (struct link_map, lm_name); int lm_name_size = fieldsize (struct link_map, lm_name);
@ -690,9 +690,9 @@ sunos_solib_create_inferior_hook (int from_tty)
the GDB software break point list. Thus we have to adjust the the GDB software break point list. Thus we have to adjust the
PC here. */ PC here. */
if (gdbarch_decr_pc_after_break (target_gdbarch)) if (gdbarch_decr_pc_after_break (target_gdbarch ()))
{ {
stop_pc -= gdbarch_decr_pc_after_break (target_gdbarch); stop_pc -= gdbarch_decr_pc_after_break (target_gdbarch ());
regcache_write_pc (get_current_regcache (), stop_pc); regcache_write_pc (get_current_regcache (), stop_pc);
} }

View file

@ -155,12 +155,12 @@ lm_info_read (CORE_ADDR lm_addr)
if (target_read_memory (lm_addr, lm, lmo->link_map_size) != 0) if (target_read_memory (lm_addr, lm, lmo->link_map_size) != 0)
{ {
warning (_("Error reading shared library list entry at %s"), warning (_("Error reading shared library list entry at %s"),
paddress (target_gdbarch, lm_addr)), paddress (target_gdbarch (), lm_addr)),
lm_info = NULL; lm_info = NULL;
} }
else else
{ {
struct type *ptr_type = builtin_type (target_gdbarch)->builtin_data_ptr; struct type *ptr_type = builtin_type (target_gdbarch ())->builtin_data_ptr;
lm_info = xzalloc (sizeof (*lm_info)); lm_info = xzalloc (sizeof (*lm_info));
lm_info->lm_addr = lm_addr; lm_info->lm_addr = lm_addr;
@ -264,7 +264,7 @@ lm_addr_check (struct so_list *so, bfd *abfd)
if (info_verbose) if (info_verbose)
printf_unfiltered (_("Using PIC (Position Independent Code) " printf_unfiltered (_("Using PIC (Position Independent Code) "
"prelink displacement %s for \"%s\".\n"), "prelink displacement %s for \"%s\".\n"),
paddress (target_gdbarch, l_addr), paddress (target_gdbarch (), l_addr),
so->so_name); so->so_name);
} }
else else
@ -363,7 +363,7 @@ static int match_main (const char *);
static gdb_byte * static gdb_byte *
read_program_header (int type, int *p_sect_size, int *p_arch_size) read_program_header (int type, int *p_sect_size, int *p_arch_size)
{ {
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
CORE_ADDR at_phdr, at_phent, at_phnum, pt_phdr = 0; CORE_ADDR at_phdr, at_phent, at_phnum, pt_phdr = 0;
int arch_size, sect_size; int arch_size, sect_size;
CORE_ADDR sect_addr; CORE_ADDR sect_addr;
@ -612,7 +612,7 @@ scan_dyntag (int dyntag, bfd *abfd, CORE_ADDR *ptr)
gdb_byte ptr_buf[8]; gdb_byte ptr_buf[8];
CORE_ADDR ptr_addr; CORE_ADDR ptr_addr;
ptr_type = builtin_type (target_gdbarch)->builtin_data_ptr; ptr_type = builtin_type (target_gdbarch ())->builtin_data_ptr;
ptr_addr = dyn_addr + (buf - bufstart) + arch_size / 8; ptr_addr = dyn_addr + (buf - bufstart) + arch_size / 8;
if (target_read_memory (ptr_addr, ptr_buf, arch_size / 8) == 0) if (target_read_memory (ptr_addr, ptr_buf, arch_size / 8) == 0)
dyn_ptr = extract_typed_address (ptr_buf, ptr_type); dyn_ptr = extract_typed_address (ptr_buf, ptr_type);
@ -632,7 +632,7 @@ scan_dyntag (int dyntag, bfd *abfd, CORE_ADDR *ptr)
static int static int
scan_dyntag_auxv (int dyntag, CORE_ADDR *ptr) scan_dyntag_auxv (int dyntag, CORE_ADDR *ptr)
{ {
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
int sect_size, arch_size, step; int sect_size, arch_size, step;
long dyn_tag; long dyn_tag;
CORE_ADDR dyn_ptr; CORE_ADDR dyn_ptr;
@ -709,7 +709,7 @@ elf_locate_base (void)
if (scan_dyntag (DT_MIPS_RLD_MAP, exec_bfd, &dyn_ptr) if (scan_dyntag (DT_MIPS_RLD_MAP, exec_bfd, &dyn_ptr)
|| scan_dyntag_auxv (DT_MIPS_RLD_MAP, &dyn_ptr)) || scan_dyntag_auxv (DT_MIPS_RLD_MAP, &dyn_ptr))
{ {
struct type *ptr_type = builtin_type (target_gdbarch)->builtin_data_ptr; struct type *ptr_type = builtin_type (target_gdbarch ())->builtin_data_ptr;
gdb_byte *pbuf; gdb_byte *pbuf;
int pbuf_size = TYPE_LENGTH (ptr_type); int pbuf_size = TYPE_LENGTH (ptr_type);
@ -787,7 +787,7 @@ static CORE_ADDR
solib_svr4_r_map (struct svr4_info *info) solib_svr4_r_map (struct svr4_info *info)
{ {
struct link_map_offsets *lmo = svr4_fetch_link_map_offsets (); struct link_map_offsets *lmo = svr4_fetch_link_map_offsets ();
struct type *ptr_type = builtin_type (target_gdbarch)->builtin_data_ptr; struct type *ptr_type = builtin_type (target_gdbarch ())->builtin_data_ptr;
CORE_ADDR addr = 0; CORE_ADDR addr = 0;
volatile struct gdb_exception ex; volatile struct gdb_exception ex;
@ -806,7 +806,7 @@ static CORE_ADDR
solib_svr4_r_brk (struct svr4_info *info) solib_svr4_r_brk (struct svr4_info *info)
{ {
struct link_map_offsets *lmo = svr4_fetch_link_map_offsets (); struct link_map_offsets *lmo = svr4_fetch_link_map_offsets ();
struct type *ptr_type = builtin_type (target_gdbarch)->builtin_data_ptr; struct type *ptr_type = builtin_type (target_gdbarch ())->builtin_data_ptr;
return read_memory_typed_address (info->debug_base + lmo->r_brk_offset, return read_memory_typed_address (info->debug_base + lmo->r_brk_offset,
ptr_type); ptr_type);
@ -819,8 +819,8 @@ static CORE_ADDR
solib_svr4_r_ldsomap (struct svr4_info *info) solib_svr4_r_ldsomap (struct svr4_info *info)
{ {
struct link_map_offsets *lmo = svr4_fetch_link_map_offsets (); struct link_map_offsets *lmo = svr4_fetch_link_map_offsets ();
struct type *ptr_type = builtin_type (target_gdbarch)->builtin_data_ptr; struct type *ptr_type = builtin_type (target_gdbarch ())->builtin_data_ptr;
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
ULONGEST version; ULONGEST version;
/* Check version, and return zero if `struct r_debug' doesn't have /* Check version, and return zero if `struct r_debug' doesn't have
@ -889,7 +889,7 @@ open_symbol_file_object (void *from_ttyp)
int errcode; int errcode;
int from_tty = *(int *)from_ttyp; int from_tty = *(int *)from_ttyp;
struct link_map_offsets *lmo = svr4_fetch_link_map_offsets (); struct link_map_offsets *lmo = svr4_fetch_link_map_offsets ();
struct type *ptr_type = builtin_type (target_gdbarch)->builtin_data_ptr; struct type *ptr_type = builtin_type (target_gdbarch ())->builtin_data_ptr;
int l_name_size = TYPE_LENGTH (ptr_type); int l_name_size = TYPE_LENGTH (ptr_type);
gdb_byte *l_name_buf = xmalloc (l_name_size); gdb_byte *l_name_buf = xmalloc (l_name_size);
struct cleanup *cleanups = make_cleanup (xfree, l_name_buf); struct cleanup *cleanups = make_cleanup (xfree, l_name_buf);
@ -1197,8 +1197,8 @@ svr4_read_so_list (CORE_ADDR lm, struct so_list ***link_ptr_ptr,
if (new->lm_info->l_prev != prev_lm) if (new->lm_info->l_prev != prev_lm)
{ {
warning (_("Corrupted shared library list: %s != %s"), warning (_("Corrupted shared library list: %s != %s"),
paddress (target_gdbarch, prev_lm), paddress (target_gdbarch (), prev_lm),
paddress (target_gdbarch, new->lm_info->l_prev)); paddress (target_gdbarch (), new->lm_info->l_prev));
do_cleanups (old_chain); do_cleanups (old_chain);
break; break;
} }
@ -1396,7 +1396,7 @@ exec_entry_point (struct bfd *abfd, struct target_ops *targ)
gdbarch_convert_from_func_ptr_addr(). The method gdbarch_convert_from_func_ptr_addr(). The method
gdbarch_convert_from_func_ptr_addr() is the merely the identify gdbarch_convert_from_func_ptr_addr() is the merely the identify
function for targets which don't use function descriptors. */ function for targets which don't use function descriptors. */
return gdbarch_convert_from_func_ptr_addr (target_gdbarch, return gdbarch_convert_from_func_ptr_addr (target_gdbarch (),
bfd_get_start_address (abfd), bfd_get_start_address (abfd),
targ); targ);
} }
@ -1468,7 +1468,7 @@ enable_break (struct svr4_info *info, int from_tty)
struct obj_section *os; struct obj_section *os;
sym_addr = gdbarch_addr_bits_remove sym_addr = gdbarch_addr_bits_remove
(target_gdbarch, gdbarch_convert_from_func_ptr_addr (target_gdbarch, (target_gdbarch (), gdbarch_convert_from_func_ptr_addr (target_gdbarch (),
sym_addr, sym_addr,
&current_target)); &current_target));
@ -1522,7 +1522,7 @@ enable_break (struct svr4_info *info, int from_tty)
+ bfd_section_size (tmp_bfd, interp_sect); + bfd_section_size (tmp_bfd, interp_sect);
} }
create_solib_event_breakpoint (target_gdbarch, sym_addr); create_solib_event_breakpoint (target_gdbarch (), sym_addr);
return 1; return 1;
} }
} }
@ -1585,7 +1585,7 @@ enable_break (struct svr4_info *info, int from_tty)
if (!load_addr_found) if (!load_addr_found)
if (target_auxv_search (&current_target, AT_BASE, &load_addr) > 0) if (target_auxv_search (&current_target, AT_BASE, &load_addr) > 0)
{ {
int addr_bit = gdbarch_addr_bit (target_gdbarch); int addr_bit = gdbarch_addr_bit (target_gdbarch ());
/* Ensure LOAD_ADDR has proper sign in its possible upper bits so /* Ensure LOAD_ADDR has proper sign in its possible upper bits so
that `+ load_addr' will overflow CORE_ADDR width not creating that `+ load_addr' will overflow CORE_ADDR width not creating
@ -1621,7 +1621,7 @@ enable_break (struct svr4_info *info, int from_tty)
if (!load_addr_found) if (!load_addr_found)
{ {
struct regcache *regcache struct regcache *regcache
= get_thread_arch_regcache (inferior_ptid, target_gdbarch); = get_thread_arch_regcache (inferior_ptid, target_gdbarch ());
load_addr = (regcache_read_pc (regcache) load_addr = (regcache_read_pc (regcache)
- exec_entry_point (tmp_bfd, tmp_bfd_target)); - exec_entry_point (tmp_bfd, tmp_bfd_target));
@ -1669,7 +1669,7 @@ enable_break (struct svr4_info *info, int from_tty)
/* Convert 'sym_addr' from a function pointer to an address. /* Convert 'sym_addr' from a function pointer to an address.
Because we pass tmp_bfd_target instead of the current Because we pass tmp_bfd_target instead of the current
target, this will always produce an unrelocated value. */ target, this will always produce an unrelocated value. */
sym_addr = gdbarch_convert_from_func_ptr_addr (target_gdbarch, sym_addr = gdbarch_convert_from_func_ptr_addr (target_gdbarch (),
sym_addr, sym_addr,
tmp_bfd_target); tmp_bfd_target);
@ -1680,7 +1680,7 @@ enable_break (struct svr4_info *info, int from_tty)
if (sym_addr != 0) if (sym_addr != 0)
{ {
create_solib_event_breakpoint (target_gdbarch, load_addr + sym_addr); create_solib_event_breakpoint (target_gdbarch (), load_addr + sym_addr);
xfree (interp_name); xfree (interp_name);
return 1; return 1;
} }
@ -1703,10 +1703,10 @@ enable_break (struct svr4_info *info, int from_tty)
if ((msymbol != NULL) && (SYMBOL_VALUE_ADDRESS (msymbol) != 0)) if ((msymbol != NULL) && (SYMBOL_VALUE_ADDRESS (msymbol) != 0))
{ {
sym_addr = SYMBOL_VALUE_ADDRESS (msymbol); sym_addr = SYMBOL_VALUE_ADDRESS (msymbol);
sym_addr = gdbarch_convert_from_func_ptr_addr (target_gdbarch, sym_addr = gdbarch_convert_from_func_ptr_addr (target_gdbarch (),
sym_addr, sym_addr,
&current_target); &current_target);
create_solib_event_breakpoint (target_gdbarch, sym_addr); create_solib_event_breakpoint (target_gdbarch (), sym_addr);
return 1; return 1;
} }
} }
@ -1719,10 +1719,10 @@ enable_break (struct svr4_info *info, int from_tty)
if ((msymbol != NULL) && (SYMBOL_VALUE_ADDRESS (msymbol) != 0)) if ((msymbol != NULL) && (SYMBOL_VALUE_ADDRESS (msymbol) != 0))
{ {
sym_addr = SYMBOL_VALUE_ADDRESS (msymbol); sym_addr = SYMBOL_VALUE_ADDRESS (msymbol);
sym_addr = gdbarch_convert_from_func_ptr_addr (target_gdbarch, sym_addr = gdbarch_convert_from_func_ptr_addr (target_gdbarch (),
sym_addr, sym_addr,
&current_target); &current_target);
create_solib_event_breakpoint (target_gdbarch, sym_addr); create_solib_event_breakpoint (target_gdbarch (), sym_addr);
return 1; return 1;
} }
} }
@ -1863,7 +1863,7 @@ svr4_exec_displacement (CORE_ADDR *displacementp)
buf2 = read_program_headers_from_bfd (exec_bfd, &phdrs2_size); buf2 = read_program_headers_from_bfd (exec_bfd, &phdrs2_size);
if (buf != NULL && buf2 != NULL) if (buf != NULL && buf2 != NULL)
{ {
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
/* We are dealing with three different addresses. EXEC_BFD /* We are dealing with three different addresses. EXEC_BFD
represents current address in on-disk file. target memory content represents current address in on-disk file. target memory content
@ -2118,7 +2118,7 @@ svr4_exec_displacement (CORE_ADDR *displacementp)
printf_unfiltered (_("Using PIE (Position Independent Executable) " printf_unfiltered (_("Using PIE (Position Independent Executable) "
"displacement %s for \"%s\".\n"), "displacement %s for \"%s\".\n"),
paddress (target_gdbarch, displacement), paddress (target_gdbarch (), displacement),
bfd_get_filename (exec_bfd)); bfd_get_filename (exec_bfd));
} }
@ -2301,12 +2301,12 @@ svr4_clear_solib (void)
static CORE_ADDR static CORE_ADDR
svr4_truncate_ptr (CORE_ADDR addr) svr4_truncate_ptr (CORE_ADDR addr)
{ {
if (gdbarch_ptr_bit (target_gdbarch) == sizeof (CORE_ADDR) * 8) if (gdbarch_ptr_bit (target_gdbarch ()) == sizeof (CORE_ADDR) * 8)
/* We don't need to truncate anything, and the bit twiddling below /* We don't need to truncate anything, and the bit twiddling below
will fail due to overflow problems. */ will fail due to overflow problems. */
return addr; return addr;
else else
return addr & (((CORE_ADDR) 1 << gdbarch_ptr_bit (target_gdbarch)) - 1); return addr & (((CORE_ADDR) 1 << gdbarch_ptr_bit (target_gdbarch ())) - 1);
} }
@ -2364,7 +2364,7 @@ set_solib_svr4_fetch_link_map_offsets (struct gdbarch *gdbarch,
static struct link_map_offsets * static struct link_map_offsets *
svr4_fetch_link_map_offsets (void) svr4_fetch_link_map_offsets (void)
{ {
struct solib_svr4_ops *ops = gdbarch_data (target_gdbarch, solib_svr4_data); struct solib_svr4_ops *ops = gdbarch_data (target_gdbarch (), solib_svr4_data);
gdb_assert (ops->fetch_link_map_offsets); gdb_assert (ops->fetch_link_map_offsets);
return ops->fetch_link_map_offsets (); return ops->fetch_link_map_offsets ();
@ -2375,7 +2375,7 @@ svr4_fetch_link_map_offsets (void)
static int static int
svr4_have_link_map_offsets (void) svr4_have_link_map_offsets (void)
{ {
struct solib_svr4_ops *ops = gdbarch_data (target_gdbarch, solib_svr4_data); struct solib_svr4_ops *ops = gdbarch_data (target_gdbarch (), solib_svr4_data);
return (ops->fetch_link_map_offsets != NULL); return (ops->fetch_link_map_offsets != NULL);
} }

View file

@ -143,12 +143,12 @@ show_solib_search_path (struct ui_file *file, int from_tty,
char * char *
solib_find (char *in_pathname, int *fd) solib_find (char *in_pathname, int *fd)
{ {
struct target_so_ops *ops = solib_ops (target_gdbarch); struct target_so_ops *ops = solib_ops (target_gdbarch ());
int found_file = -1; int found_file = -1;
char *temp_pathname = NULL; char *temp_pathname = NULL;
int gdb_sysroot_is_empty; int gdb_sysroot_is_empty;
const char *solib_symbols_extension const char *solib_symbols_extension
= gdbarch_solib_symbols_extension (target_gdbarch); = gdbarch_solib_symbols_extension (target_gdbarch ());
const char *fskind = effective_target_file_system_kind (); const char *fskind = effective_target_file_system_kind ();
struct cleanup *old_chain = make_cleanup (null_cleanup, NULL); struct cleanup *old_chain = make_cleanup (null_cleanup, NULL);
char *sysroot = NULL; char *sysroot = NULL;
@ -424,7 +424,7 @@ solib_bfd_open (char *pathname)
} }
/* Check bfd arch. */ /* Check bfd arch. */
b = gdbarch_bfd_arch_info (target_gdbarch); b = gdbarch_bfd_arch_info (target_gdbarch ());
if (!b->compatible (b, bfd_get_arch_info (abfd))) if (!b->compatible (b, bfd_get_arch_info (abfd)))
warning (_("`%s': Shared library architecture %s is not compatible " warning (_("`%s': Shared library architecture %s is not compatible "
"with target architecture %s."), bfd_get_filename (abfd), "with target architecture %s."), bfd_get_filename (abfd),
@ -448,7 +448,7 @@ solib_bfd_open (char *pathname)
static int static int
solib_map_sections (struct so_list *so) solib_map_sections (struct so_list *so)
{ {
struct target_so_ops *ops = solib_ops (target_gdbarch); struct target_so_ops *ops = solib_ops (target_gdbarch ());
char *filename; char *filename;
struct target_section *p; struct target_section *p;
struct cleanup *old_chain; struct cleanup *old_chain;
@ -549,7 +549,7 @@ free_so_symbols (struct so_list *so)
void void
free_so (struct so_list *so) free_so (struct so_list *so)
{ {
struct target_so_ops *ops = solib_ops (target_gdbarch); struct target_so_ops *ops = solib_ops (target_gdbarch ());
free_so_symbols (so); free_so_symbols (so);
ops->free_so (so); ops->free_so (so);
@ -668,7 +668,7 @@ solib_used (const struct so_list *const known)
static void static void
update_solib_list (int from_tty, struct target_ops *target) update_solib_list (int from_tty, struct target_ops *target)
{ {
struct target_so_ops *ops = solib_ops (target_gdbarch); struct target_so_ops *ops = solib_ops (target_gdbarch ());
struct so_list *inferior = ops->current_sos(); struct so_list *inferior = ops->current_sos();
struct so_list *gdb, **gdb_link; struct so_list *gdb, **gdb_link;
@ -930,7 +930,7 @@ solib_add (char *pattern, int from_tty,
if (loaded_any_symbols) if (loaded_any_symbols)
{ {
struct target_so_ops *ops = solib_ops (target_gdbarch); struct target_so_ops *ops = solib_ops (target_gdbarch ());
/* Getting new symbols may change our opinion about what is /* Getting new symbols may change our opinion about what is
frameless. */ frameless. */
@ -954,7 +954,7 @@ info_sharedlibrary_command (char *pattern, int from_tty)
int addr_width; int addr_width;
int nr_libs; int nr_libs;
struct cleanup *table_cleanup; struct cleanup *table_cleanup;
struct gdbarch *gdbarch = target_gdbarch; struct gdbarch *gdbarch = target_gdbarch ();
struct ui_out *uiout = current_uiout; struct ui_out *uiout = current_uiout;
if (pattern) if (pattern)
@ -1103,7 +1103,7 @@ solib_name_from_address (struct program_space *pspace, CORE_ADDR address)
int int
solib_keep_data_in_core (CORE_ADDR vaddr, unsigned long size) solib_keep_data_in_core (CORE_ADDR vaddr, unsigned long size)
{ {
struct target_so_ops *ops = solib_ops (target_gdbarch); struct target_so_ops *ops = solib_ops (target_gdbarch ());
if (ops->keep_data_in_core) if (ops->keep_data_in_core)
return ops->keep_data_in_core (vaddr, size); return ops->keep_data_in_core (vaddr, size);
@ -1116,7 +1116,7 @@ solib_keep_data_in_core (CORE_ADDR vaddr, unsigned long size)
void void
clear_solib (void) clear_solib (void)
{ {
struct target_so_ops *ops = solib_ops (target_gdbarch); struct target_so_ops *ops = solib_ops (target_gdbarch ());
/* This function is expected to handle ELF shared libraries. It is /* This function is expected to handle ELF shared libraries. It is
also used on Solaris, which can run either ELF or a.out binaries also used on Solaris, which can run either ELF or a.out binaries
@ -1164,7 +1164,7 @@ clear_solib (void)
void void
solib_create_inferior_hook (int from_tty) solib_create_inferior_hook (int from_tty)
{ {
struct target_so_ops *ops = solib_ops (target_gdbarch); struct target_so_ops *ops = solib_ops (target_gdbarch ());
ops->solib_create_inferior_hook (from_tty); ops->solib_create_inferior_hook (from_tty);
} }
@ -1175,7 +1175,7 @@ solib_create_inferior_hook (int from_tty)
int int
in_solib_dynsym_resolve_code (CORE_ADDR pc) in_solib_dynsym_resolve_code (CORE_ADDR pc)
{ {
struct target_so_ops *ops = solib_ops (target_gdbarch); struct target_so_ops *ops = solib_ops (target_gdbarch ());
return ops->in_dynsym_resolve_code (pc); return ops->in_dynsym_resolve_code (pc);
} }
@ -1277,7 +1277,7 @@ reload_shared_libraries (char *ignored, int from_tty,
reload_shared_libraries_1 (from_tty); reload_shared_libraries_1 (from_tty);
ops = solib_ops (target_gdbarch); ops = solib_ops (target_gdbarch ());
/* Creating inferior hooks here has two purposes. First, if we reload /* Creating inferior hooks here has two purposes. First, if we reload
shared libraries then the address of solib breakpoint we've computed shared libraries then the address of solib breakpoint we've computed
@ -1344,7 +1344,7 @@ solib_global_lookup (const struct objfile *objfile,
const char *name, const char *name,
const domain_enum domain) const domain_enum domain)
{ {
struct target_so_ops *ops = solib_ops (target_gdbarch); struct target_so_ops *ops = solib_ops (target_gdbarch ());
if (ops->lookup_lib_global_symbol != NULL) if (ops->lookup_lib_global_symbol != NULL)
return ops->lookup_lib_global_symbol (objfile, name, domain); return ops->lookup_lib_global_symbol (objfile, name, domain);

View file

@ -206,7 +206,7 @@ store_ppc_memory (ULONGEST memaddr, const gdb_byte *myaddr, int len)
static int static int
parse_spufs_run (int *fd, ULONGEST *addr) parse_spufs_run (int *fd, ULONGEST *addr)
{ {
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
gdb_byte buf[4]; gdb_byte buf[4];
ULONGEST pc = fetch_ppc_register (32); /* nip */ ULONGEST pc = fetch_ppc_register (32); /* nip */

View file

@ -57,19 +57,19 @@ static int spu_nr_solib;
static int static int
parse_spufs_run (ptid_t ptid, int *fd, CORE_ADDR *addr) parse_spufs_run (ptid_t ptid, int *fd, CORE_ADDR *addr)
{ {
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
struct gdbarch_tdep *tdep; struct gdbarch_tdep *tdep;
struct regcache *regcache; struct regcache *regcache;
char buf[4]; char buf[4];
ULONGEST regval; ULONGEST regval;
/* If we're not on PPU, there's nothing to detect. */ /* If we're not on PPU, there's nothing to detect. */
if (gdbarch_bfd_arch_info (target_gdbarch)->arch != bfd_arch_powerpc) if (gdbarch_bfd_arch_info (target_gdbarch ())->arch != bfd_arch_powerpc)
return 0; return 0;
/* Get PPU-side registers. */ /* Get PPU-side registers. */
regcache = get_thread_arch_regcache (ptid, target_gdbarch); regcache = get_thread_arch_regcache (ptid, target_gdbarch ());
tdep = gdbarch_tdep (target_gdbarch); tdep = gdbarch_tdep (target_gdbarch ());
/* Fetch instruction preceding current NIP. */ /* Fetch instruction preceding current NIP. */
if (target_read_memory (regcache_read_pc (regcache) - 4, buf, 4) != 0) if (target_read_memory (regcache_read_pc (regcache) - 4, buf, 4) != 0)
@ -113,7 +113,7 @@ spu_thread_architecture (struct target_ops *ops, ptid_t ptid)
if (parse_spufs_run (ptid, &spufs_fd, &spufs_addr)) if (parse_spufs_run (ptid, &spufs_fd, &spufs_addr))
return spu_gdbarch (spufs_fd); return spu_gdbarch (spufs_fd);
return target_gdbarch; return target_gdbarch ();
} }
/* Override the to_region_ok_for_hw_watchpoint routine. */ /* Override the to_region_ok_for_hw_watchpoint routine. */

View file

@ -1186,7 +1186,7 @@ spu2ppu_sniffer (const struct frame_unwind *self,
CORE_ADDR base, func, backchain; CORE_ADDR base, func, backchain;
gdb_byte buf[4]; gdb_byte buf[4];
if (gdbarch_bfd_arch_info (target_gdbarch)->arch == bfd_arch_spu) if (gdbarch_bfd_arch_info (target_gdbarch ())->arch == bfd_arch_spu)
return 0; return 0;
base = get_frame_sp (this_frame); base = get_frame_sp (this_frame);
@ -1217,7 +1217,7 @@ spu2ppu_sniffer (const struct frame_unwind *self,
else else
{ {
struct regcache *regcache; struct regcache *regcache;
regcache = get_thread_arch_regcache (inferior_ptid, target_gdbarch); regcache = get_thread_arch_regcache (inferior_ptid, target_gdbarch ());
cache->regcache = regcache_dup (regcache); cache->regcache = regcache_dup (regcache);
*this_prologue_cache = cache; *this_prologue_cache = cache;
return 1; return 1;

View file

@ -220,7 +220,7 @@ add_vsyscall_page (struct target_ops *target, int from_tty)
args.bfd = bfd; args.bfd = bfd;
args.sysinfo_ehdr = sysinfo_ehdr; args.sysinfo_ehdr = sysinfo_ehdr;
args.name = xstrprintf ("system-supplied DSO at %s", args.name = xstrprintf ("system-supplied DSO at %s",
paddress (target_gdbarch, sysinfo_ehdr)); paddress (target_gdbarch (), sysinfo_ehdr));
/* Pass zero for FROM_TTY, because the action of loading the /* Pass zero for FROM_TTY, because the action of loading the
vsyscall DSO was not triggered by the user, even if the user vsyscall DSO was not triggered by the user, even if the user
typed "run" at the TTY. */ typed "run" at the TTY. */

View file

@ -1957,7 +1957,7 @@ load_progress (ULONGEST bytes, void *untyped_arg)
this section. */ this section. */
ui_out_message (current_uiout, 0, "Loading section %s, size %s lma %s\n", ui_out_message (current_uiout, 0, "Loading section %s, size %s lma %s\n",
args->section_name, hex_string (args->section_size), args->section_name, hex_string (args->section_size),
paddress (target_gdbarch, args->lma)); paddress (target_gdbarch (), args->lma));
return; return;
} }
@ -1975,10 +1975,10 @@ load_progress (ULONGEST bytes, void *untyped_arg)
if (target_read_memory (args->lma, check, bytes) != 0) if (target_read_memory (args->lma, check, bytes) != 0)
error (_("Download verify read failed at %s"), error (_("Download verify read failed at %s"),
paddress (target_gdbarch, args->lma)); paddress (target_gdbarch (), args->lma));
if (memcmp (args->buffer, check, bytes) != 0) if (memcmp (args->buffer, check, bytes) != 0)
error (_("Download verify compare failed at %s"), error (_("Download verify compare failed at %s"),
paddress (target_gdbarch, args->lma)); paddress (target_gdbarch (), args->lma));
do_cleanups (verify_cleanups); do_cleanups (verify_cleanups);
} }
totals->data_count += bytes; totals->data_count += bytes;
@ -2133,7 +2133,7 @@ generic_load (char *args, int from_tty)
entry = bfd_get_start_address (loadfile_bfd); entry = bfd_get_start_address (loadfile_bfd);
ui_out_text (uiout, "Start address "); ui_out_text (uiout, "Start address ");
ui_out_field_fmt (uiout, "address", "%s", paddress (target_gdbarch, entry)); ui_out_field_fmt (uiout, "address", "%s", paddress (target_gdbarch (), entry));
ui_out_text (uiout, ", load size "); ui_out_text (uiout, ", load size ");
ui_out_field_fmt (uiout, "load-size", "%lu", total_progress.data_count); ui_out_field_fmt (uiout, "load-size", "%lu", total_progress.data_count);
ui_out_text (uiout, "\n"); ui_out_text (uiout, "\n");

View file

@ -1767,7 +1767,7 @@ lookup_symbol_global (const char *name,
lookup_data.name = name; lookup_data.name = name;
lookup_data.domain = domain; lookup_data.domain = domain;
gdbarch_iterate_over_objfiles_in_search_order gdbarch_iterate_over_objfiles_in_search_order
(objfile != NULL ? get_objfile_arch (objfile) : target_gdbarch, (objfile != NULL ? get_objfile_arch (objfile) : target_gdbarch (),
lookup_symbol_global_iterator_cb, &lookup_data, objfile); lookup_symbol_global_iterator_cb, &lookup_data, objfile);
return lookup_data.result; return lookup_data.result;

View file

@ -334,7 +334,7 @@ target_find_description (void)
/* The current architecture should not have any target description /* The current architecture should not have any target description
specified. It should have been cleared, e.g. when we specified. It should have been cleared, e.g. when we
disconnected from the previous target. */ disconnected from the previous target. */
gdb_assert (gdbarch_target_desc (target_gdbarch) == NULL); gdb_assert (gdbarch_target_desc (target_gdbarch ()) == NULL);
/* First try to fetch an XML description from the user-specified /* First try to fetch an XML description from the user-specified
file. */ file. */
@ -367,7 +367,7 @@ target_find_description (void)
{ {
struct tdesc_arch_data *data; struct tdesc_arch_data *data;
data = gdbarch_data (target_gdbarch, tdesc_data); data = gdbarch_data (target_gdbarch (), tdesc_data);
if (tdesc_has_registers (current_target_desc) if (tdesc_has_registers (current_target_desc)
&& data->arch_regs == NULL) && data->arch_regs == NULL)
warning (_("Target-supplied registers are not supported " warning (_("Target-supplied registers are not supported "

View file

@ -1128,7 +1128,7 @@ target_translate_tls_address (struct objfile *objfile, CORE_ADDR offset)
} }
if (target != NULL if (target != NULL
&& gdbarch_fetch_tls_load_module_address_p (target_gdbarch)) && gdbarch_fetch_tls_load_module_address_p (target_gdbarch ()))
{ {
ptid_t ptid = inferior_ptid; ptid_t ptid = inferior_ptid;
volatile struct gdb_exception ex; volatile struct gdb_exception ex;
@ -1138,7 +1138,7 @@ target_translate_tls_address (struct objfile *objfile, CORE_ADDR offset)
CORE_ADDR lm_addr; CORE_ADDR lm_addr;
/* Fetch the load module address for this objfile. */ /* Fetch the load module address for this objfile. */
lm_addr = gdbarch_fetch_tls_load_module_address (target_gdbarch, lm_addr = gdbarch_fetch_tls_load_module_address (target_gdbarch (),
objfile); objfile);
/* If it's 0, throw the appropriate exception. */ /* If it's 0, throw the appropriate exception. */
if (lm_addr == 0) if (lm_addr == 0)
@ -2497,7 +2497,7 @@ target_pre_inferior (int from_tty)
/* In some OSs, the shared library list is the same/global/shared /* In some OSs, the shared library list is the same/global/shared
across inferiors. If code is shared between processes, so are across inferiors. If code is shared between processes, so are
memory regions and features. */ memory regions and features. */
if (!gdbarch_has_global_solist (target_gdbarch)) if (!gdbarch_has_global_solist (target_gdbarch ()))
{ {
no_shared_libraries (NULL, from_tty); no_shared_libraries (NULL, from_tty);
@ -2566,7 +2566,7 @@ target_detach (char *args, int from_tty)
{ {
struct target_ops* t; struct target_ops* t;
if (gdbarch_has_global_breakpoints (target_gdbarch)) if (gdbarch_has_global_breakpoints (target_gdbarch ()))
/* Don't remove global breakpoints here. They're removed on /* Don't remove global breakpoints here. They're removed on
disconnection from the target. */ disconnection from the target. */
; ;
@ -3554,7 +3554,7 @@ target_fileio_read_stralloc (const char *filename)
static int static int
default_region_ok_for_hw_watchpoint (CORE_ADDR addr, int len) default_region_ok_for_hw_watchpoint (CORE_ADDR addr, int len)
{ {
return (len <= gdbarch_ptr_bit (target_gdbarch) / TARGET_CHAR_BIT); return (len <= gdbarch_ptr_bit (target_gdbarch ()) / TARGET_CHAR_BIT);
} }
static int static int
@ -3568,7 +3568,7 @@ default_watchpoint_addr_within_range (struct target_ops *target,
static struct gdbarch * static struct gdbarch *
default_thread_architecture (struct target_ops *ops, ptid_t ptid) default_thread_architecture (struct target_ops *ops, ptid_t ptid)
{ {
return target_gdbarch; return target_gdbarch ();
} }
static int static int
@ -4055,7 +4055,7 @@ target_verify_memory (const gdb_byte *data, CORE_ADDR memaddr, ULONGEST size)
if (targetdebug) if (targetdebug)
fprintf_unfiltered (gdb_stdlog, fprintf_unfiltered (gdb_stdlog,
"target_verify_memory (%s, %s) = %d\n", "target_verify_memory (%s, %s) = %d\n",
paddress (target_gdbarch, memaddr), paddress (target_gdbarch (), memaddr),
pulongest (size), pulongest (size),
retval); retval);
return retval; return retval;
@ -4169,7 +4169,7 @@ deprecated_debug_xfer_memory (CORE_ADDR memaddr, bfd_byte *myaddr, int len,
fprintf_unfiltered (gdb_stdlog, fprintf_unfiltered (gdb_stdlog,
"target_xfer_memory (%s, xxx, %d, %s, xxx) = %d", "target_xfer_memory (%s, xxx, %d, %s, xxx) = %d",
paddress (target_gdbarch, memaddr), len, paddress (target_gdbarch (), memaddr), len,
write ? "write" : "read", retval); write ? "write" : "read", retval);
if (retval > 0) if (retval > 0)

View file

@ -687,9 +687,9 @@ struct target_ops
to_thread_architecture would return SPU, otherwise PPC32 or PPC64). to_thread_architecture would return SPU, otherwise PPC32 or PPC64).
This is architecture used to perform decr_pc_after_break adjustment, This is architecture used to perform decr_pc_after_break adjustment,
and also determines the frame architecture of the innermost frame. and also determines the frame architecture of the innermost frame.
ptrace operations need to operate according to target_gdbarch. ptrace operations need to operate according to target_gdbarch ().
The default implementation always returns target_gdbarch. */ The default implementation always returns target_gdbarch (). */
struct gdbarch *(*to_thread_architecture) (struct target_ops *, ptid_t); struct gdbarch *(*to_thread_architecture) (struct target_ops *, ptid_t);
/* Determine current address space of thread PTID. /* Determine current address space of thread PTID.

View file

@ -4206,7 +4206,7 @@ tfile_get_traceframe_address (off_t tframe_offset)
tfile_read ((gdb_byte *) &tpnum, 2); tfile_read ((gdb_byte *) &tpnum, 2);
tpnum = (short) extract_signed_integer ((gdb_byte *) &tpnum, 2, tpnum = (short) extract_signed_integer ((gdb_byte *) &tpnum, 2,
gdbarch_byte_order gdbarch_byte_order
(target_gdbarch)); (target_gdbarch ()));
tp = get_tracepoint_by_number_on_target (tpnum); tp = get_tracepoint_by_number_on_target (tpnum);
/* FIXME this is a poor heuristic if multiple locations. */ /* FIXME this is a poor heuristic if multiple locations. */
@ -4250,14 +4250,14 @@ tfile_trace_find (enum trace_find_type type, int num,
tfile_read ((gdb_byte *) &tpnum, 2); tfile_read ((gdb_byte *) &tpnum, 2);
tpnum = (short) extract_signed_integer ((gdb_byte *) &tpnum, 2, tpnum = (short) extract_signed_integer ((gdb_byte *) &tpnum, 2,
gdbarch_byte_order gdbarch_byte_order
(target_gdbarch)); (target_gdbarch ()));
offset += 2; offset += 2;
if (tpnum == 0) if (tpnum == 0)
break; break;
tfile_read ((gdb_byte *) &data_size, 4); tfile_read ((gdb_byte *) &data_size, 4);
data_size = (unsigned int) extract_unsigned_integer data_size = (unsigned int) extract_unsigned_integer
((gdb_byte *) &data_size, 4, ((gdb_byte *) &data_size, 4,
gdbarch_byte_order (target_gdbarch)); gdbarch_byte_order (target_gdbarch ()));
offset += 4; offset += 4;
switch (type) switch (type)
{ {
@ -4365,7 +4365,7 @@ traceframe_walk_blocks (walk_blocks_callback_func callback,
mlen = (unsigned short) mlen = (unsigned short)
extract_unsigned_integer ((gdb_byte *) &mlen, 2, extract_unsigned_integer ((gdb_byte *) &mlen, 2,
gdbarch_byte_order gdbarch_byte_order
(target_gdbarch)); (target_gdbarch ()));
lseek (trace_fd, mlen, SEEK_CUR); lseek (trace_fd, mlen, SEEK_CUR);
pos += (8 + 2 + mlen); pos += (8 + 2 + mlen);
break; break;
@ -4502,7 +4502,7 @@ tfile_xfer_partial (struct target_ops *ops, enum target_object object,
{ {
ULONGEST maddr, amt; ULONGEST maddr, amt;
unsigned short mlen; unsigned short mlen;
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
tfile_read ((gdb_byte *) &maddr, 8); tfile_read ((gdb_byte *) &maddr, 8);
maddr = extract_unsigned_integer ((gdb_byte *) &maddr, 8, maddr = extract_unsigned_integer ((gdb_byte *) &maddr, 8,
@ -4585,13 +4585,13 @@ tfile_get_trace_state_variable_value (int tsvnum, LONGEST *val)
tfile_read ((gdb_byte *) &vnum, 4); tfile_read ((gdb_byte *) &vnum, 4);
vnum = (int) extract_signed_integer ((gdb_byte *) &vnum, 4, vnum = (int) extract_signed_integer ((gdb_byte *) &vnum, 4,
gdbarch_byte_order gdbarch_byte_order
(target_gdbarch)); (target_gdbarch ()));
if (tsvnum == vnum) if (tsvnum == vnum)
{ {
tfile_read ((gdb_byte *) val, 8); tfile_read ((gdb_byte *) val, 8);
*val = extract_signed_integer ((gdb_byte *) val, 8, *val = extract_signed_integer ((gdb_byte *) val, 8,
gdbarch_byte_order gdbarch_byte_order
(target_gdbarch)); (target_gdbarch ()));
return 1; return 1;
} }
pos += (4 + 8); pos += (4 + 8);
@ -4739,7 +4739,7 @@ parse_static_tracepoint_marker_definition (char *line, char **pp,
p = unpack_varlen_hex (p, &addr); p = unpack_varlen_hex (p, &addr);
p++; /* skip a colon */ p++; /* skip a colon */
marker->gdbarch = target_gdbarch; marker->gdbarch = target_gdbarch ();
marker->address = (CORE_ADDR) addr; marker->address = (CORE_ADDR) addr;
endp = strchr (p, ':'); endp = strchr (p, ':');
@ -4916,7 +4916,7 @@ info_static_tracepoint_markers_command (char *arg, int from_tty)
ui_out_table_header (uiout, 40, ui_left, "marker-id", "ID"); ui_out_table_header (uiout, 40, ui_left, "marker-id", "ID");
ui_out_table_header (uiout, 3, ui_left, "enabled", "Enb"); ui_out_table_header (uiout, 3, ui_left, "enabled", "Enb");
if (gdbarch_addr_bit (target_gdbarch) <= 32) if (gdbarch_addr_bit (target_gdbarch ()) <= 32)
ui_out_table_header (uiout, 10, ui_left, "addr", "Address"); ui_out_table_header (uiout, 10, ui_left, "addr", "Address");
else else
ui_out_table_header (uiout, 18, ui_left, "addr", "Address"); ui_out_table_header (uiout, 18, ui_left, "addr", "Address");

View file

@ -2404,7 +2404,7 @@ windows_xfer_shared_libraries (struct target_ops *ops,
for (so = solib_start.next; so; so = so->next) for (so = solib_start.next; so; so = so->next)
windows_xfer_shared_library (so->so_name, (CORE_ADDR) windows_xfer_shared_library (so->so_name, (CORE_ADDR)
(uintptr_t) so->lm_info->load_addr, (uintptr_t) so->lm_info->load_addr,
target_gdbarch, &obstack); target_gdbarch (), &obstack);
obstack_grow_str0 (&obstack, "</library-list>\n"); obstack_grow_str0 (&obstack, "</library-list>\n");
buf = obstack_finish (&obstack); buf = obstack_finish (&obstack);

View file

@ -290,8 +290,8 @@ display_one_tib (ptid_t ptid)
gdb_byte *index; gdb_byte *index;
CORE_ADDR thread_local_base; CORE_ADDR thread_local_base;
ULONGEST i, val, max, max_name, size, tib_size; ULONGEST i, val, max, max_name, size, tib_size;
ULONGEST sizeof_ptr = gdbarch_ptr_bit (target_gdbarch); ULONGEST sizeof_ptr = gdbarch_ptr_bit (target_gdbarch ());
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
if (sizeof_ptr == 64) if (sizeof_ptr == 64)
{ {
@ -329,13 +329,13 @@ display_one_tib (ptid_t ptid)
printf_filtered (_("Unable to read thread information " printf_filtered (_("Unable to read thread information "
"block for %s at address %s\n"), "block for %s at address %s\n"),
target_pid_to_str (ptid), target_pid_to_str (ptid),
paddress (target_gdbarch, thread_local_base)); paddress (target_gdbarch (), thread_local_base));
return -1; return -1;
} }
printf_filtered (_("Thread Information Block %s at %s\n"), printf_filtered (_("Thread Information Block %s at %s\n"),
target_pid_to_str (ptid), target_pid_to_str (ptid),
paddress (target_gdbarch, thread_local_base)); paddress (target_gdbarch (), thread_local_base));
index = (gdb_byte *) tib; index = (gdb_byte *) tib;

View file

@ -62,7 +62,7 @@ static void sharedlibrary_command (char *pattern, int from_tty);
static void static void
solib_info (char *args, int from_tty) solib_info (char *args, int from_tty)
{ {
int addr_size = gdbarch_addr_bit (target_gdbarch) / 8; int addr_size = gdbarch_addr_bit (target_gdbarch ()) / 8;
struct vmap *vp = vmap; struct vmap *vp = vmap;
/* Check for new shared libraries loaded with load (). */ /* Check for new shared libraries loaded with load (). */