(paddress): Add GDBARCH parameter.
* utils.c (strlen_paddr, paddr, paddr_nz): Remove.
(paddress): Add GDBARCH parameter, use it instead of current_gdbarch.
* ui-out.h (ui_out_field_core_addr): Add GDBARCH parameter.
* ui-out.c (ui_out_field_core_addr): Add GDBARCH parameter,
use it instead of current_gdbarch.
Update calls to ui_out_field_core_addr to pass architecture:
* ada-lang.c (print_one_exception): Update.
* breakpoint.c (print_one_breakpoint_location,
print_one_exception_catchpoint): Update.
* disasm.c (dump_insns): Update.
* darwin-nat-info.c (darwin_debug_regions_recurse): Update.
* mi/mi-main.c (mi_cmd_data_read_memory): Update.
* mi/mi-symbol-cmds.c: Include "objfiles.h".
(mi_cmd_symbol_list_lines): Update.
* stack.c (print_frame_info, print_frame): Update.
Update callers of paddress to pass architecture:
* ada-tasks.c (info_task): Update.
* ada-valprint.c (ada_val_print_1): Update.
* annotate.c (annotate_source, annotate_frame_begin): Update.
* breakpoint.c (insert_bp_location, describe_other_breakpoints,
mention): Update.
* cli/cli-cmds.c (edit_command, list_command, print_disassembly):
Update.
* corefile.c (memory_error): Update.
* c-valprint.c (print_function_pointer_address, c_val_print): Update.
* disasm.c (dis_asm_print_address): Update.
* exec.c (print_section_info): Update.
* f-valprint.c (f_val_print): Update.
* infcmd.c: Include "arch-utils.h".
(jump_command, program_info): Update.
* linux-fork.c: Include "arch-utils.h".
(info_forks_command): Update.
* m2-valprint.c (print_function_pointer_address,
print_unpacked_pointer, print_variable_at_address,
m2_val_print): Update.
* m32r-rom.c (m32r_load_section, m32r_load, m32r_upload_command):
Update.
* printcmd.c (print_address, print_address_demangle, address_info):
Update.
* p-valprint.c (pascal_val_print): Update.
* source.c: Include "arch-utils.h".
(line_info): Update.
* stack.c (frame_info, print_block_frame_labels): Update.
* symfile.c (add_symbol_file_command, list_overlays_command): Update.
* symmisc.c (dump_msymbols, dump_psymtab, dump_symtab_1,
print_symbol, print_partial_symbols, maintenance_info_psymtabs,
maintenance_check_symtabs): Update.
* symtab.c (find_pc_sect_symtab): Update.
* target.c (deprecated_debug_xfer_memory): Update.
* tracepoint.c (scope_info): Update.
* tui/tui-stack.c (tui_make_status_line): Update.
* valprint.c (val_print_string): Update.
Update callers of paddr_nz to use paddress instead (keeping
user-visible output identical):
* alpha-tdep.c (alpha_heuristic_proc_start): Update.
* amd64-tdep.c (fixup_riprel, amd64_displaced_step_copy_insn,
amd64_displaced_step_fixup): Update.
* arch-utils.c (simple_displaced_step_copy_insn): Update.
* auxv.c (fprint_target_auxv): Update.
* breakpoint.c (insert_single_step_breakpoint): Update.
* buildsym.c (finish_block): Update.
* cli/cli-dump.c (restore_section_callback): Update.
* fbsd-nat.c (fbsd_find_memory_regions): Update.
* frame.c (frame_unwind_register_value): Update.
* gcore.c (gcore_create_callback): Update.
* hppa-tdep.c (hppa_frame_cache, hppa_skip_trampoline_code): Update.
* i386-tdep.c (i386_displaced_step_fixup, i386_record_modrm,
i386_record_lea_modrm_addr, i386_record_lea_modrm,
i386_process_record): Update.
* ia64-tdep.c (ia64_frame_this_id, ia64_sigtramp_frame_this_id,
ia64_libunwind_frame_this_id, ia64_libunwind_sigtramp_frame_this_id,
ia64_dummy_id, ia64_access_reg, ia64_access_rse_reg): Update.
* infrun.c (displaced_step_prepare, displaced_step_fixup,
handle_inferior_event, insert_step_resume_breakpoint_at_sal,
insert_longjmp_resume_breakpoint): Update.
* linux-nat.c (linux_nat_find_memory_regions): Update.
* linux-record.c (record_linux_system_call): Update.
* mips-tdep.c (heuristic_proc_start, mips_eabi_push_dummy_call,
mips_n32n64_push_dummy_call, mips_o32_push_dummy_call,
mips_o64_push_dummy_call): Update.
* monitor.c (monitor_error, monitor_remove_breakpoint): Update.
* record.c (record_arch_list_add_mem, record_wait,
record_xfer_partial): Update.
* remote-mips.c (mips_fetch_word, mips_check_lsi_error,
mips_common_breakpoint): Update.
* remote-sim.c (gdbsim_xfer_inferior_memory): Update.
* rs6000-tdep.c (ppc_displaced_step_fixup): Update.
* solib-som.c (som_current_sos): Update.
* symfile.c (load_progress, generic_load): Update.
* symfile-mem.c (add_vsyscall_page): Update.
* valops.c (value_fetch_lazy): Update.
* windows-tdep.c (windows_xfer_shared_library): Update.
Update callers of paddr_nz to use paddress instead (changing
user-visible output to make it more correct):
* dwarf2loc.c (locexpr_describe_location): Update.
* ia64-tdep.c (ia64_memory_insert_breakpoint,
ia64_memory_remove_breakpoint): Update.
* jv-valprint.c (java_value_print): Update.
* m32c-tdep.c (m32c_m16c_address_to_pointer): Update.
* monitor.c (monitor_read_memory): Update.
Update callers of paddr to use paddress instead (changing
user-visible output to make it more correct):
* arm-tdep.c (arm_push_dummy_call): Update.
* breakpoint.c (insert_bp_location, create_thread_event_breakpoint,
create_breakpoint): Update.
* darwin-nat-info.c (darwin_debug_regions): Update.
* dcache.c (dcache_info): Update.
* dsrec.c (load_srec, make_srec): Update.
* dwarf2-frame.c (dwarf2_restore_rule, execute_cfa_program,
dwarf2_frame_cache): Update.
* gcore.c (gcore_copy_callback): Update.
* gnu-nat.c (gnu_xfer_memory): Update.
* mips-linux-nat.c (mips_show_dr): Update.
* monitor.c (monitor_write_memory, monitor_insert_breakpoint,
monitor_remove_breakpoint): Update.
* remote.c (compare_sections_command): Update.
* remote-m32r-sdi.c (m32r_xfer_memory, m32r_insert_breakpoint,
m32r_remove_breakpoint, m32r_insert_watchpoint,
m32r_remove_watchpoint): Update.
* sol-thread.c (info_cb): Update.
* symfile.c (load_progress): Update.
Update callers of paddress or paddr_nz to use hex_string instead
(changes output of internal/error/debug messages only):
* dwarf2read.c (dump_die_shallow): Update.
* frame.c (fprint_field, fprint_frame, frame_pc_unwind,
get_frame_func, create_new_frame): Update.
* hppa-tdep.c (find_unwind_entry, unwind_command): Update.
* ia64-tdep.c (get_kernel_table, ia64_find_proc_info_x,
ia64_get_dyn_info_list): Update.
* maint.c (maintenance_translate_address): Update.
* mi/mi-cmd-var.c (mi_cmd_var_create): Update.
* target.c (target_flash_erase): Update.
Update callers of paddr/paddr_nz to use phex/phex_nz instead,
using an appropriate address size. Remove use of strlen_paddr.
* exec.c (exec_files_info): Update.
* i386-nat.c (i386_show_dr): Update.
* remote.c (remote_flash_erase): Update.
* m32r-rom.c (m32r_load_section): Update.
* monitor.c (monitor_vsprintf, monitor_store_register): Update.
* remote.c (remote_check_symbols, remote_search_memory): Update.
* remote-mips.c (mips_request, mips_common_breakpoint): Update.
* scm-valprint.c (scm_ipruk, scm_scmval_print): Update.
* sh64-tdep.c (sh64_show_media_regs, sh64_show_compact_regs): Update.
* sh-tdep.c (sh_generic_show_regs, sh3_show_regs, sh2e_show_regs,
sh2a_show_regs, sh2a_nofpu_show_regs, sh3e_show_regs,
sh3_dsp_show_regs, sh4_show_regs, sh4_nofpu_show_regs,
sh_dsp_show_regs): Update.
* xcoffsolib.c (sharedlibrary_command): Update.
* maint.c (maint_print_section_info): Add ADDR_SIZE parameter.
Use hex_string_custom instead of paddr.
(print_bfd_section_info): Pass address size.
(print_objfile_section_info): Likewise.
* annotate.h (annotate_source): Add GDBARCH parameter.
(annotate_frame_begin): Likewise.
* annotate.c (annotate_source): Add GDBARCH parameter.
(annotate_frame_begin): Likewise.
* source.c (identify_source_line): Update call to annotate_source.
* stack.c (print_frame_info, print_frame): Update call to
annotate_frame_begin.
* breakpoint.c (describe_other_breakpoints): Add GDBARCH parameter.
(create_breakpoint, create_ada_exception_breakpoint): Update call.
* stack.c (print_block_frame_labels): Add GDBARCH parameter.
(print_frame_label_vars): Update call.
* symmisc.c (print_partial_symbols): Add GDBARCH parameter.
(dump_psymtab): Update call to print_partial_symbols.
(struct print_symbol_args): Add GDBARCH member.
(dump_symtab_1): Set print_symbol_args architecture member.
(print_symbol): Use it.
* windows-tdep.h (windows_xfer_shared_library): Add GDBARCH
parameter.
* windows-tdep.c (windows_xfer_shared_library): Likewise.
* i386-cygwin-tdep.c (struct cpms_data): Add GDBARCH member.
(core_process_module_section): Pass architecture from cpms_data to
windows_xfer_shared_library.
(windows_core_xfer_shared_libraries): Initialize cmps_data
architecture member.
* windows-nat.c (windows_xfer_shared_libraries): Pass architecture
to windows_xfer_shared_library.
* defs.h (print_address): Add GDBARCH parameter.
* printcmd.c (print_address): Add GDBARCH parameter.
(print_scalar_formatted, do_examine): Update call.
* findcmd.c (find_command): Update call.
* tracepoint.c: Include "arch-utils.h".
(trace_find_line_command): Update call.
* tui/tui-disasm.c (tui_disassemble): Update call.
* value.h (print_address_demangle): Add GDBARCH parameter.
* printcmd.c (print_address_demangle): Add GDBARCH parameter.
* c-valprint.c (print_function_pointer_address, c_val_print):
Update call.
* f-valprint.c (f_val_print): Update call.
* gnu-v3-abi.c (gnuv3_print_method_ptr): Update call.
* jv-valprint.c (java_val_print): Update call.
* m2-valprint.c (print_function_pointer_address, m2_val_print):
Update call.
* p-valprint.c (pascal_val_print): Update call.
* disasm.c (gdb_disassemble_info): Install architecture into
di.application_data field.
testsuite/ChangeLog:
* gdb.threads/tls-shared.exp: Update to locexpr_describe_location
change to prefix TLS offset in hex with 0x.
doc/ChangeLog:
* gdbint.texinfo (Item Output Functions): Update signature
for ui_out_field_core_addr.
+2009-07-02 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * defs.h (strlen_paddr, paddr, paddr_nz): Remove.
+ (paddress): Add GDBARCH parameter.
+ * utils.c (strlen_paddr, paddr, paddr_nz): Remove.
+ (paddress): Add GDBARCH parameter, use it instead of current_gdbarch.
+ * ui-out.h (ui_out_field_core_addr): Add GDBARCH parameter.
+ * ui-out.c (ui_out_field_core_addr): Add GDBARCH parameter,
+ use it instead of current_gdbarch.
+
+ Update calls to ui_out_field_core_addr to pass architecture:
+ * ada-lang.c (print_one_exception): Update.
+ * breakpoint.c (print_one_breakpoint_location,
+ print_one_exception_catchpoint): Update.
+ * disasm.c (dump_insns): Update.
+ * darwin-nat-info.c (darwin_debug_regions_recurse): Update.
+ * mi/mi-main.c (mi_cmd_data_read_memory): Update.
+ * mi/mi-symbol-cmds.c: Include "objfiles.h".
+ (mi_cmd_symbol_list_lines): Update.
+ * stack.c (print_frame_info, print_frame): Update.
+
+ Update callers of paddress to pass architecture:
+ * ada-tasks.c (info_task): Update.
+ * ada-valprint.c (ada_val_print_1): Update.
+ * annotate.c (annotate_source, annotate_frame_begin): Update.
+ * breakpoint.c (insert_bp_location, describe_other_breakpoints,
+ mention): Update.
+ * cli/cli-cmds.c (edit_command, list_command, print_disassembly):
+ Update.
+ * corefile.c (memory_error): Update.
+ * c-valprint.c (print_function_pointer_address, c_val_print): Update.
+ * disasm.c (dis_asm_print_address): Update.
+ * exec.c (print_section_info): Update.
+ * f-valprint.c (f_val_print): Update.
+ * infcmd.c: Include "arch-utils.h".
+ (jump_command, program_info): Update.
+ * linux-fork.c: Include "arch-utils.h".
+ (info_forks_command): Update.
+ * m2-valprint.c (print_function_pointer_address,
+ print_unpacked_pointer, print_variable_at_address,
+ m2_val_print): Update.
+ * m32r-rom.c (m32r_load_section, m32r_load, m32r_upload_command):
+ Update.
+ * printcmd.c (print_address, print_address_demangle, address_info):
+ Update.
+ * p-valprint.c (pascal_val_print): Update.
+ * source.c: Include "arch-utils.h".
+ (line_info): Update.
+ * stack.c (frame_info, print_block_frame_labels): Update.
+ * symfile.c (add_symbol_file_command, list_overlays_command): Update.
+ * symmisc.c (dump_msymbols, dump_psymtab, dump_symtab_1,
+ print_symbol, print_partial_symbols, maintenance_info_psymtabs,
+ maintenance_check_symtabs): Update.
+ * symtab.c (find_pc_sect_symtab): Update.
+ * target.c (deprecated_debug_xfer_memory): Update.
+ * tracepoint.c (scope_info): Update.
+ * tui/tui-stack.c (tui_make_status_line): Update.
+ * valprint.c (val_print_string): Update.
+
+ Update callers of paddr_nz to use paddress instead (keeping
+ user-visible output identical):
+ * alpha-tdep.c (alpha_heuristic_proc_start): Update.
+ * amd64-tdep.c (fixup_riprel, amd64_displaced_step_copy_insn,
+ amd64_displaced_step_fixup): Update.
+ * arch-utils.c (simple_displaced_step_copy_insn): Update.
+ * auxv.c (fprint_target_auxv): Update.
+ * breakpoint.c (insert_single_step_breakpoint): Update.
+ * buildsym.c (finish_block): Update.
+ * cli/cli-dump.c (restore_section_callback): Update.
+ * fbsd-nat.c (fbsd_find_memory_regions): Update.
+ * frame.c (frame_unwind_register_value): Update.
+ * gcore.c (gcore_create_callback): Update.
+ * hppa-tdep.c (hppa_frame_cache, hppa_skip_trampoline_code): Update.
+ * i386-tdep.c (i386_displaced_step_fixup, i386_record_modrm,
+ i386_record_lea_modrm_addr, i386_record_lea_modrm,
+ i386_process_record): Update.
+ * ia64-tdep.c (ia64_frame_this_id, ia64_sigtramp_frame_this_id,
+ ia64_libunwind_frame_this_id, ia64_libunwind_sigtramp_frame_this_id,
+ ia64_dummy_id, ia64_access_reg, ia64_access_rse_reg): Update.
+ * infrun.c (displaced_step_prepare, displaced_step_fixup,
+ handle_inferior_event, insert_step_resume_breakpoint_at_sal,
+ insert_longjmp_resume_breakpoint): Update.
+ * linux-nat.c (linux_nat_find_memory_regions): Update.
+ * linux-record.c (record_linux_system_call): Update.
+ * mips-tdep.c (heuristic_proc_start, mips_eabi_push_dummy_call,
+ mips_n32n64_push_dummy_call, mips_o32_push_dummy_call,
+ mips_o64_push_dummy_call): Update.
+ * monitor.c (monitor_error, monitor_remove_breakpoint): Update.
+ * record.c (record_arch_list_add_mem, record_wait,
+ record_xfer_partial): Update.
+ * remote-mips.c (mips_fetch_word, mips_check_lsi_error,
+ mips_common_breakpoint): Update.
+ * remote-sim.c (gdbsim_xfer_inferior_memory): Update.
+ * rs6000-tdep.c (ppc_displaced_step_fixup): Update.
+ * solib-som.c (som_current_sos): Update.
+ * symfile.c (load_progress, generic_load): Update.
+ * symfile-mem.c (add_vsyscall_page): Update.
+ * valops.c (value_fetch_lazy): Update.
+ * windows-tdep.c (windows_xfer_shared_library): Update.
+
+ Update callers of paddr_nz to use paddress instead (changing
+ user-visible output to make it more correct):
+ * dwarf2loc.c (locexpr_describe_location): Update.
+ * ia64-tdep.c (ia64_memory_insert_breakpoint,
+ ia64_memory_remove_breakpoint): Update.
+ * jv-valprint.c (java_value_print): Update.
+ * m32c-tdep.c (m32c_m16c_address_to_pointer): Update.
+ * monitor.c (monitor_read_memory): Update.
+
+ Update callers of paddr to use paddress instead (changing
+ user-visible output to make it more correct):
+ * arm-tdep.c (arm_push_dummy_call): Update.
+ * breakpoint.c (insert_bp_location, create_thread_event_breakpoint,
+ create_breakpoint): Update.
+ * darwin-nat-info.c (darwin_debug_regions): Update.
+ * dcache.c (dcache_info): Update.
+ * dsrec.c (load_srec, make_srec): Update.
+ * dwarf2-frame.c (dwarf2_restore_rule, execute_cfa_program,
+ dwarf2_frame_cache): Update.
+ * gcore.c (gcore_copy_callback): Update.
+ * gnu-nat.c (gnu_xfer_memory): Update.
+ * mips-linux-nat.c (mips_show_dr): Update.
+ * monitor.c (monitor_write_memory, monitor_insert_breakpoint,
+ monitor_remove_breakpoint): Update.
+ * remote.c (compare_sections_command): Update.
+ * remote-m32r-sdi.c (m32r_xfer_memory, m32r_insert_breakpoint,
+ m32r_remove_breakpoint, m32r_insert_watchpoint,
+ m32r_remove_watchpoint): Update.
+ * sol-thread.c (info_cb): Update.
+ * symfile.c (load_progress): Update.
+
+ Update callers of paddress or paddr_nz to use hex_string instead
+ (changes output of internal/error/debug messages only):
+ * dwarf2read.c (dump_die_shallow): Update.
+ * frame.c (fprint_field, fprint_frame, frame_pc_unwind,
+ get_frame_func, create_new_frame): Update.
+ * hppa-tdep.c (find_unwind_entry, unwind_command): Update.
+ * ia64-tdep.c (get_kernel_table, ia64_find_proc_info_x,
+ ia64_get_dyn_info_list): Update.
+ * maint.c (maintenance_translate_address): Update.
+ * mi/mi-cmd-var.c (mi_cmd_var_create): Update.
+ * target.c (target_flash_erase): Update.
+
+ Update callers of paddr/paddr_nz to use phex/phex_nz instead,
+ using an appropriate address size. Remove use of strlen_paddr.
+ * exec.c (exec_files_info): Update.
+ * i386-nat.c (i386_show_dr): Update.
+ * remote.c (remote_flash_erase): Update.
+ * m32r-rom.c (m32r_load_section): Update.
+ * monitor.c (monitor_vsprintf, monitor_store_register): Update.
+ * remote.c (remote_check_symbols, remote_search_memory): Update.
+ * remote-mips.c (mips_request, mips_common_breakpoint): Update.
+ * scm-valprint.c (scm_ipruk, scm_scmval_print): Update.
+ * sh64-tdep.c (sh64_show_media_regs, sh64_show_compact_regs): Update.
+ * sh-tdep.c (sh_generic_show_regs, sh3_show_regs, sh2e_show_regs,
+ sh2a_show_regs, sh2a_nofpu_show_regs, sh3e_show_regs,
+ sh3_dsp_show_regs, sh4_show_regs, sh4_nofpu_show_regs,
+ sh_dsp_show_regs): Update.
+ * xcoffsolib.c (sharedlibrary_command): Update.
+
+
+ * maint.c (maint_print_section_info): Add ADDR_SIZE parameter.
+ Use hex_string_custom instead of paddr.
+ (print_bfd_section_info): Pass address size.
+ (print_objfile_section_info): Likewise.
+
+ * annotate.h (annotate_source): Add GDBARCH parameter.
+ (annotate_frame_begin): Likewise.
+ * annotate.c (annotate_source): Add GDBARCH parameter.
+ (annotate_frame_begin): Likewise.
+ * source.c (identify_source_line): Update call to annotate_source.
+ * stack.c (print_frame_info, print_frame): Update call to
+ annotate_frame_begin.
+
+ * breakpoint.c (describe_other_breakpoints): Add GDBARCH parameter.
+ (create_breakpoint, create_ada_exception_breakpoint): Update call.
+
+ * stack.c (print_block_frame_labels): Add GDBARCH parameter.
+ (print_frame_label_vars): Update call.
+
+ * symmisc.c (print_partial_symbols): Add GDBARCH parameter.
+ (dump_psymtab): Update call to print_partial_symbols.
+ (struct print_symbol_args): Add GDBARCH member.
+ (dump_symtab_1): Set print_symbol_args architecture member.
+ (print_symbol): Use it.
+
+ * windows-tdep.h (windows_xfer_shared_library): Add GDBARCH
+ parameter.
+ * windows-tdep.c (windows_xfer_shared_library): Likewise.
+ * i386-cygwin-tdep.c (struct cpms_data): Add GDBARCH member.
+ (core_process_module_section): Pass architecture from cpms_data to
+ windows_xfer_shared_library.
+ (windows_core_xfer_shared_libraries): Initialize cmps_data
+ architecture member.
+ * windows-nat.c (windows_xfer_shared_libraries): Pass architecture
+ to windows_xfer_shared_library.
+
+ * defs.h (print_address): Add GDBARCH parameter.
+ * printcmd.c (print_address): Add GDBARCH parameter.
+ (print_scalar_formatted, do_examine): Update call.
+ * findcmd.c (find_command): Update call.
+ * tracepoint.c: Include "arch-utils.h".
+ (trace_find_line_command): Update call.
+ * tui/tui-disasm.c (tui_disassemble): Update call.
+
+ * value.h (print_address_demangle): Add GDBARCH parameter.
+ * printcmd.c (print_address_demangle): Add GDBARCH parameter.
+ * c-valprint.c (print_function_pointer_address, c_val_print):
+ Update call.
+ * f-valprint.c (f_val_print): Update call.
+ * gnu-v3-abi.c (gnuv3_print_method_ptr): Update call.
+ * jv-valprint.c (java_val_print): Update call.
+ * m2-valprint.c (print_function_pointer_address, m2_val_print):
+ Update call.
+ * p-valprint.c (pascal_val_print): Update call.
+
+ * disasm.c (gdb_disassemble_info): Install architecture into
+ di.application_data field.
+
2009-07-02 Ulrich Weigand <uweigand@de.ibm.com>
* disasm.h (gdb_disassembly): Add GDBARCH parameter.
if (opts.addressprint)
{
annotate_field (4);
- ui_out_field_core_addr (uiout, "addr", b->loc->address);
+ ui_out_field_core_addr (uiout, "addr", b->loc->gdbarch, b->loc->address);
}
annotate_field (5);
task_info = VEC_index (ada_task_info_s, task_list, taskno - 1);
/* Print the Ada task ID. */
- printf_filtered (_("Ada Task: %s\n"), paddr_nz (task_info->task_id));
+ printf_filtered (_("Ada Task: %s\n"),
+ paddress (target_gdbarch, task_info->task_id));
/* Print the name of the task. */
if (task_info->name[0] != '\0')
struct gdbarch *gdbarch = get_type_arch (type);
struct type *ptr_type = builtin_type (gdbarch)->builtin_data_ptr;
+ CORE_ADDR addr = extract_typed_address (valaddr, ptr_type);
fprintf_filtered (stream, "(");
type_print (type, "", stream, -1);
fprintf_filtered (stream, ") ");
- fputs_filtered (paddress (extract_typed_address
- (valaddr, ptr_type)),
- stream);
+ fputs_filtered (paddress (gdbarch, addr), stream);
}
else
{
if (fence == tdep->vm_min_address)
warning (_("Hit beginning of text section without finding \
-enclosing function for address 0x%s"), paddr_nz (orig_pc));
+enclosing function for address %s"), paddress (gdbarch, orig_pc));
else
warning (_("Hit heuristic-fence-post without finding \
-enclosing function for address 0x%s"), paddr_nz (orig_pc));
+enclosing function for address %s"), paddress (gdbarch, orig_pc));
if (!blurb_printed)
{
if (debug_displaced)
fprintf_unfiltered (gdb_stdlog, "displaced: %%rip-relative addressing used.\n"
- "displaced: using temp reg %d, old value 0x%s, new value 0x%s\n",
- dsc->tmp_regno, paddr_nz (dsc->tmp_save),
- paddr_nz (rip_base));
+ "displaced: using temp reg %d, old value %s, new value %s\n",
+ dsc->tmp_regno, paddress (gdbarch, dsc->tmp_save),
+ paddress (gdbarch, rip_base));
}
static void
if (debug_displaced)
{
- fprintf_unfiltered (gdb_stdlog, "displaced: copy 0x%s->0x%s: ",
- paddr_nz (from), paddr_nz (to));
+ fprintf_unfiltered (gdb_stdlog, "displaced: copy %s->%s: ",
+ paddress (gdbarch, from), paddress (gdbarch, to));
displaced_step_dump_bytes (gdb_stdlog, buf, len);
}
if (debug_displaced)
fprintf_unfiltered (gdb_stdlog,
- "displaced: fixup (0x%s, 0x%s), "
+ "displaced: fixup (%s, %s), "
"insn = 0x%02x 0x%02x ...\n",
- paddr_nz (from), paddr_nz (to), insn[0], insn[1]);
+ paddress (gdbarch, from), paddress (gdbarch, to),
+ insn[0], insn[1]);
/* If we used a tmp reg, restore it. */
if (dsc->tmp_used)
{
if (debug_displaced)
- fprintf_unfiltered (gdb_stdlog, "displaced: restoring reg %d to 0x%s\n",
- dsc->tmp_regno, paddr_nz (dsc->tmp_save));
+ fprintf_unfiltered (gdb_stdlog, "displaced: restoring reg %d to %s\n",
+ dsc->tmp_regno, paddress (gdbarch, dsc->tmp_save));
regcache_cooked_write_unsigned (regs, dsc->tmp_regno, dsc->tmp_save);
}
if (debug_displaced)
fprintf_unfiltered (gdb_stdlog,
"displaced: "
- "relocated %%rip from 0x%s to 0x%s\n",
- paddr_nz (orig_rip), paddr_nz (rip));
+ "relocated %%rip from %s to %s\n",
+ paddress (gdbarch, orig_rip),
+ paddress (gdbarch, rip));
}
}
if (debug_displaced)
fprintf_unfiltered (gdb_stdlog,
- "displaced: relocated return addr at 0x%s "
- "to 0x%s\n",
- paddr_nz (rsp),
- paddr_nz (retaddr));
+ "displaced: relocated return addr at %s "
+ "to %s\n",
+ paddress (gdbarch, rsp),
+ paddress (gdbarch, retaddr));
}
}
\f
}
void
-annotate_source (char *filename, int line, int character, int mid, CORE_ADDR pc)
+annotate_source (char *filename, int line, int character, int mid,
+ struct gdbarch *gdbarch, CORE_ADDR pc)
{
if (annotation_level > 1)
printf_filtered (("\n\032\032source "));
printf_filtered (("\032\032"));
printf_filtered (("%s:%d:%d:%s:%s\n"), filename, line, character,
- mid ? "middle" : "beg", paddress (pc));
+ mid ? "middle" : "beg", paddress (gdbarch, pc));
}
void
-annotate_frame_begin (int level, CORE_ADDR pc)
+annotate_frame_begin (int level, struct gdbarch *gdbarch, CORE_ADDR pc)
{
if (annotation_level > 1)
- printf_filtered (("\n\032\032frame-begin %d %s\n"), level, paddress (pc));
+ printf_filtered (("\n\032\032frame-begin %d %s\n"),
+ level, paddress (gdbarch, pc));
}
void
extern void annotate_arg_value (struct type *);
extern void annotate_arg_end (void);
-extern void annotate_source (char *, int, int, int, CORE_ADDR);
+extern void annotate_source (char *, int, int, int,
+ struct gdbarch *, CORE_ADDR);
-extern void annotate_frame_begin (int, CORE_ADDR);
+extern void annotate_frame_begin (int, struct gdbarch *, CORE_ADDR);
extern void annotate_function_call (void);
extern void annotate_signal_handler_caller (void);
extern void annotate_frame_address (void);
if (debug_displaced)
{
- fprintf_unfiltered (gdb_stdlog, "displaced: copy 0x%s->0x%s: ",
- paddr_nz (from), paddr_nz (to));
+ fprintf_unfiltered (gdb_stdlog, "displaced: copy %s->%s: ",
+ paddress (gdbarch, from), paddress (gdbarch, to));
displaced_step_dump_bytes (gdb_stdlog, buf, len);
}
if (struct_return)
{
if (arm_debug)
- fprintf_unfiltered (gdb_stdlog, "struct return in %s = 0x%s\n",
+ fprintf_unfiltered (gdb_stdlog, "struct return in %s = %s\n",
gdbarch_register_name (gdbarch, argreg),
- paddr (struct_addr));
+ paddress (gdbarch, struct_addr));
regcache_cooked_write_unsigned (regcache, argreg, struct_addr);
argreg++;
}
fprintf_filtered (file, "%s\n", plongest (val));
break;
case hex:
- fprintf_filtered (file, "0x%s\n", paddr_nz (val));
+ fprintf_filtered (file, "%s\n", paddress (target_gdbarch, val));
break;
case str:
{
struct value_print_options opts;
get_user_print_options (&opts);
if (opts.addressprint)
- fprintf_filtered (file, "0x%s", paddr_nz (val));
+ fprintf_filtered (file, "%s", paddress (target_gdbarch, val));
val_print_string (builtin_type (target_gdbarch)->builtin_char,
val, -1, file, &opts);
fprintf_filtered (file, "\n");
CORE_ADDR bpaddr,
enum bptype bptype);
-static void describe_other_breakpoints (CORE_ADDR, struct obj_section *, int);
+static void describe_other_breakpoints (struct gdbarch *, CORE_ADDR,
+ struct obj_section *, int);
static void breakpoints_info (char *, int);
else if (bpt->loc_type == bp_loc_software_breakpoint
&& mr->attrib.mode != MEM_RW)
warning (_("cannot set software breakpoint at readonly address %s"),
- paddr (bpt->address));
+ paddress (bpt->gdbarch, bpt->address));
}
}
bpt->owner->number);
fprintf_filtered (tmp_error_stream,
"Error accessing memory address ");
- fputs_filtered (paddress (bpt->address), tmp_error_stream);
+ fputs_filtered (paddress (bpt->gdbarch, bpt->address),
+ tmp_error_stream);
fprintf_filtered (tmp_error_stream, ": %s.\n",
safe_strerror (val));
}
else if (b->loc == NULL || loc->shlib_disabled)
ui_out_field_string (uiout, "addr", "<PENDING>");
else
- ui_out_field_core_addr (uiout, "addr", loc->address);
+ ui_out_field_core_addr (uiout, "addr",
+ loc->gdbarch, loc->address);
}
annotate_field (5);
if (!header_of_multiple)
ui_out_text (uiout, "\tstop only in stack frame at ");
/* FIXME: cagney/2002-12-01: Shouldn't be poeking around inside
the frame ID. */
- ui_out_field_core_addr (uiout, "frame", b->frame_id.stack_addr);
+ ui_out_field_core_addr (uiout, "frame",
+ b->gdbarch, b->frame_id.stack_addr);
ui_out_text (uiout, "\n");
}
/* Print a message describing any breakpoints set at PC. */
static void
-describe_other_breakpoints (CORE_ADDR pc, struct obj_section *section,
- int thread)
+describe_other_breakpoints (struct gdbarch *gdbarch, CORE_ADDR pc,
+ struct obj_section *section, int thread)
{
int others = 0;
struct breakpoint *b;
: ((others == 1) ? " and" : ""));
}
printf_filtered (_("also set at pc "));
- fputs_filtered (paddress (pc), gdb_stdout);
+ fputs_filtered (paddress (gdbarch, pc), gdb_stdout);
printf_filtered (".\n");
}
}
b->enable_state = bp_enabled;
/* addr_string has to be used or breakpoint_re_set will delete me. */
- b->addr_string = xstrprintf ("*0x%s", paddr (b->loc->address));
+ b->addr_string
+ = xstrprintf ("*%s", paddress (b->loc->gdbarch, b->loc->address));
update_global_location_list_nothrow (1);
if (opts.addressprint || b->source_file == NULL)
{
printf_filtered (" at ");
- fputs_filtered (paddress (b->loc->address), gdb_stdout);
+ fputs_filtered (paddress (b->loc->gdbarch, b->loc->address),
+ gdb_stdout);
}
if (b->source_file)
printf_filtered (": file %s, line %d.",
struct bp_location *loc;
if (from_tty)
- describe_other_breakpoints (sal.pc, sal.section, thread);
+ {
+ struct gdbarch *loc_gdbarch = get_sal_arch (sal);
+ if (!loc_gdbarch)
+ loc_gdbarch = gdbarch;
+
+ describe_other_breakpoints (loc_gdbarch,
+ sal.pc, sal.section, thread);
+ }
if (i == 0)
{
else
/* addr_string has to be used or breakpoint_re_set will delete
me. */
- b->addr_string = xstrprintf ("*0x%s", paddr (b->loc->address));
+ b->addr_string
+ = xstrprintf ("*%s", paddress (b->loc->gdbarch, b->loc->address));
b->ops = ops;
mention (b);
if (b->loc == NULL || b->loc->shlib_disabled)
ui_out_field_string (uiout, "addr", "<PENDING>");
else
- ui_out_field_core_addr (uiout, "addr", b->loc->address);
+ ui_out_field_core_addr (uiout, "addr",
+ b->loc->gdbarch, b->loc->address);
}
annotate_field (5);
if (b->loc)
if (from_tty)
{
- describe_other_breakpoints (sal.pc, sal.section, -1);
+ struct gdbarch *loc_gdbarch = get_sal_arch (sal);
+ if (!loc_gdbarch)
+ loc_gdbarch = gdbarch;
+
+ describe_other_breakpoints (loc_gdbarch, sal.pc, sal.section, -1);
/* FIXME: brobecker/2006-12-28: Actually, re-implement a special
version for exception catchpoints, because two catchpoints
used for different exception names will use the same address.
*bpt_p = deprecated_insert_raw_breakpoint (gdbarch, next_pc);
if (*bpt_p == NULL)
- error (_("Could not insert single-step breakpoint at 0x%s"),
- paddr_nz (next_pc));
+ error (_("Could not insert single-step breakpoint at %s"),
+ paddress (gdbarch, next_pc));
}
/* Remove and delete any breakpoints used for software single step. */
CORE_ADDR start, CORE_ADDR end,
struct objfile *objfile)
{
+ struct gdbarch *gdbarch = get_objfile_arch (objfile);
struct pending *next, *next1;
struct block *block;
struct pending_block *pblock;
else
{
complaint (&symfile_complaints,
- _("block end address 0x%s less than block start address 0x%s (patched it)"),
- paddr_nz (BLOCK_END (block)), paddr_nz (BLOCK_START (block)));
+ _("block end address %s less than block start address %s (patched it)"),
+ paddress (gdbarch, BLOCK_END (block)),
+ paddress (gdbarch, BLOCK_START (block)));
}
/* Better than nothing */
BLOCK_END (block) = BLOCK_START (block);
else
{
complaint (&symfile_complaints,
- _("inner block (0x%s-0x%s) not inside outer block (0x%s-0x%s)"),
- paddr_nz (BLOCK_START (pblock->block)),
- paddr_nz (BLOCK_END (pblock->block)),
- paddr_nz (BLOCK_START (block)),
- paddr_nz (BLOCK_END (block)));
+ _("inner block (%s-%s) not inside outer block (%s-%s)"),
+ paddress (gdbarch, BLOCK_START (pblock->block)),
+ paddress (gdbarch, BLOCK_END (pblock->block)),
+ paddress (gdbarch, BLOCK_START (block)),
+ paddress (gdbarch, BLOCK_END (block)));
}
if (BLOCK_START (pblock->block) < BLOCK_START (block))
BLOCK_START (pblock->block) = BLOCK_START (block);
if (addressprint && func_addr != address)
{
fputs_filtered ("@", stream);
- fputs_filtered (paddress (address), stream);
+ fputs_filtered (paddress (gdbarch, address), stream);
fputs_filtered (": ", stream);
}
- print_address_demangle (func_addr, stream, demangle);
+ print_address_demangle (gdbarch, func_addr, stream, demangle);
}
}
if (options->addressprint)
- fputs_filtered (paddress (addr), stream);
+ fputs_filtered (paddress (gdbarch, addr), stream);
/* For a pointer to a textual type, also print the string
pointed to, unless pointer is null. */
CORE_ADDR addr
= extract_typed_address (valaddr + embedded_offset, type);
fprintf_filtered (stream, "@");
- fputs_filtered (paddress (addr), stream);
+ fputs_filtered (paddress (gdbarch, addr), stream);
if (options->deref_ref)
fputs_filtered (": ", stream);
}
type_print (type, "", stream, -1);
fprintf_filtered (stream, "} ");
/* Try to print what function it points to, and its address. */
- print_address_demangle (address, stream, demangle);
+ print_address_demangle (gdbarch, address, stream, demangle);
break;
case TYPE_CODE_BOOL:
of all known source files, not that user failed to give a filename. */
if (*arg == '*')
{
+ struct gdbarch *gdbarch;
if (sal.symtab == 0)
/* FIXME-32x64--assumes sal.pc fits in long. */
error (_("No source file for address %s."),
hex_string ((unsigned long) sal.pc));
+
+ gdbarch = get_objfile_arch (sal.symtab->objfile);
sym = find_pc_function (sal.pc);
if (sym)
- printf_filtered ("%s is in %s (%s:%d).\n", paddress (sal.pc),
- SYMBOL_PRINT_NAME (sym), sal.symtab->filename,
- sal.line);
+ printf_filtered ("%s is in %s (%s:%d).\n",
+ paddress (gdbarch, sal.pc),
+ SYMBOL_PRINT_NAME (sym),
+ sal.symtab->filename, sal.line);
else
- printf_filtered ("%s is at %s:%d.\n", paddress (sal.pc),
+ printf_filtered ("%s is at %s:%d.\n",
+ paddress (gdbarch, sal.pc),
sal.symtab->filename, sal.line);
}
of all known source files, not that user failed to give a filename. */
if (*arg == '*')
{
+ struct gdbarch *gdbarch;
if (sal.symtab == 0)
/* FIXME-32x64--assumes sal.pc fits in long. */
error (_("No source file for address %s."),
hex_string ((unsigned long) sal.pc));
+
+ gdbarch = get_objfile_arch (sal.symtab->objfile);
sym = find_pc_function (sal.pc);
if (sym)
printf_filtered ("%s is in %s (%s:%d).\n",
- paddress (sal.pc), SYMBOL_PRINT_NAME (sym),
+ paddress (gdbarch, sal.pc),
+ SYMBOL_PRINT_NAME (sym),
sal.symtab->filename, sal.line);
else
- printf_filtered ("%s is at %s:%d.\n", paddress (sal.pc),
+ printf_filtered ("%s is at %s:%d.\n",
+ paddress (gdbarch, sal.pc),
sal.symtab->filename, sal.line);
}
if (name != NULL)
printf_filtered ("for function %s:\n", name);
else
- printf_filtered ("from %s to %s:\n", paddress (low), paddress (high));
+ printf_filtered ("from %s to %s:\n",
+ paddress (gdbarch, low), paddress (gdbarch, high));
/* Dump the specified range. */
gdb_disassembly (gdbarch, uiout, 0, mixed, -1, low, high);
(unsigned long) sec_end);
if (data->load_offset != 0 || data->load_start != 0 || data->load_end != 0)
- printf_filtered (" into memory (0x%s to 0x%s)\n",
- paddr_nz ((unsigned long) sec_start
+ printf_filtered (" into memory (%s to %s)\n",
+ paddress (target_gdbarch,
+ (unsigned long) sec_start
+ sec_offset + data->load_offset),
- paddr_nz ((unsigned long) sec_start + sec_offset
- + data->load_offset + sec_load_count));
+ paddress (target_gdbarch,
+ (unsigned long) sec_start + sec_offset
+ + data->load_offset + sec_load_count));
else
puts_filtered ("\n");
bounds. */
throw_error (MEMORY_ERROR,
_("Cannot access memory at address %s"),
- paddress (memaddr));
+ paddress (target_gdbarch, memaddr));
else
throw_error (MEMORY_ERROR,
_("Error accessing memory address %s: %s."),
- paddress (memaddr),
+ paddress (target_gdbarch, memaddr),
safe_strerror (status));
}
if (print)
{
printf_filtered (_("%s-%s %s/%s %s %s %s"),
- paddr(prev_address),
- paddr(prev_address + prev_size),
+ paddress (target_gdbarch, prev_address),
+ paddress (target_gdbarch, prev_address + prev_size),
unparse_protection (prev_info.protection),
unparse_protection (prev_info.max_protection),
unparse_inheritance (prev_info.inheritance),
break;
row_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "regions-row");
- ui_out_field_core_addr (uiout, "start", r_start);
- ui_out_field_core_addr (uiout, "end", r_start + r_size);
+ 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_string (uiout, "min-prot",
unparse_protection (r_info.protection));
ui_out_field_string (uiout, "max-prot",
{
int j;
printf_filtered (_("Line at %s, referenced %d times\n"),
- paddr (p->addr), p->refs);
+ paddress (target_gdbarch, p->addr), p->refs);
for (j = 0; j < LINE_SIZE; j++)
printf_filtered ("%02x", p->data[j] & 0xFF);
extern const char *host_address_to_string (const void *addr);
-/* Convert a CORE_ADDR into a HEX string. paddr() is like %08lx.
- paddr_nz() is like %lx. */
-extern int strlen_paddr (void);
-extern char *paddr (CORE_ADDR addr);
-extern char *paddr_nz (CORE_ADDR addr);
-
-/* Like 0x%lx. */
-extern const char *paddress (CORE_ADDR addr);
+/* Convert CORE_ADDR to string in platform-specific manner.
+ This is usually formatted similar to 0x%lx. */
+extern const char *paddress (struct gdbarch *gdbarch, CORE_ADDR addr);
/* %d for LONGEST */
extern char *plongest (LONGEST l);
extern char *phex_nz (ULONGEST l, int sizeof_l);
extern char *int_string (LONGEST, int, int, int, int);
-/* Like paddr() only print/scan raw CORE_ADDR. The output from
- core_addr_to_string() can be passed direct to
+/* Convert a CORE_ADDR into a HEX string with leading zeros.
+ The output from core_addr_to_string() can be passed direct to
string_to_core_addr(). */
extern const char *core_addr_to_string (const CORE_ADDR addr);
extern const char *core_addr_to_string_nz (const CORE_ADDR addr);
int *line,
int *unmapped);
-extern void print_address (CORE_ADDR, struct ui_file *);
+extern void print_address (struct gdbarch *, CORE_ADDR, struct ui_file *);
/* From source.c */
static void
dis_asm_print_address (bfd_vma addr, struct disassemble_info *info)
{
- print_address (addr, info->stream);
+ struct gdbarch *gdbarch = info->application_data;
+ print_address (gdbarch, addr, info->stream);
}
static int
num_displayed++;
}
ui_out_chain = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
- ui_out_field_core_addr (uiout, "address", pc);
+ ui_out_field_core_addr (uiout, "address", gdbarch, pc);
if (!build_address_symbolic (pc, 0, &name, &offset, &filename,
&line, &unmapped))
di.mach = gdbarch_bfd_arch_info (gdbarch)->mach;
di.endian = gdbarch_byte_order (gdbarch);
di.endian_code = gdbarch_byte_order_for_code (gdbarch);
+ di.application_data = gdbarch;
disassemble_init_for_target (&di);
return di;
}
2009-07-02 Ulrich Weigand <uweigand@de.ibm.com>
- * gdbint.texi (Examples of Use of @code{ui_out} functions):
+ * gdbint.texinfo (Item Output Functions): Update signature
+ for ui_out_field_core_addr.
+
+2009-07-02 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * gdbint.texinfo (Examples of Use of @code{ui_out} functions):
Update example code extrated from breakpoint.c.
2009-06-28 Paul Pluzhnikov <ppluzhnikov@google.com>
the name of the field.
@end deftypefun
-@deftypefun void ui_out_field_core_addr (struct ui_out *@var{uiout}, const char *@var{fldname}, CORE_ADDR @var{address})
-This function outputs an address.
+@deftypefun void ui_out_field_core_addr (struct ui_out *@var{uiout}, const char *@var{fldname}, struct gdbarch *@var{gdbarch}, CORE_ADDR @var{address})
+This function outputs an address as appropriate for @var{gdbarch}.
@end deftypefun
@deftypefun void ui_out_field_string (struct ui_out *@var{uiout}, const char *@var{fldname}, const char *@var{string})
In the below, GDB's is used so that the address is
consistent with the rest of GDB. BFD's printf_vma() could
have also been used. cagney 1999-09-01 */
- printf_filtered ("%s\t: 0x%s .. 0x%s ",
+ printf_filtered ("%s\t: %s .. %s ",
section_name,
- paddr (addr),
- paddr (addr + size));
+ paddress (target_gdbarch, addr),
+ paddress (target_gdbarch, addr + size));
gdb_flush (gdb_stdout);
data_count += size;
addr_size = 4;
else
internal_error (__FILE__, __LINE__,
- _("make_srec: Bad address (0x%s), or bad flags (0x%x)."),
- paddr (targ_addr), flags);
+ _("make_srec: Bad address (%s), or bad flags (0x%x)."),
+ paddress (target_gdbarch, targ_addr), flags);
/* Now that we know the address size, we can figure out how much
data this record can hold. */
if (fs->regs.reg[reg].how == DWARF2_FRAME_REG_UNSPECIFIED)
complaint (&symfile_complaints, _("\
incomplete CFI data; DW_CFA_restore unspecified\n\
-register %s (#%d) at 0x%s"),
+register %s (#%d) at %s"),
gdbarch_register_name
(gdbarch, gdbarch_dwarf2_reg_to_regnum (gdbarch, reg)),
gdbarch_dwarf2_reg_to_regnum (gdbarch, reg),
- paddr (fs->pc));
+ paddress (gdbarch, fs->pc));
}
static CORE_ADDR
if (old_rs == NULL)
{
complaint (&symfile_complaints, _("\
-bad CFI data; mismatched DW_CFA_restore_state at 0x%s"), paddr (fs->pc));
+bad CFI data; mismatched DW_CFA_restore_state at %s"),
+ paddress (gdbarch, fs->pc));
}
else
{
{
if (cache->reg[regnum].how == DWARF2_FRAME_REG_UNSPECIFIED)
complaint (&symfile_complaints, _("\
-incomplete CFI data; unspecified registers (e.g., %s) at 0x%s"),
+incomplete CFI data; unspecified registers (e.g., %s) at %s"),
gdbarch_register_name (gdbarch, regnum),
- paddr_nz (fs->pc));
+ paddress (gdbarch, fs->pc));
}
else
cache->reg[regnum] = fs->regs.reg[column];
fprintf_filtered (stream,
"a thread-local variable at offset %s in the "
"thread-local storage for `%s'",
- paddr_nz (offset), objfile->name);
+ paddress (gdbarch, offset), objfile->name);
return 1;
}
case DW_FORM_ref_addr:
case DW_FORM_addr:
fprintf_unfiltered (f, "address: ");
- fputs_filtered (paddress (DW_ADDR (&die->attrs[i])), f);
+ fputs_filtered (hex_string (DW_ADDR (&die->attrs[i])), f);
break;
case DW_FORM_block2:
case DW_FORM_block4:
void
print_section_info (struct target_section_table *t, bfd *abfd)
{
+ struct gdbarch *gdbarch = gdbarch_from_bfd (abfd);
struct target_section *p;
/* FIXME: 16 is not wide enough when gdbarch_addr_bit > 64. */
- int wid = gdbarch_addr_bit (gdbarch_from_bfd (abfd)) <= 32 ? 8 : 16;
+ int wid = gdbarch_addr_bit (gdbarch) <= 32 ? 8 : 16;
printf_filtered ("\t`%s', ", bfd_get_filename (abfd));
wrap_here (" ");
printf_filtered (_("file type %s.\n"), bfd_get_target (abfd));
if (abfd == exec_bfd)
printf_filtered (_("\tEntry point: %s\n"),
- paddress (bfd_get_start_address (abfd)));
+ paddress (gdbarch, bfd_get_start_address (abfd)));
for (p = t->sections; p < t->sections_end; p++)
{
printf_filtered ("\t%s", hex_string_custom (p->addr, wid));
if (vmap)
{
+ int addr_size = gdbarch_addr_bit (target_gdbarch) / 8;
struct vmap *vp;
printf_unfiltered (_("\tMapping info for file `%s'.\n"), vmap->name);
printf_unfiltered ("\t %*s %*s %*s %*s %8.8s %s\n",
- strlen_paddr (), "tstart",
- strlen_paddr (), "tend",
- strlen_paddr (), "dstart",
- strlen_paddr (), "dend",
+ addr_size * 2, "tstart",
+ addr_size * 2, "tend",
+ addr_size * 2, "dstart",
+ addr_size * 2, "dend",
"section",
"file(member)");
for (vp = vmap; vp; vp = vp->nxt)
printf_unfiltered ("\t0x%s 0x%s 0x%s 0x%s %s%s%s%s\n",
- paddr (vp->tstart),
- paddr (vp->tend),
- paddr (vp->dstart),
- paddr (vp->dend),
+ phex (vp->tstart, addr_size),
+ phex (vp->tend, addr_size),
+ phex (vp->dstart, addr_size),
+ phex (vp->dend, addr_size),
vp->name,
*vp->member ? "(" : "", vp->member,
*vp->member ? ")" : "");
if (TYPE_CODE (elttype) == TYPE_CODE_FUNC)
{
/* Try to print what function it points to. */
- print_address_demangle (addr, stream, demangle);
+ print_address_demangle (gdbarch, addr, stream, demangle);
/* Return value is irrelevant except for string pointers. */
return 0;
}
if (options->addressprint && options->format != 's')
- fputs_filtered (paddress (addr), stream);
+ fputs_filtered (paddress (gdbarch, addr), stream);
/* For a pointer to char or unsigned char, also print the string
pointed to, unless pointer is null. */
CORE_ADDR addr
= extract_typed_address (valaddr + embedded_offset, type);
fprintf_filtered (stream, "@");
- fputs_filtered (paddress (addr), stream);
+ fputs_filtered (paddress (gdbarch, addr), stream);
if (options->deref_ref)
fputs_filtered (": ", stream);
}
type_print (type, "", stream, -1);
fprintf_filtered (stream, "} ");
/* Try to print what function it points to, and its address. */
- print_address_demangle (address, stream, demangle);
+ print_address_demangle (gdbarch, address, stream, demangle);
break;
case TYPE_CODE_INT:
if (info_verbose)
{
fprintf_filtered (gdb_stdout,
- "Save segment, %ld bytes at 0x%s (%c%c%c)\n",
- size, paddr_nz (start),
+ "Save segment, %ld bytes at %s (%c%c%c)\n",
+ size, paddress (target_gdbarch, start),
read ? 'r' : '-',
write ? 'w' : '-',
exec ? 'x' : '-');
if (found <= 0)
break;
- print_address (found_addr, gdb_stdout);
+ print_address (gdbarch, found_addr, gdb_stdout);
printf_filtered ("\n");
++found_count;
last_found_addr = found_addr;
fprint_field (struct ui_file *file, const char *name, int p, CORE_ADDR addr)
{
if (p)
- fprintf_unfiltered (file, "%s=0x%s", name, paddr_nz (addr));
+ fprintf_unfiltered (file, "%s=%s", name, hex_string (addr));
else
fprintf_unfiltered (file, "!%s", name);
}
fprintf_unfiltered (file, ",");
fprintf_unfiltered (file, "pc=");
if (fi->next != NULL && fi->next->prev_pc.p)
- fprintf_unfiltered (file, "0x%s", paddr_nz (fi->next->prev_pc.value));
+ fprintf_unfiltered (file, "%s", hex_string (fi->next->prev_pc.value));
else
fprintf_unfiltered (file, "<unknown>");
fprintf_unfiltered (file, ",");
fprintf_unfiltered (file, ",");
fprintf_unfiltered (file, "func=");
if (fi->next != NULL && fi->next->prev_func.p)
- fprintf_unfiltered (file, "0x%s", paddr_nz (fi->next->prev_func.addr));
+ fprintf_unfiltered (file, "%s", hex_string (fi->next->prev_func.addr));
else
fprintf_unfiltered (file, "<unknown>");
fprintf_unfiltered (file, "}");
fprintf_unfiltered (gdb_stdlog,
"{ frame_unwind_caller_pc (this_frame=%d) -> 0x%s }\n",
this_frame->level,
- paddr_nz (this_frame->prev_pc.value));
+ hex_string (this_frame->prev_pc.value));
}
return this_frame->prev_pc.value;
}
next_frame->prev_func.addr = get_pc_function_start (addr_in_block);
if (frame_debug)
fprintf_unfiltered (gdb_stdlog,
- "{ get_frame_func (this_frame=%d) -> 0x%s }\n",
+ "{ get_frame_func (this_frame=%d) -> %s }\n",
this_frame->level,
- paddr_nz (next_frame->prev_func.addr));
+ hex_string (next_frame->prev_func.addr));
}
return next_frame->prev_func.addr;
}
fprintf_unfiltered (gdb_stdlog, " register=%d",
VALUE_REGNUM (value));
else if (VALUE_LVAL (value) == lval_memory)
- fprintf_unfiltered (gdb_stdlog, " address=0x%s",
- paddr_nz (value_address (value)));
+ fprintf_unfiltered (gdb_stdlog, " address=%s",
+ paddress (gdbarch,
+ value_address (value)));
else
fprintf_unfiltered (gdb_stdlog, " computed");
if (frame_debug)
{
fprintf_unfiltered (gdb_stdlog,
- "{ create_new_frame (addr=0x%s, pc=0x%s) ",
- paddr_nz (addr), paddr_nz (pc));
+ "{ create_new_frame (addr=%s, pc=%s) ",
+ hex_string (addr), hex_string (pc));
}
fi = FRAME_OBSTACK_ZALLOC (struct frame_info);
{
if (info_verbose)
{
- fprintf_filtered (gdb_stdout, "Ignore segment, %s bytes at 0x%s\n",
- plongest (size), paddr_nz (vaddr));
+ fprintf_filtered (gdb_stdout, "Ignore segment, %s bytes at %s\n",
+ plongest (size), paddress (target_gdbarch, vaddr));
}
return 0;
if (info_verbose)
{
- fprintf_filtered (gdb_stdout, "Save segment, %s bytes at 0x%s\n",
- plongest (size), paddr_nz (vaddr));
+ fprintf_filtered (gdb_stdout, "Save segment, %s bytes at %s\n",
+ plongest (size), paddress (target_gdbarch, vaddr));
}
bfd_set_section_size (obfd, osec, size);
if (target_read_memory (bfd_section_vma (obfd, osec) + offset,
memhunk, size) != 0)
{
- warning (_("Memory read failed for corefile section, %s bytes at 0x%s."),
- plongest (size), paddr (bfd_section_vma (obfd, osec)));
+ warning (_("Memory read failed for corefile section, %s bytes at %s."),
+ plongest (size),
+ paddress (target_gdbarch, bfd_section_vma (obfd, osec)));
break;
}
if (!bfd_set_section_contents (obfd, osec, memhunk, offset, size))
else
{
inf_debug (gnu_current_inf, "%s %s[%d] %s %s",
- write ? "writing" : "reading", paddr (memaddr), len,
+ write ? "writing" : "reading",
+ paddress (target_gdbarch, memaddr), len,
write ? "<--" : "-->", host_address_to_string (myaddr));
if (write)
return gnu_write_inferior (task, memaddr, myaddr, len);
print_longest (stream, 'd', 1, ptr_value);
}
else
- print_address_demangle (ptr_value, stream, demangle);
+ print_address_demangle (gdbarch, ptr_value, stream, demangle);
if (adjustment)
{
struct hppa_objfile_private *priv;
if (hppa_debug)
- fprintf_unfiltered (gdb_stdlog, "{ find_unwind_entry 0x%s -> ",
- paddr_nz (pc));
+ fprintf_unfiltered (gdb_stdlog, "{ find_unwind_entry %s -> ",
+ hex_string (pc));
/* A function at address 0? Not in HP-UX! */
if (pc == (CORE_ADDR) 0)
&& pc <= ui->cache->region_end)
{
if (hppa_debug)
- fprintf_unfiltered (gdb_stdlog, "0x%s (cached) }\n",
- paddr_nz ((uintptr_t) ui->cache));
+ fprintf_unfiltered (gdb_stdlog, "%s (cached) }\n",
+ hex_string ((uintptr_t) ui->cache));
return ui->cache;
}
{
ui->cache = &ui->table[middle];
if (hppa_debug)
- fprintf_unfiltered (gdb_stdlog, "0x%s }\n",
- paddr_nz ((uintptr_t) ui->cache));
+ fprintf_unfiltered (gdb_stdlog, "%s }\n",
+ hex_string ((uintptr_t) ui->cache));
return &ui->table[middle];
}
if ((*this_cache) != NULL)
{
if (hppa_debug)
- fprintf_unfiltered (gdb_stdlog, "base=0x%s (cached) }",
- paddr_nz (((struct hppa_frame_cache *)*this_cache)->base));
+ fprintf_unfiltered (gdb_stdlog, "base=%s (cached) }",
+ paddress (gdbarch, ((struct hppa_frame_cache *)*this_cache)->base));
return (*this_cache);
}
cache = FRAME_OBSTACK_ZALLOC (struct hppa_frame_cache);
if (!safe_frame_unwind_memory (this_frame, pc, buf4, sizeof buf4))
{
- error (_("Cannot read instruction at 0x%s."), paddr_nz (pc));
+ error (_("Cannot read instruction at %s."),
+ paddress (gdbarch, pc));
return (*this_cache);
}
CORE_ADDR fp;
if (hppa_debug)
- fprintf_unfiltered (gdb_stdlog, " (this_sp=0x%s, pc=0x%s, "
- "prologue_end=0x%s) ",
- paddr_nz (this_sp),
- paddr_nz (get_frame_pc (this_frame)),
- paddr_nz (prologue_end));
+ fprintf_unfiltered (gdb_stdlog, " (this_sp=%s, pc=%s, "
+ "prologue_end=%s) ",
+ paddress (gdbarch, this_sp),
+ paddress (gdbarch, get_frame_pc (this_frame)),
+ paddress (gdbarch, prologue_end));
/* Check to see if a frame pointer is available, and use it for
frame unwinding if it is.
cache->base = fp;
if (hppa_debug)
- fprintf_unfiltered (gdb_stdlog, " (base=0x%s) [frame pointer]",
- paddr_nz (cache->base));
+ fprintf_unfiltered (gdb_stdlog, " (base=%s) [frame pointer]",
+ paddress (gdbarch, cache->base));
}
else if (u->Save_SP
&& trad_frame_addr_p (cache->saved_regs, HPPA_SP_REGNUM))
(this_sp, gdbarch_ptr_bit (gdbarch) / 8);
if (hppa_debug)
- fprintf_unfiltered (gdb_stdlog, " (base=0x%s) [saved]",
- paddr_nz (cache->base));
+ fprintf_unfiltered (gdb_stdlog, " (base=%s) [saved]",
+ paddress (gdbarch, cache->base));
}
else
{
the SP back. */
cache->base = this_sp - frame_size;
if (hppa_debug)
- fprintf_unfiltered (gdb_stdlog, " (base=0x%s) [unwind adjust]",
- paddr_nz (cache->base));
+ fprintf_unfiltered (gdb_stdlog, " (base=%s) [unwind adjust]",
+ paddress (gdbarch, cache->base));
}
trad_frame_set_value (cache->saved_regs, HPPA_SP_REGNUM, cache->base);
}
if (hppa_debug)
- fprintf_unfiltered (gdb_stdlog, "base=0x%s }",
- paddr_nz (((struct hppa_frame_cache *)*this_cache)->base));
+ fprintf_unfiltered (gdb_stdlog, "base=%s }",
+ paddress (gdbarch, ((struct hppa_frame_cache *)*this_cache)->base));
return (*this_cache);
}
printf_unfiltered ("unwind_table_entry (0x%lx):\n", (unsigned long)u);
- printf_unfiltered ("\tregion_start = ");
- print_address (u->region_start, gdb_stdout);
+ printf_unfiltered ("\tregion_start = %s\n", hex_string (u->region_start));
gdb_flush (gdb_stdout);
- printf_unfiltered ("\n\tregion_end = ");
- print_address (u->region_end, gdb_stdout);
+ printf_unfiltered ("\tregion_end = %s\n", hex_string (u->region_end));
gdb_flush (gdb_stdout);
#define pif(FLD) if (u->FLD) printf_unfiltered (" "#FLD);
/* Sanity check: are we pointing to the PLT stub? */
if (!hppa_match_insns (pc, hppa_plt_stub, insn))
{
- warning (_("Cannot resolve PLT stub at 0x%s."), paddr_nz (pc));
+ warning (_("Cannot resolve PLT stub at %s."),
+ paddress (gdbarch, pc));
return 0;
}
struct cpms_data
{
+ struct gdbarch *gdbarch;
struct obstack *obstack;
int module_count;
};
/* The first module is the .exe itself. */
if (data->module_count != 0)
- windows_xfer_shared_library (module_name, base_addr, data->obstack);
+ windows_xfer_shared_library (module_name, base_addr,
+ data->gdbarch, data->obstack);
data->module_count++;
out:
struct obstack obstack;
const char *buf;
LONGEST len_avail;
- struct cpms_data data = { &obstack, 0 };
+ struct cpms_data data = { gdbarch, &obstack, 0 };
obstack_init (&obstack);
obstack_grow_str (&obstack, "<library-list>\n");
i386_show_dr (const char *func, CORE_ADDR addr,
int len, enum target_hw_bp_type type)
{
+ int addr_size = gdbarch_addr_bit (target_gdbarch) / 8;
int i;
puts_unfiltered (func);
{
printf_unfiltered ("\
\tDR%d: addr=0x%s, ref.count=%d DR%d: addr=0x%s, ref.count=%d\n",
- i, paddr(dr_mirror[i]), dr_ref_count[i],
- i+1, paddr(dr_mirror[i+1]), dr_ref_count[i+1]);
+ i, phex (dr_mirror[i], addr_size), dr_ref_count[i],
+ i+1, phex (dr_mirror[i+1], addr_size), dr_ref_count[i+1]);
i++;
}
}
if (debug_displaced)
fprintf_unfiltered (gdb_stdlog,
- "displaced: fixup (0x%s, 0x%s), "
+ "displaced: fixup (%s, %s), "
"insn = 0x%02x 0x%02x ...\n",
- paddr_nz (from), paddr_nz (to), insn[0], insn[1]);
+ paddress (gdbarch, from), paddress (gdbarch, to),
+ insn[0], insn[1]);
/* The list of issues to contend with here is taken from
resume_execution in arch/i386/kernel/kprobes.c, Linux 2.6.20.
if (debug_displaced)
fprintf_unfiltered (gdb_stdlog,
"displaced: "
- "relocated %%eip from 0x%s to 0x%s\n",
- paddr_nz (orig_eip), paddr_nz (eip));
+ "relocated %%eip from %s to %s\n",
+ paddress (gdbarch, orig_eip),
+ paddress (gdbarch, eip));
}
}
if (debug_displaced)
fprintf_unfiltered (gdb_stdlog,
- "displaced: relocated return addr at 0x%s "
- "to 0x%s\n",
- paddr_nz (esp),
- paddr_nz (retaddr));
+ "displaced: relocated return addr at %s to %s\n",
+ paddress (gdbarch, esp),
+ paddress (gdbarch, retaddr));
}
}
\f
static int
i386_record_modrm (struct i386_record_s *irp)
{
+ struct gdbarch *gdbarch = get_regcache_arch (irp->regcache);
+
if (target_read_memory (irp->addr, &irp->modrm, 1))
{
if (record_debug)
printf_unfiltered (_("Process record: error reading memory at "
- "addr 0x%s len = 1.\n"),
- paddr_nz (irp->addr));
+ "addr %s len = 1.\n"),
+ paddress (gdbarch, irp->addr));
return -1;
}
irp->addr++;
static int
i386_record_lea_modrm_addr (struct i386_record_s *irp, uint32_t * addr)
{
+ struct gdbarch *gdbarch = get_regcache_arch (irp->regcache);
uint8_t tmpu8;
uint16_t tmpu16;
uint32_t tmpu32;
{
if (record_debug)
printf_unfiltered (_("Process record: error reading memory "
- "at addr 0x%s len = 1.\n"),
- paddr_nz (irp->addr));
+ "at addr %s len = 1.\n"),
+ paddress (gdbarch, irp->addr));
return -1;
}
irp->addr++;
{
if (record_debug)
printf_unfiltered (_("Process record: error reading "
- "memory at addr 0x%s len = 4.\n"),
- paddr_nz (irp->addr));
+ "memory at addr %s len = 4.\n"),
+ paddress (gdbarch, irp->addr));
return -1;
}
irp->addr += 4;
{
if (record_debug)
printf_unfiltered (_("Process record: error reading memory "
- "at addr 0x%s len = 1.\n"),
- paddr_nz (irp->addr));
+ "at addr %s len = 1.\n"),
+ paddress (gdbarch, irp->addr));
return -1;
}
irp->addr++;
{
if (record_debug)
printf_unfiltered (_("Process record: error reading memory "
- "at addr 0x%s len = 4.\n"),
- paddr_nz (irp->addr));
+ "at addr %s len = 4.\n"),
+ paddress (gdbarch, irp->addr));
return -1;
}
irp->addr += 4;
{
if (record_debug)
printf_unfiltered (_("Process record: error reading "
- "memory at addr 0x%s len = 2.\n"),
- paddr_nz (irp->addr));
+ "memory at addr %s len = 2.\n"),
+ paddress (gdbarch, irp->addr));
return -1;
}
irp->addr += 2;
{
if (record_debug)
printf_unfiltered (_("Process record: error reading memory "
- "at addr 0x%s len = 1.\n"),
- paddr_nz (irp->addr));
+ "at addr %s len = 1.\n"),
+ paddress (gdbarch, irp->addr));
return -1;
}
irp->addr++;
{
if (record_debug)
printf_unfiltered (_("Process record: error reading memory "
- "at addr 0x%s len = 2.\n"),
- paddr_nz (irp->addr));
+ "at addr %s len = 2.\n"),
+ paddress (gdbarch, irp->addr));
return -1;
}
irp->addr += 2;
static int
i386_record_lea_modrm (struct i386_record_s *irp)
{
+ struct gdbarch *gdbarch = get_regcache_arch (irp->regcache);
uint32_t addr;
if (irp->override)
{
if (record_debug)
printf_unfiltered (_("Process record ignores the memory change "
- "of instruction at address 0x%s because it "
+ "of instruction at address %s because it "
"can't get the value of the segment register.\n"),
- paddr_nz (irp->addr));
+ paddress (gdbarch, irp->addr));
return 0;
}
if (record_debug > 1)
fprintf_unfiltered (gdb_stdlog, "Process record: i386_process_record "
- "addr = 0x%s\n",
- paddr_nz (ir.addr));
+ "addr = %s\n",
+ paddress (gdbarch, ir.addr));
/* prefixes */
while (1)
{
if (record_debug)
printf_unfiltered (_("Process record: error reading memory at "
- "addr 0x%s len = 1.\n"),
- paddr_nz (ir.addr));
+ "addr %s len = 1.\n"),
+ paddress (gdbarch, ir.addr));
return -1;
}
ir.addr++;
{
if (record_debug)
printf_unfiltered (_("Process record: error reading memory at "
- "addr 0x%s len = 1.\n"),
- paddr_nz (ir.addr));
+ "addr %s len = 1.\n"),
+ paddress (gdbarch, ir.addr));
return -1;
}
ir.addr++;
{
if (record_debug)
printf_unfiltered (_("Process record ignores the memory change "
- "of instruction at address 0x%s because "
+ "of instruction at address %s because "
"it can't get the value of the segment "
"register.\n"),
- paddr_nz (ir.addr));
+ paddress (gdbarch, ir.addr));
}
else
{
{
if (record_debug)
printf_unfiltered (_("Process record: error reading "
- "memory at addr 0x%s len = 4.\n"),
- paddr_nz (ir.addr));
+ "memory at addr %s len = 4.\n"),
+ paddress (gdbarch, ir.addr));
return -1;
}
ir.addr += 4;
{
if (record_debug)
printf_unfiltered (_("Process record: error reading "
- "memory at addr 0x%s len = 4.\n"),
- paddr_nz (ir.addr));
+ "memory at addr %s len = 4.\n"),
+ paddress (gdbarch, ir.addr));
return -1;
}
ir.addr += 2;
/* addr += ((uint32_t)read_register (I386_ES_REGNUM)) << 4; */
if (record_debug)
printf_unfiltered (_("Process record ignores the memory change "
- "of instruction at address 0x%s because "
+ "of instruction at address %s because "
"it can't get the value of the segment "
"register.\n"),
- paddr_nz (ir.addr));
+ paddress (gdbarch, ir.addr));
}
if (prefixes & (PREFIX_REPZ | PREFIX_REPNZ))
{
if (record_debug)
printf_unfiltered (_("Process record: error reading memory "
- "at addr 0x%s len = 1.\n"),
- paddr_nz (ir.addr));
+ "at addr %s len = 1.\n"),
+ paddress (gdbarch, ir.addr));
return -1;
}
ir.addr++;
if (record_debug)
printf_unfiltered (_("Process record ignores the memory "
"change of instruction at "
- "address 0x%s because it can't get "
+ "address %s because it can't get "
"the value of the segment "
"register.\n"),
- paddr_nz (ir.addr));
+ paddress (gdbarch, ir.addr));
}
else
{
if (record_debug)
printf_unfiltered (_("Process record ignores the memory "
"change of instruction at "
- "address 0x%s because it can't get "
+ "address %s because it can't get "
"the value of the segment "
"register.\n"),
- paddr_nz (ir.addr));
+ paddress (gdbarch, ir.addr));
}
else
{
no_support:
printf_unfiltered (_("Process record doesn't support instruction 0x%02x "
- "at address 0x%s.\n"),
- (unsigned int) (opcode), paddr_nz (ir.addr));
+ "at address %s.\n"),
+ (unsigned int) (opcode), paddress (gdbarch, ir.addr));
return -1;
}
if (instr_breakpoint == IA64_BREAKPOINT)
internal_error (__FILE__, __LINE__,
_("Address %s already contains a breakpoint."),
- paddr_nz (bp_tgt->placed_address));
+ paddress (gdbarch, bp_tgt->placed_address));
replace_slotN_contents (bundle, IA64_BREAKPOINT, slotnum);
if (val == 0)
{
warning (_("Cannot remove breakpoint at address %s, "
"no break instruction at such address."),
- paddr_nz (bp_tgt->placed_address));
+ paddress (gdbarch, bp_tgt->placed_address));
return -1;
}
ia64_frame_this_id (struct frame_info *this_frame, void **this_cache,
struct frame_id *this_id)
{
+ struct gdbarch *gdbarch = get_frame_arch (this_frame);
struct ia64_frame_cache *cache =
ia64_frame_cache (this_frame, this_cache);
(*this_id) = frame_id_build_special (cache->base, cache->pc, cache->bsp);
if (gdbarch_debug >= 1)
fprintf_unfiltered (gdb_stdlog,
- "regular frame id: code 0x%s, stack 0x%s, special 0x%s, this_frame %s\n",
- paddr_nz (this_id->code_addr),
- paddr_nz (this_id->stack_addr),
- paddr_nz (cache->bsp),
+ "regular frame id: code %s, stack %s, special %s, this_frame %s\n",
+ paddress (gdbarch, this_id->code_addr),
+ paddress (gdbarch, this_id->stack_addr),
+ paddress (gdbarch, cache->bsp),
host_address_to_string (this_frame));
}
ia64_sigtramp_frame_this_id (struct frame_info *this_frame,
void **this_cache, struct frame_id *this_id)
{
+ struct gdbarch *gdbarch = get_frame_arch (this_frame);
struct ia64_frame_cache *cache =
ia64_sigtramp_frame_cache (this_frame, this_cache);
cache->bsp);
if (gdbarch_debug >= 1)
fprintf_unfiltered (gdb_stdlog,
- "sigtramp frame id: code 0x%s, stack 0x%s, special 0x%s, this_frame %s\n",
- paddr_nz (this_id->code_addr),
- paddr_nz (this_id->stack_addr),
- paddr_nz (cache->bsp),
+ "sigtramp frame id: code %s, stack %s, special %s, this_frame %s\n",
+ paddress (gdbarch, this_id->code_addr),
+ paddress (gdbarch, this_id->stack_addr),
+ paddress (gdbarch, cache->bsp),
host_address_to_string (this_frame));
}
int regnum = ia64_uw2gdb_regnum (uw_regnum);
unw_word_t bsp, sof, sol, cfm, psr, ip;
struct frame_info *this_frame = arg;
+ struct gdbarch *gdbarch = get_frame_arch (this_frame);
long new_sof, old_sof;
char buf[MAX_REGISTER_SIZE];
if (gdbarch_debug >= 1)
fprintf_unfiltered (gdb_stdlog,
- " access_reg: from cache: %4s=0x%s\n",
+ " access_reg: from cache: %4s=%s\n",
(((unsigned) regnum <= IA64_NAT127_REGNUM)
? ia64_register_names[regnum] : "r??"),
- paddr_nz (*val));
+ paddress (*val));
return 0;
}
int regnum = ia64_uw2gdb_regnum (uw_regnum);
unw_word_t bsp, sof, sol, cfm, psr, ip;
struct regcache *regcache = arg;
+ struct gdbarch *gdbarch = get_regcache_arch (regcache);
long new_sof, old_sof;
char buf[MAX_REGISTER_SIZE];
if (gdbarch_debug >= 1)
fprintf_unfiltered (gdb_stdlog,
- " access_rse_reg: from cache: %4s=0x%s\n",
+ " access_rse_reg: from cache: %4s=%s\n",
(((unsigned) regnum <= IA64_NAT127_REGNUM)
? ia64_register_names[regnum] : "r??"),
- paddr_nz (*val));
+ paddress (gdbarch, *val));
return 0;
}
if (gdbarch_debug >= 1)
fprintf_unfiltered (gdb_stdlog, "get_kernel_table: found table `%s': "
- "segbase=0x%s, length=%s, gp=0x%s\n",
+ "segbase=%s, length=%s, gp=%s\n",
(char *) di->u.ti.name_ptr,
- paddr_nz (di->u.ti.segbase),
+ hex_string (di->u.ti.segbase),
pulongest (di->u.ti.table_len),
- paddr_nz (di->gp));
+ hex_string (di->gp));
return 0;
}
return -UNW_ENOINFO;
if (gdbarch_debug >= 1)
- fprintf_unfiltered (gdb_stdlog, "ia64_find_proc_info_x: 0x%s -> "
- "(name=`%s',segbase=0x%s,start=0x%s,end=0x%s,gp=0x%s,"
- "length=%s,data=0x%s)\n",
- paddr_nz (ip), (char *)di.u.ti.name_ptr,
- paddr_nz (di.u.ti.segbase),
- paddr_nz (di.start_ip), paddr_nz (di.end_ip),
- paddr_nz (di.gp),
+ fprintf_unfiltered (gdb_stdlog, "ia64_find_proc_info_x: %s -> "
+ "(name=`%s',segbase=%s,start=%s,end=%s,gp=%s,"
+ "length=%s,data=%s)\n",
+ hex_string (ip), (char *)di.u.ti.name_ptr,
+ hex_string (di.u.ti.segbase),
+ hex_string (di.start_ip), hex_string (di.end_ip),
+ hex_string (di.gp),
pulongest (di.u.ti.table_len),
- paddr_nz ((CORE_ADDR)di.u.ti.table_data));
+ hex_string ((CORE_ADDR)di.u.ti.table_data));
}
else
{
return ret;
if (gdbarch_debug >= 1)
- fprintf_unfiltered (gdb_stdlog, "ia64_find_proc_info_x: 0x%s -> "
- "(name=`%s',segbase=0x%s,start=0x%s,end=0x%s,gp=0x%s,"
- "length=%s,data=0x%s)\n",
- paddr_nz (ip), (char *)di.u.rti.name_ptr,
- paddr_nz (di.u.rti.segbase),
- paddr_nz (di.start_ip), paddr_nz (di.end_ip),
- paddr_nz (di.gp),
+ fprintf_unfiltered (gdb_stdlog, "ia64_find_proc_info_x: %s -> "
+ "(name=`%s',segbase=%s,start=%s,end=%s,gp=%s,"
+ "length=%s,data=%s)\n",
+ hex_string (ip), (char *)di.u.rti.name_ptr,
+ hex_string (di.u.rti.segbase),
+ hex_string (di.start_ip), hex_string (di.end_ip),
+ hex_string (di.gp),
pulongest (di.u.rti.table_len),
- paddr_nz (di.u.rti.table_data));
+ hex_string (di.u.rti.table_data));
}
ret = libunwind_search_unwind_table (&as, ip, &di, pi, need_unwind_info,
if (gdbarch_debug >= 1)
fprintf_unfiltered (gdb_stdlog,
"dynamic unwind table in objfile %s "
- "at 0x%s (gp=0x%s)\n",
+ "at %s (gp=%s)\n",
bfd_get_filename (objfile->obfd),
- paddr_nz (addr), paddr_nz (di.gp));
+ hex_string (addr), hex_string (di.gp));
*dilap = addr;
return 0;
}
ia64_libunwind_frame_this_id (struct frame_info *this_frame, void **this_cache,
struct frame_id *this_id)
{
+ struct gdbarch *gdbarch = get_frame_arch (this_frame);
struct frame_id id;
char buf[8];
CORE_ADDR bsp;
if (gdbarch_debug >= 1)
fprintf_unfiltered (gdb_stdlog,
- "libunwind frame id: code 0x%s, stack 0x%s, special 0x%s, this_frame %s\n",
- paddr_nz (id.code_addr), paddr_nz (id.stack_addr),
- paddr_nz (bsp),
+ "libunwind frame id: code %s, stack %s, special %s, this_frame %s\n",
+ paddress (gdbarch, id.code_addr),
+ paddress (gdbarch, id.stack_addr),
+ paddress (gdbarch, bsp),
host_address_to_string (this_frame));
}
void **this_cache,
struct frame_id *this_id)
{
+ struct gdbarch *gdbarch = get_frame_arch (this_frame);
char buf[8];
CORE_ADDR bsp;
struct frame_id id;
if (gdbarch_debug >= 1)
fprintf_unfiltered (gdb_stdlog,
- "libunwind sigtramp frame id: code 0x%s, stack 0x%s, special 0x%s, this_frame %s\n",
- paddr_nz (id.code_addr), paddr_nz (id.stack_addr),
- paddr_nz (bsp),
+ "libunwind sigtramp frame id: code %s, stack %s, special %s, this_frame %s\n",
+ paddress (gdbarch, id.code_addr),
+ paddress (gdbarch, id.stack_addr),
+ paddress (gdbarch, bsp),
host_address_to_string (this_frame));
}
if (gdbarch_debug >= 1)
fprintf_unfiltered (gdb_stdlog,
- "dummy frame id: code 0x%s, stack 0x%s, special 0x%s\n",
- paddr_nz (get_frame_pc (this_frame)),
- paddr_nz (sp), paddr_nz (bsp));
+ "dummy frame id: code %s, stack %s, special %s\n",
+ paddress (gdbarch, get_frame_pc (this_frame)),
+ paddress (gdbarch, sp), paddress (gdbarch, bsp));
return frame_id_build_special (sp, get_frame_pc (this_frame), bsp);
}
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+#include "arch-utils.h"
#include <signal.h>
#include "gdb_string.h"
#include "symtab.h"
static void
jump_command (char *arg, int from_tty)
{
+ struct gdbarch *gdbarch = get_current_arch ();
CORE_ADDR addr;
struct symtabs_and_lines sals;
struct symtab_and_line sal;
if (from_tty)
{
printf_filtered (_("Continuing at "));
- fputs_filtered (paddress (addr), gdb_stdout);
+ fputs_filtered (paddress (gdbarch, addr), gdb_stdout);
printf_filtered (".\n");
}
stat = bpstat_num (&bs, &num);
target_files_info ();
- printf_filtered (_("Program stopped at %s.\n"), paddress (stop_pc));
+ printf_filtered (_("Program stopped at %s.\n"),
+ paddress (target_gdbarch, stop_pc));
if (tp->stop_step)
printf_filtered (_("It stopped after being stepped.\n"));
else if (stat != 0)
read_memory (copy, displaced_step_saved_copy, len);
if (debug_displaced)
{
- fprintf_unfiltered (gdb_stdlog, "displaced: saved 0x%s: ",
- paddr_nz (copy));
+ fprintf_unfiltered (gdb_stdlog, "displaced: saved %s: ",
+ paddress (gdbarch, copy));
displaced_step_dump_bytes (gdb_stdlog, displaced_step_saved_copy, len);
};
do_cleanups (old_cleanups);
if (debug_displaced)
- fprintf_unfiltered (gdb_stdlog, "displaced: displaced pc to 0x%s\n",
- paddr_nz (copy));
+ fprintf_unfiltered (gdb_stdlog, "displaced: displaced pc to %s\n",
+ paddress (gdbarch, copy));
return 1;
}
write_memory_ptid (displaced_step_ptid, displaced_step_copy,
displaced_step_saved_copy, len);
if (debug_displaced)
- fprintf_unfiltered (gdb_stdlog, "displaced: restored 0x%s\n",
- paddr_nz (displaced_step_copy));
+ fprintf_unfiltered (gdb_stdlog, "displaced: restored %s\n",
+ paddress (displaced_step_gdbarch,
+ displaced_step_copy));
}
/* Did the instruction complete successfully? */
{
struct displaced_step_request *head;
ptid_t ptid;
+ struct regcache *regcache;
CORE_ADDR actual_pc;
head = displaced_step_request_queue;
context_switch (ptid);
- actual_pc = regcache_read_pc (get_thread_regcache (ptid));
+ regcache = get_thread_regcache (ptid);
+ actual_pc = regcache_read_pc (regcache);
if (breakpoint_here_p (actual_pc))
{
if (debug_displaced)
{
+ struct gdbarch *gdbarch = get_regcache_arch (regcache);
gdb_byte buf[4];
- fprintf_unfiltered (gdb_stdlog, "displaced: run 0x%s: ",
- paddr_nz (actual_pc));
+ fprintf_unfiltered (gdb_stdlog, "displaced: run %s: ",
+ paddress (gdbarch, actual_pc));
read_memory (actual_pc, buf, sizeof (buf));
displaced_step_dump_bytes (gdb_stdlog, buf, sizeof (buf));
}
&& tp->trap_expected)
{
struct regcache *resume_regcache = get_thread_regcache (resume_ptid);
+ struct gdbarch *resume_gdbarch = get_regcache_arch (resume_regcache);
CORE_ADDR actual_pc = regcache_read_pc (resume_regcache);
gdb_byte buf[4];
- fprintf_unfiltered (gdb_stdlog, "displaced: run 0x%s: ",
- paddr_nz (actual_pc));
+ fprintf_unfiltered (gdb_stdlog, "displaced: run %s: ",
+ paddress (resume_gdbarch, actual_pc));
read_memory (actual_pc, buf, sizeof (buf));
displaced_step_dump_bytes (gdb_stdlog, buf, sizeof (buf));
}
if (debug_infrun)
fprintf_unfiltered (gdb_stdlog,
- "infrun: proceed (addr=0x%s, signal=%d, step=%d)\n",
- paddr_nz (addr), siggnal, step);
+ "infrun: proceed (addr=%s, signal=%d, step=%d)\n",
+ paddress (gdbarch, addr), siggnal, step);
if (non_stop)
/* In non-stop, each thread is handled individually. The context
if (debug_infrun)
{
- fprintf_unfiltered (gdb_stdlog, "infrun: stop_pc = 0x%s\n",
- paddr_nz (stop_pc));
+ struct regcache *regcache = get_thread_regcache (ecs->ptid);
+ struct gdbarch *gdbarch = get_regcache_arch (regcache);
+
+ fprintf_unfiltered (gdb_stdlog, "infrun: stop_pc = %s\n",
+ paddress (gdbarch, stop_pc));
if (target_stopped_by_watchpoint ())
{
CORE_ADDR addr;
if (target_stopped_data_address (¤t_target, &addr))
fprintf_unfiltered (gdb_stdlog,
- "infrun: stopped data address = 0x%s\n",
- paddr_nz (addr));
+ "infrun: stopped data address = %s\n",
+ paddress (gdbarch, addr));
else
fprintf_unfiltered (gdb_stdlog,
"infrun: (no data address available)\n");
ecs->event_thread->step_frame_id)))
{
if (debug_infrun)
- fprintf_unfiltered (gdb_stdlog, "infrun: stepping inside range [0x%s-0x%s]\n",
- paddr_nz (ecs->event_thread->step_range_start),
- paddr_nz (ecs->event_thread->step_range_end));
+ fprintf_unfiltered
+ (gdb_stdlog, "infrun: stepping inside range [%s-%s]\n",
+ paddress (gdbarch, ecs->event_thread->step_range_start),
+ paddress (gdbarch, ecs->event_thread->step_range_end));
/* When stepping backward, stop at beginning of line range
(unless it's the function entry point, in which case
if (debug_infrun)
fprintf_unfiltered (gdb_stdlog,
- "infrun: inserting step-resume breakpoint at 0x%s\n",
- paddr_nz (sr_sal.pc));
+ "infrun: inserting step-resume breakpoint at %s\n",
+ paddress (gdbarch, sr_sal.pc));
inferior_thread ()->step_resume_breakpoint
= set_momentary_breakpoint (gdbarch, sr_sal, sr_id, bp_step_resume);
if (debug_infrun)
fprintf_unfiltered (gdb_stdlog,
- "infrun: inserting longjmp-resume breakpoint at 0x%s\n",
- paddr_nz (pc));
+ "infrun: inserting longjmp-resume breakpoint at %s\n",
+ paddress (gdbarch, pc));
inferior_thread ()->step_resume_breakpoint =
set_momentary_breakpoint_at_pc (gdbarch, pc, bp_longjmp_resume);
if (element == 0)
fprintf_filtered (stream, "null");
else
- fprintf_filtered (stream, "@%s", paddr_nz (element));
+ fprintf_filtered (stream, "@%s", paddress (gdbarch, element));
things_printed++;
i += reps;
struct ui_file *stream, int recurse,
const struct value_print_options *options)
{
+ struct gdbarch *gdbarch = get_type_arch (type);
unsigned int i = 0; /* Number of characters printed */
struct type *target_type;
CORE_ADDR addr;
/* Print vtable entry - we only get here if we ARE using
-fvtable_thunks. (Otherwise, look under TYPE_CODE_STRUCT.) */
/* Extract an address, assume that it is unsigned. */
- print_address_demangle (extract_unsigned_integer (valaddr, TYPE_LENGTH (type)),
+ print_address_demangle (gdbarch,
+ extract_unsigned_integer (valaddr, TYPE_LENGTH (type)),
stream, demangle);
break;
}
if (TYPE_CODE (target_type) == TYPE_CODE_FUNC)
{
/* Try to print what function it points to. */
- print_address_demangle (addr, stream, demangle);
+ print_address_demangle (gdbarch, addr, stream, demangle);
/* Return value is irrelevant except for string pointers. */
return (0);
}
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+#include "arch-utils.h"
#include "inferior.h"
#include "regcache.h"
#include "gdbcmd.h"
static void
info_forks_command (char *arg, int from_tty)
{
+ struct gdbarch *gdbarch = get_current_arch ();
struct frame_info *cur_frame;
struct symtab_and_line sal;
struct symtab *cur_symtab;
if (fp->num == 0)
printf_filtered (_(" (main process)"));
printf_filtered (_(" at "));
- fputs_filtered (paddress (pc), gdb_stdout);
+ fputs_filtered (paddress (gdbarch, pc), gdb_stdout);
sal = find_pc_line (pc, 0);
if (sal.symtab)
if (info_verbose)
{
fprintf_filtered (gdb_stdout,
- "Save segment, %lld bytes at 0x%s (%c%c%c)",
- size, paddr_nz (addr),
+ "Save segment, %lld bytes at %s (%c%c%c)",
+ size, paddress (target_gdbarch, addr),
read ? 'r' : ' ',
write ? 'w' : ' ', exec ? 'x' : ' ');
if (filename[0])
record_linux_system_call (int num, struct regcache *regcache,
struct linux_record_tdep *tdep)
{
+ struct gdbarch *gdbarch = get_regcache_arch (regcache);
uint32_t tmpu32;
switch (num)
if (record_debug)
fprintf_unfiltered (gdb_stdlog,
"Process record: error reading memory "
- "at addr = 0x%s len = %lu.\n",
- paddr_nz (tmpu32),
+ "at addr = %s len = %lu.\n",
+ paddress (gdbarch, tmpu32),
(unsigned long)sizeof (sel));
return -1;
}
target_terminal_ours ();
q =
yquery (_("The next instruction is syscall munmap. "
- "It will free the memory addr = 0x%s len = %u. "
+ "It will free the memory addr = %s len = %u. "
"It will make record target get error. "
"Do you want to stop the program?"),
- paddr_nz (tmpu32), (int)len);
+ paddress (gdbarch, tmpu32), (int)len);
target_terminal_inferior ();
if (q)
return 1;
if (record_debug)
fprintf_unfiltered (gdb_stdlog,
"Process record: error reading "
- "memory at addr = 0x%s len = %lu.\n",
- paddr_nz (tmpu32),
+ "memory at addr = %s len = %lu.\n",
+ paddress (gdbarch, tmpu32),
(unsigned long)sizeof (a));
return -1;
}
if (record_debug)
fprintf_unfiltered (gdb_stdlog,
"Process record: error reading "
- "memory at addr = 0x%s len = %lu.\n",
- paddr_nz (tmpu32),
+ "memory at addr = %s len = %lu.\n",
+ paddress (gdbarch, tmpu32),
(unsigned long)sizeof (a));
return -1;
}
if (record_debug)
fprintf_unfiltered (gdb_stdlog,
"Process record: error reading "
- "memory at addr = 0x%s len = %lu.\n",
- paddr_nz (tmpu32),
+ "memory at addr = %s len = %lu.\n",
+ paddress (gdbarch, tmpu32),
(unsigned long)sizeof (a));
return -1;
}
if (record_debug)
fprintf_unfiltered (gdb_stdlog,
"Process record: error reading "
- "memory at addr = 0x%s "
+ "memory at addr = %s "
"len = %lu.\n",
- paddr_nz (a[2]),
+ paddress (gdbarch, a[2]),
(unsigned long)sizeof (a[2]));
return -1;
}
if (record_debug)
fprintf_unfiltered (gdb_stdlog,
"Process record: error reading "
- "memory at addr = 0x%s len = %lu.\n",
- paddr_nz (tmpu32),
+ "memory at addr = %s len = %lu.\n",
+ paddress (gdbarch, tmpu32),
(unsigned long)sizeof (a));
return -1;
}
if (record_debug)
fprintf_unfiltered (gdb_stdlog,
"Process record: error reading "
- "memory at addr = 0x%s "
+ "memory at addr = %s "
"len = %lu.\n",
- paddr_nz (a[2]),
+ paddress (gdbarch, a[2]),
(unsigned long)sizeof (a[2]));
return -1;
}
if (record_debug)
fprintf_unfiltered (gdb_stdlog,
"Process record: error reading "
- "memory at addr = 0x%s len = %lu.\n",
- paddr_nz (tmpu32),
+ "memory at addr = %s len = %lu.\n",
+ paddress (gdbarch, tmpu32),
(unsigned long)sizeof (a));
return -1;
}
if (record_debug)
fprintf_unfiltered (gdb_stdlog,
"Process record: error reading "
- "memory at addr = 0x%s "
+ "memory at addr = %s "
"len = %lu.\n",
- paddr_nz (a[4]),
+ paddress (gdbarch, a[4]),
(unsigned long)sizeof (av));
return -1;
}
if (record_debug)
fprintf_unfiltered (gdb_stdlog,
"Process record: error reading "
- "memory at addr = 0x%s len = %lu.\n",
- paddr_nz (tmpu32),
+ "memory at addr = %s len = %lu.\n",
+ paddress (gdbarch, tmpu32),
(unsigned long)sizeof (a));
return -1;
}
if (record_debug)
fprintf_unfiltered (gdb_stdlog,
"Process record: error reading "
- "memory at addr = 0x%s "
+ "memory at addr = %s "
"len = %lu.\n",
- paddr_nz (a[1]),
+ paddress (gdbarch, a[1]),
(unsigned long)sizeof (rec));
return -1;
}
fprintf_unfiltered (gdb_stdlog,
"Process record: error "
"reading memory at "
- "addr = 0x%s "
+ "addr = %s "
"len = %lu.\n",
- paddr_nz (rec.
- msg_iov),
+ paddress (gdbarch,
+ rec.msg_iov),
(unsigned long)sizeof (iov));
return -1;
}
if (record_debug)
fprintf_unfiltered (gdb_stdlog,
"Process record: error reading "
- "memory at addr = 0x%s len = %lu.\n",
- paddr_nz (vec),
+ "memory at addr = %s len = %lu.\n",
+ paddress (gdbarch, vec),
(unsigned long)sizeof (struct record_iovec));
return -1;
}
if (record_debug)
fprintf_unfiltered (gdb_stdlog,
"Process record: error reading memory "
- "at addr = 0x%s len = %u.\n",
- paddr_nz (tmpu32),
+ "at addr = %s len = %u.\n",
+ paddress (gdbarch, tmpu32),
(int)(nr * tdep->size_int));
return -1;
}
if (addressprint && func_addr != address)
{
fputs_filtered ("@", stream);
- fputs_filtered (paddress (address), stream);
+ fputs_filtered (paddress (gdbarch, address), stream);
fputs_filtered (": ", stream);
}
- print_address_demangle (func_addr, stream, demangle);
+ print_address_demangle (gdbarch, func_addr, stream, demangle);
}
/* get_long_set_bounds - assigns the bounds of the long set to low and
}
if (options->addressprint && options->format != 's')
- fputs_filtered (paddress (address), stream);
+ fputs_filtered (paddress (gdbarch, address), stream);
/* For a pointer to char or unsigned char, also print the string
pointed to, unless pointer is null. */
int recurse,
const struct value_print_options *options)
{
+ struct gdbarch *gdbarch = get_type_arch (type);
CORE_ADDR addr = unpack_pointer (type, valaddr);
struct type *elttype = check_typedef (TYPE_TARGET_TYPE (type));
fprintf_filtered (stream, "[");
- fputs_filtered (paddress (addr), stream);
+ fputs_filtered (paddress (gdbarch, addr), stream);
fprintf_filtered (stream, "] : ");
if (TYPE_CODE (elttype) != TYPE_CODE_UNDEF)
CORE_ADDR address, struct ui_file *stream, int recurse,
const struct value_print_options *options)
{
+ struct gdbarch *gdbarch = get_type_arch (type);
unsigned int i = 0; /* Number of characters printed */
unsigned len;
struct type *elttype;
CORE_ADDR addr
= extract_typed_address (valaddr + embedded_offset, type);
fprintf_filtered (stream, "@");
- fputs_filtered (paddress (addr), stream);
+ fputs_filtered (paddress (gdbarch, addr), stream);
if (options->deref_ref)
fputs_filtered (": ", stream);
}
type_print (type, "", stream, -1);
fprintf_filtered (stream, "} ");
/* Try to print what function it points to, and its address. */
- print_address_demangle (address, stream, demangle);
+ print_address_demangle (gdbarch, address, stream, demangle);
break;
case TYPE_CODE_BOOL:
if (! func_msym)
error ("Cannot convert code address %s to function pointer:\n"
"couldn't find a symbol at that address, to find trampoline.",
- paddr_nz (addr));
+ paddress (gdbarch, addr));
func_name = SYMBOL_LINKAGE_NAME (func_msym);
tramp_name = xmalloc (strlen (func_name) + 5);
if (! tramp_msym)
error ("Cannot convert code address %s to function pointer:\n"
"couldn't find trampoline named '%s.plt'.",
- paddr_nz (addr), func_name);
+ paddress (gdbarch, addr), func_name);
/* The trampoline's address is our pointer. */
addr = SYMBOL_VALUE_ADDRESS (tramp_msym);
unsigned int *data_count = obj;
if (s->flags & SEC_LOAD)
{
+ int addr_size = gdbarch_addr_bit (target_gdbarch) / 8;
bfd_size_type section_size = bfd_section_size (abfd, s);
bfd_vma section_base = bfd_section_lma (abfd, s);
unsigned int buffer, i;
printf_filtered ("Loading section %s, size 0x%lx lma ",
bfd_section_name (abfd, s),
(unsigned long) section_size);
- fputs_filtered (paddress (section_base), gdb_stdout);
+ fputs_filtered (paddress (target_gdbarch, section_base), gdb_stdout);
printf_filtered ("\n");
gdb_flush (gdb_stdout);
- monitor_printf ("%s mw\r", paddr_nz (section_base));
+ monitor_printf ("%s mw\r", phex_nz (section_base, addr_size));
for (i = 0; i < section_size; i += 4)
{
QUIT;
printf_filtered ("Loading section %s, size 0x%lx vma ",
bfd_section_name (abfd, s), section_size);
- fputs_filtered (paddress (section_base), gdb_stdout);
+ fputs_filtered (paddress (target_gdbarch, section_base), gdb_stdout);
printf_filtered ("\n");
gdb_flush (gdb_stdout);
monitor_printf ("%x mw\r", section_base);
printf_filtered ("Loading section %s, size 0x%lx lma ",
bfd_section_name (abfd, s),
(unsigned long) section_size);
- fputs_filtered (paddress (section_base), gdb_stdout);
+ fputs_filtered (paddress (target_gdbarch, section_base),
+ gdb_stdout);
printf_filtered ("\n");
gdb_flush (gdb_stdout);
}
static void
maint_print_section_info (const char *name, flagword flags,
CORE_ADDR addr, CORE_ADDR endaddr,
- unsigned long filepos)
+ unsigned long filepos, int addr_size)
{
- /* FIXME-32x64: Need paddress with field width. */
- printf_filtered (" 0x%s", paddr (addr));
- printf_filtered ("->0x%s", paddr (endaddr));
+ printf_filtered (" %s", hex_string_custom (addr, addr_size));
+ printf_filtered ("->%s", hex_string_custom (endaddr, addr_size));
printf_filtered (" at %s",
hex_string_custom ((unsigned long) filepos, 8));
printf_filtered (": %s", name);
|| match_substring ((char *) arg, name)
|| match_bfd_flags ((char *) arg, flags))
{
+ struct gdbarch *gdbarch = gdbarch_from_bfd (abfd);
+ int addr_size = gdbarch_addr_bit (gdbarch) / 8;
CORE_ADDR addr, endaddr;
addr = bfd_section_vma (abfd, asect);
endaddr = addr + bfd_section_size (abfd, asect);
- maint_print_section_info (name, flags, addr, endaddr, asect->filepos);
+ maint_print_section_info (name, flags, addr, endaddr,
+ asect->filepos, addr_size);
}
}
|| match_substring (string, name)
|| match_bfd_flags (string, flags))
{
+ struct gdbarch *gdbarch = gdbarch_from_bfd (abfd);
+ int addr_size = gdbarch_addr_bit (gdbarch) / 8;
maint_print_section_info (name, flags,
obj_section_addr (asect),
obj_section_endaddr (asect),
- asect->the_bfd_section->filepos);
+ asect->the_bfd_section->filepos,
+ addr_size);
}
}
printf_filtered (_("%s + %s\n"), symbol_name, symbol_offset);
}
else if (sect)
- printf_filtered (_("no symbol at %s:0x%s\n"),
- sect->the_bfd_section->name, paddr (address));
+ printf_filtered (_("no symbol at %s:%s\n"),
+ sect->the_bfd_section->name, hex_string (address));
else
- printf_filtered (_("no symbol at 0x%s\n"), paddr (address));
+ printf_filtered (_("no symbol at %s\n"), hex_string (address));
return;
}
if (varobjdebug)
fprintf_unfiltered (gdb_stdlog,
- "Name=\"%s\", Frame=\"%s\" (0x%s), Expression=\"%s\"\n",
- name, frame, paddr (frameaddr), expr);
+ "Name=\"%s\", Frame=\"%s\" (%s), Expression=\"%s\"\n",
+ name, frame, hex_string (frameaddr), expr);
var = varobj_create (name, expr, frameaddr, var_type);
error ("Unable to read memory.");
/* Output the header information. */
- ui_out_field_core_addr (uiout, "addr", addr);
+ ui_out_field_core_addr (uiout, "addr", gdbarch, addr);
ui_out_field_int (uiout, "nr-bytes", nr_bytes);
ui_out_field_int (uiout, "total-bytes", total_bytes);
- ui_out_field_core_addr (uiout, "next-row", addr + word_size * nr_cols);
- ui_out_field_core_addr (uiout, "prev-row", addr - word_size * nr_cols);
- ui_out_field_core_addr (uiout, "next-page", addr + total_bytes);
- ui_out_field_core_addr (uiout, "prev-page", addr - total_bytes);
+ ui_out_field_core_addr (uiout, "next-row",
+ gdbarch, addr + word_size * nr_cols);
+ ui_out_field_core_addr (uiout, "prev-row",
+ gdbarch, addr - word_size * nr_cols);
+ ui_out_field_core_addr (uiout, "next-page", gdbarch, addr + total_bytes);
+ ui_out_field_core_addr (uiout, "prev-page", gdbarch, addr - total_bytes);
/* Build the result as a two dimentional table. */
{
struct value_print_options opts;
cleanup_tuple = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
- ui_out_field_core_addr (uiout, "addr", addr + row_byte);
+ ui_out_field_core_addr (uiout, "addr", gdbarch, addr + row_byte);
/* ui_out_field_core_addr_symbolic (uiout, "saddr", addr + row_byte); */
cleanup_list_data = make_cleanup_ui_out_list_begin_end (uiout, "data");
get_formatted_print_options (&opts, word_format);
#include "defs.h"
#include "mi-cmds.h"
#include "symtab.h"
+#include "objfiles.h"
#include "ui-out.h"
/* SYMBOL-LIST-LINES:
void
mi_cmd_symbol_list_lines (char *command, char **argv, int argc)
{
+ struct gdbarch *gdbarch;
char *filename;
struct symtab *s;
int i;
sorted by increasing values in the symbol table, so no need to
perform any other sorting. */
+ gdbarch = get_objfile_arch (s->objfile);
cleanup_stack = make_cleanup_ui_out_list_begin_end (uiout, "lines");
if (LINETABLE (s) != NULL && LINETABLE (s)->nitems > 0)
for (i = 0; i < LINETABLE (s)->nitems; i++)
{
cleanup_tuple = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
- ui_out_field_core_addr (uiout, "pc", LINETABLE (s)->item[i].pc);
+ ui_out_field_core_addr (uiout, "pc", gdbarch, LINETABLE (s)->item[i].pc);
ui_out_field_int (uiout, "line", LINETABLE (s)->item[i].line);
do_cleanups (cleanup_tuple);
}
puts_unfiltered (func);
if (addr || len)
- printf_unfiltered (" (addr=0x%s, len=%d, type=%s)", paddr (addr), len,
+ printf_unfiltered (" (addr=%s, len=%d, type=%s)",
+ paddress (target_gdbarch, addr), len,
type == hw_write ? "data-write"
: (type == hw_read ? "data-read"
: (type == hw_access ? "data-read/write"
puts_unfiltered (":\n");
for (i = 0; i < MAX_DEBUG_REGISTER; i++)
- printf_unfiltered ("\tDR%d: lo=0x%s, hi=0x%s\n",
- i, paddr (get_watchlo (&watch_mirror, i)),
- paddr (get_watchhi (&watch_mirror, i)));
+ printf_unfiltered ("\tDR%d: lo=%s, hi=%s\n", i,
+ paddress (target_gdbarch,
+ get_watchlo (&watch_mirror, i)),
+ paddress (target_gdbarch,
+ get_watchhi (&watch_mirror, i)));
}
/* Return 1 if watch registers are usable. Cached information is used
{
static int blurb_printed = 0;
- warning (_("GDB can't find the start of the function at 0x%s."),
- paddr_nz (pc));
+ warning (_("GDB can't find the start of the function at %s."),
+ paddress (gdbarch, pc));
if (!blurb_printed)
{
in that situation enough information to
determine that it's no big deal. */
printf_filtered ("\n\
- GDB is unable to find the start of the function at 0x%s\n\
+ GDB is unable to find the start of the function at %s\n\
and thus can't determine the size of that function's stack frame.\n\
This means that GDB may be unable to access that stack frame, or\n\
the frames below it.\n\
This problem is most likely caused by an invalid program counter or\n\
stack pointer.\n\
However, if you think GDB should simply search farther back\n\
-from 0x%s for code which looks like the beginning of a\n\
+from %s for code which looks like the beginning of a\n\
function, you can increase the range of the search using the `set\n\
-heuristic-fence-post' command.\n", paddr_nz (pc), paddr_nz (pc));
+heuristic-fence-post' command.\n",
+ paddress (gdbarch, pc), paddress (gdbarch, pc));
blurb_printed = 1;
}
}
if (mips_debug)
fprintf_unfiltered (gdb_stdlog,
- "mips_eabi_push_dummy_call: sp=0x%s allocated %ld\n",
- paddr_nz (sp), (long) align_up (len, 16));
+ "mips_eabi_push_dummy_call: sp=%s allocated %ld\n",
+ paddress (gdbarch, sp), (long) align_up (len, 16));
/* Initialize the integer and float register pointers. */
argreg = MIPS_A0_REGNUM;
{
if (mips_debug)
fprintf_unfiltered (gdb_stdlog,
- "mips_eabi_push_dummy_call: struct_return reg=%d 0x%s\n",
- argreg, paddr_nz (struct_addr));
+ "mips_eabi_push_dummy_call: struct_return reg=%d %s\n",
+ argreg, paddress (gdbarch, struct_addr));
regcache_cooked_write_unsigned (regcache, argreg++, struct_addr);
}
if (mips_debug)
{
- fprintf_unfiltered (gdb_stdlog, " - stack_offset=0x%s",
- paddr_nz (stack_offset));
- fprintf_unfiltered (gdb_stdlog, " longword_offset=0x%s",
- paddr_nz (longword_offset));
+ fprintf_unfiltered (gdb_stdlog, " - stack_offset=%s",
+ paddress (gdbarch, stack_offset));
+ fprintf_unfiltered (gdb_stdlog, " longword_offset=%s",
+ paddress (gdbarch, longword_offset));
}
addr = sp + stack_offset + longword_offset;
if (mips_debug)
{
int i;
- fprintf_unfiltered (gdb_stdlog, " @0x%s ",
- paddr_nz (addr));
+ fprintf_unfiltered (gdb_stdlog, " @%s ",
+ paddress (gdbarch, addr));
for (i = 0; i < partial_len; i++)
{
fprintf_unfiltered (gdb_stdlog, "%02x",
if (mips_debug)
fprintf_unfiltered (gdb_stdlog,
- "mips_n32n64_push_dummy_call: sp=0x%s allocated %ld\n",
- paddr_nz (sp), (long) align_up (len, 16));
+ "mips_n32n64_push_dummy_call: sp=%s allocated %ld\n",
+ paddress (gdbarch, sp), (long) align_up (len, 16));
/* Initialize the integer and float register pointers. */
argreg = MIPS_A0_REGNUM;
{
if (mips_debug)
fprintf_unfiltered (gdb_stdlog,
- "mips_n32n64_push_dummy_call: struct_return reg=%d 0x%s\n",
- argreg, paddr_nz (struct_addr));
+ "mips_n32n64_push_dummy_call: struct_return reg=%d %s\n",
+ argreg, paddress (gdbarch, struct_addr));
regcache_cooked_write_unsigned (regcache, argreg++, struct_addr);
}
if (mips_debug)
{
- fprintf_unfiltered (gdb_stdlog, " - stack_offset=0x%s",
- paddr_nz (stack_offset));
- fprintf_unfiltered (gdb_stdlog, " longword_offset=0x%s",
- paddr_nz (longword_offset));
+ fprintf_unfiltered (gdb_stdlog, " - stack_offset=%s",
+ paddress (gdbarch, stack_offset));
+ fprintf_unfiltered (gdb_stdlog, " longword_offset=%s",
+ paddress (gdbarch, longword_offset));
}
addr = sp + stack_offset + longword_offset;
if (mips_debug)
{
int i;
- fprintf_unfiltered (gdb_stdlog, " @0x%s ",
- paddr_nz (addr));
+ fprintf_unfiltered (gdb_stdlog, " @%s ",
+ paddress (gdbarch, addr));
for (i = 0; i < partial_len; i++)
{
fprintf_unfiltered (gdb_stdlog, "%02x",
if (mips_debug)
fprintf_unfiltered (gdb_stdlog,
- "mips_o32_push_dummy_call: sp=0x%s allocated %ld\n",
- paddr_nz (sp), (long) align_up (len, 16));
+ "mips_o32_push_dummy_call: sp=%s allocated %ld\n",
+ paddress (gdbarch, sp), (long) align_up (len, 16));
/* Initialize the integer and float register pointers. */
argreg = MIPS_A0_REGNUM;
{
if (mips_debug)
fprintf_unfiltered (gdb_stdlog,
- "mips_o32_push_dummy_call: struct_return reg=%d 0x%s\n",
- argreg, paddr_nz (struct_addr));
+ "mips_o32_push_dummy_call: struct_return reg=%d %s\n",
+ argreg, paddress (gdbarch, struct_addr));
regcache_cooked_write_unsigned (regcache, argreg++, struct_addr);
stack_offset += MIPS32_REGSIZE;
}
if (mips_debug)
{
- fprintf_unfiltered (gdb_stdlog, " - stack_offset=0x%s",
- paddr_nz (stack_offset));
- fprintf_unfiltered (gdb_stdlog, " longword_offset=0x%s",
- paddr_nz (longword_offset));
+ fprintf_unfiltered (gdb_stdlog, " - stack_offset=%s",
+ paddress (gdbarch, stack_offset));
+ fprintf_unfiltered (gdb_stdlog, " longword_offset=%s",
+ paddress (gdbarch, longword_offset));
}
addr = sp + stack_offset + longword_offset;
if (mips_debug)
{
int i;
- fprintf_unfiltered (gdb_stdlog, " @0x%s ",
- paddr_nz (addr));
+ fprintf_unfiltered (gdb_stdlog, " @%s ",
+ paddress (gdbarch, addr));
for (i = 0; i < partial_len; i++)
{
fprintf_unfiltered (gdb_stdlog, "%02x",
if (mips_debug)
fprintf_unfiltered (gdb_stdlog,
- "mips_o64_push_dummy_call: sp=0x%s allocated %ld\n",
- paddr_nz (sp), (long) align_up (len, 16));
+ "mips_o64_push_dummy_call: sp=%s allocated %ld\n",
+ paddress (gdbarch, sp), (long) align_up (len, 16));
/* Initialize the integer and float register pointers. */
argreg = MIPS_A0_REGNUM;
{
if (mips_debug)
fprintf_unfiltered (gdb_stdlog,
- "mips_o64_push_dummy_call: struct_return reg=%d 0x%s\n",
- argreg, paddr_nz (struct_addr));
+ "mips_o64_push_dummy_call: struct_return reg=%d %s\n",
+ argreg, paddress (gdbarch, struct_addr));
regcache_cooked_write_unsigned (regcache, argreg++, struct_addr);
stack_offset += MIPS64_REGSIZE;
}
if (mips_debug)
{
- fprintf_unfiltered (gdb_stdlog, " - stack_offset=0x%s",
- paddr_nz (stack_offset));
- fprintf_unfiltered (gdb_stdlog, " longword_offset=0x%s",
- paddr_nz (longword_offset));
+ fprintf_unfiltered (gdb_stdlog, " - stack_offset=%s",
+ paddress (gdbarch, stack_offset));
+ fprintf_unfiltered (gdb_stdlog, " longword_offset=%s",
+ paddress (gdbarch, longword_offset));
}
addr = sp + stack_offset + longword_offset;
if (mips_debug)
{
int i;
- fprintf_unfiltered (gdb_stdlog, " @0x%s ",
- paddr_nz (addr));
+ fprintf_unfiltered (gdb_stdlog, " @%s ",
+ paddress (gdbarch, addr));
for (i = 0; i < partial_len; i++)
{
fprintf_unfiltered (gdb_stdlog, "%02x",
monitor_printable_string (safe_string, string, real_len);
if (final_char)
- error (_("%s (0x%s): %s: %s%c"), function, paddr_nz (memaddr), message, safe_string, final_char);
+ error (_("%s (%s): %s: %s%c"),
+ function, paddress (target_gdbarch, memaddr),
+ message, safe_string, final_char);
else
- error (_("%s (0x%s): %s: %s"), function, paddr_nz (memaddr), message, safe_string);
+ error (_("%s (%s): %s: %s"),
+ function, paddress (target_gdbarch, memaddr),
+ message, safe_string);
}
/* Convert hex digit A to a number. */
static void
monitor_vsprintf (char *sndbuf, char *pattern, va_list args)
{
+ int addr_bit = gdbarch_addr_bit (target_gdbarch);
char format[10];
char fmt;
char *p;
break;
case 'A':
arg_addr = va_arg (args, CORE_ADDR);
- strcpy (sndbuf, paddr_nz (arg_addr));
+ strcpy (sndbuf, phex_nz (arg_addr, addr_bit / 8));
break;
case 's':
arg_string = va_arg (args, char *);
static void
monitor_store_register (struct regcache *regcache, int regno)
{
+ int reg_size = register_size (get_regcache_arch (regcache), regno);
const char *name;
ULONGEST val;
}
regcache_cooked_read_unsigned (regcache, regno, &val);
- monitor_debug ("MON storeg %d %s\n", regno,
- phex (val,
- register_size (get_regcache_arch (regcache), regno)));
+ monitor_debug ("MON storeg %d %s\n", regno, phex (val, reg_size));
/* send the register deposit command */
monitor_debug ("EXP setreg.resp_delim\n");
monitor_expect_regexp (&setreg_resp_delim_pattern, NULL, 0);
if (current_monitor->flags & MO_SETREG_INTERACTIVE)
- monitor_printf ("%s\r", paddr_nz (val));
+ monitor_printf ("%s\r", phex_nz (val, reg_size));
}
if (current_monitor->setreg.term)
{
monitor_debug ("EXP setreg.term\n");
monitor_expect (current_monitor->setreg.term, NULL, 0);
if (current_monitor->flags & MO_SETREG_INTERACTIVE)
- monitor_printf ("%s\r", paddr_nz (val));
+ monitor_printf ("%s\r", phex_nz (val, reg_size));
monitor_expect_prompt (NULL, 0);
}
else
char *cmd;
int i;
- monitor_debug ("MON write %d %s\n", len, paddr (memaddr));
+ monitor_debug ("MON write %d %s\n", len, paddress (target_gdbarch, memaddr));
if (current_monitor->flags & MO_ADDR_BITS_REMOVE)
memaddr = gdbarch_addr_bits_remove (target_gdbarch, memaddr);
}
monitor_debug ("MON read block ta(%s) ha(%lx) %d\n",
- paddr_nz (memaddr), (long) myaddr, len);
+ paddress (target_gdbarch, memaddr), (long) myaddr, len);
if (current_monitor->flags & MO_ADDR_BITS_REMOVE)
memaddr = gdbarch_addr_bits_remove (target_gdbarch, memaddr);
int i;
int bplen;
- monitor_debug ("MON inst bkpt %s\n", paddr (addr));
+ monitor_debug ("MON inst bkpt %s\n", paddress (gdbarch, addr));
if (current_monitor->set_break == NULL)
error (_("No set_break defined for this monitor"));
CORE_ADDR addr = bp_tgt->placed_address;
int i;
- monitor_debug ("MON rmbkpt %s\n", paddr (addr));
+ monitor_debug ("MON rmbkpt %s\n", paddress (gdbarch, addr));
if (current_monitor->clr_break == NULL)
error (_("No clr_break defined for this monitor"));
}
}
fprintf_unfiltered (gdb_stderr,
- "Can't find breakpoint associated with 0x%s\n",
- paddr_nz (addr));
+ "Can't find breakpoint associated with %s\n",
+ paddress (gdbarch, addr));
return 1;
}
struct ui_file *stream, int recurse,
const struct value_print_options *options)
{
+ struct gdbarch *gdbarch = get_type_arch (type);
unsigned int i = 0; /* Number of characters printed */
unsigned len;
struct type *elttype;
/* Print vtable entry - we only get here if we ARE using
-fvtable_thunks. (Otherwise, look under TYPE_CODE_STRUCT.) */
/* Extract the address, assume that it is unsigned. */
- print_address_demangle (extract_unsigned_integer (valaddr + embedded_offset, TYPE_LENGTH (type)),
+ print_address_demangle (gdbarch,
+ extract_unsigned_integer (valaddr + embedded_offset, TYPE_LENGTH (type)),
stream, demangle);
break;
}
if (TYPE_CODE (elttype) == TYPE_CODE_FUNC)
{
/* Try to print what function it points to. */
- print_address_demangle (addr, stream, demangle);
+ print_address_demangle (gdbarch, addr, stream, demangle);
/* Return value is irrelevant except for string pointers. */
return (0);
}
if (options->addressprint && options->format != 's')
{
- fputs_filtered (paddress (addr), stream);
+ fputs_filtered (paddress (gdbarch, addr), stream);
}
/* For a pointer to char or unsigned char, also print the string
CORE_ADDR addr
= extract_typed_address (valaddr + embedded_offset, type);
fprintf_filtered (stream, "@");
- fputs_filtered (paddress (addr), stream);
+ fputs_filtered (paddress (gdbarch, addr), stream);
if (options->deref_ref)
fputs_filtered (": ", stream);
}
-fvtable_thunks. (Otherwise, look under TYPE_CODE_PTR.) */
/* Extract the address, assume that it is unsigned. */
print_address_demangle
- (extract_unsigned_integer (valaddr + embedded_offset + TYPE_FIELD_BITPOS (type, VTBL_FNADDR_OFFSET) / 8,
+ (gdbarch,
+ extract_unsigned_integer (valaddr + embedded_offset + TYPE_FIELD_BITPOS (type, VTBL_FNADDR_OFFSET) / 8,
TYPE_LENGTH (TYPE_FIELD_TYPE (type, VTBL_FNADDR_OFFSET))),
stream, demangle);
}
type_print (type, "", stream, -1);
fprintf_filtered (stream, "} ");
/* Try to print what function it points to, and its address. */
- print_address_demangle (address, stream, demangle);
+ print_address_demangle (gdbarch, address, stream, demangle);
break;
case TYPE_CODE_BOOL:
case 'a':
{
CORE_ADDR addr = unpack_pointer (type, valaddr);
- print_address (addr, stream);
+ print_address (gdbarch, addr, stream);
}
break;
<SYMBOL + OFFSET> after the number. */
void
-print_address (CORE_ADDR addr, struct ui_file *stream)
+print_address (struct gdbarch *gdbarch,
+ CORE_ADDR addr, struct ui_file *stream)
{
- fputs_filtered (paddress (addr), stream);
+ fputs_filtered (paddress (gdbarch, addr), stream);
print_address_symbolic (addr, stream, asm_demangle, " ");
}
or not. */
void
-print_address_demangle (CORE_ADDR addr, struct ui_file *stream,
- int do_demangle)
+print_address_demangle (struct gdbarch *gdbarch, CORE_ADDR addr,
+ struct ui_file *stream, int do_demangle)
{
struct value_print_options opts;
get_user_print_options (&opts);
}
else if (opts.addressprint)
{
- fputs_filtered (paddress (addr), stream);
+ fputs_filtered (paddress (gdbarch, addr), stream);
print_address_symbolic (addr, stream, do_demangle, " ");
}
else
while (count > 0)
{
QUIT;
- print_address (next_address, gdb_stdout);
+ print_address (next_gdbarch, next_address, gdb_stdout);
printf_filtered (":");
for (i = maxelts;
i > 0 && count > 0;
if (msymbol != NULL)
{
+ gdbarch = get_objfile_arch (msymbol_objfile (msymbol));
load_addr = SYMBOL_VALUE_ADDRESS (msymbol);
printf_filtered ("Symbol \"");
fprintf_symbol_filtered (gdb_stdout, exp,
current_language->la_language, DMGL_ANSI);
printf_filtered ("\" is at ");
- fputs_filtered (paddress (load_addr), gdb_stdout);
+ fputs_filtered (paddress (gdbarch, load_addr), gdb_stdout);
printf_filtered (" in a file compiled without debugging");
section = SYMBOL_OBJ_SECTION (msymbol);
if (section_is_overlay (section))
{
load_addr = overlay_unmapped_address (load_addr, section);
printf_filtered (",\n -- loaded at ");
- fputs_filtered (paddress (load_addr), gdb_stdout);
+ fputs_filtered (paddress (gdbarch, load_addr), gdb_stdout);
printf_filtered (" in overlay section %s",
section->the_bfd_section->name);
}
case LOC_LABEL:
printf_filtered ("a label at address ");
- fputs_filtered (paddress (load_addr = SYMBOL_VALUE_ADDRESS (sym)),
- gdb_stdout);
+ load_addr = SYMBOL_VALUE_ADDRESS (sym);
+ fputs_filtered (paddress (gdbarch, load_addr), gdb_stdout);
if (section_is_overlay (section))
{
load_addr = overlay_unmapped_address (load_addr, section);
printf_filtered (",\n -- loaded at ");
- fputs_filtered (paddress (load_addr), gdb_stdout);
+ fputs_filtered (paddress (gdbarch, load_addr), gdb_stdout);
printf_filtered (" in overlay section %s",
section->the_bfd_section->name);
}
case LOC_STATIC:
printf_filtered (_("static storage at address "));
- fputs_filtered (paddress (load_addr = SYMBOL_VALUE_ADDRESS (sym)),
- gdb_stdout);
+ load_addr = SYMBOL_VALUE_ADDRESS (sym);
+ fputs_filtered (paddress (gdbarch, load_addr), gdb_stdout);
if (section_is_overlay (section))
{
load_addr = overlay_unmapped_address (load_addr, section);
printf_filtered (_(",\n -- loaded at "));
- fputs_filtered (paddress (load_addr), gdb_stdout);
+ fputs_filtered (paddress (gdbarch, load_addr), gdb_stdout);
printf_filtered (_(" in overlay section %s"),
section->the_bfd_section->name);
}
case LOC_BLOCK:
printf_filtered (_("a function at address "));
load_addr = BLOCK_START (SYMBOL_BLOCK_VALUE (sym));
- fputs_filtered (paddress (load_addr), gdb_stdout);
+ fputs_filtered (paddress (gdbarch, load_addr), gdb_stdout);
if (section_is_overlay (section))
{
load_addr = overlay_unmapped_address (load_addr, section);
printf_filtered (_(",\n -- loaded at "));
- fputs_filtered (paddress (load_addr), gdb_stdout);
+ fputs_filtered (paddress (gdbarch, load_addr), gdb_stdout);
printf_filtered (_(" in overlay section %s"),
section->the_bfd_section->name);
}
&& (section->the_bfd_section->flags & SEC_THREAD_LOCAL) != 0)
printf_filtered (_("a thread-local variable at offset %s "
"in the thread-local storage for `%s'"),
- paddr_nz (load_addr), section->objfile->name);
+ paddress (gdbarch, load_addr),
+ section->objfile->name);
else
{
printf_filtered (_("static storage at address "));
- fputs_filtered (paddress (load_addr), gdb_stdout);
+ fputs_filtered (paddress (gdbarch, load_addr), gdb_stdout);
if (section_is_overlay (section))
{
load_addr = overlay_unmapped_address (load_addr, section);
printf_filtered (_(",\n -- loaded at "));
- fputs_filtered (paddress (load_addr), gdb_stdout);
+ fputs_filtered (paddress (gdbarch, load_addr), gdb_stdout);
printf_filtered (_(" in overlay section %s"),
section->the_bfd_section->name);
}
if (record_debug > 1)
fprintf_unfiltered (gdb_stdlog,
- "Process record: add mem addr = 0x%s len = %d to "
+ "Process record: add mem addr = %s len = %d to "
"record list.\n",
- paddr_nz (addr), len);
+ paddress (target_gdbarch, addr), len);
if (!addr)
return 0;
if (record_debug)
fprintf_unfiltered (gdb_stdlog,
"Process record: error reading memory at "
- "addr = 0x%s len = %d.\n",
- paddr_nz (addr), len);
+ "addr = %s len = %d.\n",
+ paddress (target_gdbarch, addr), len);
xfree (rec->u.mem.val);
xfree (rec);
return -1;
else
{
struct regcache *regcache = get_current_regcache ();
+ struct gdbarch *gdbarch = get_regcache_arch (regcache);
int continue_flag = 1;
int first_record_end = 1;
struct cleanup *old_cleanups = make_cleanup (record_wait_cleanups, 0);
{
if (record_debug)
fprintf_unfiltered (gdb_stdlog,
- "Process record: break at 0x%s.\n",
- paddr_nz (tmp_pc));
- if (gdbarch_decr_pc_after_break (get_regcache_arch (regcache))
+ "Process record: break at %s.\n",
+ paddress (gdbarch, tmp_pc));
+ if (gdbarch_decr_pc_after_break (gdbarch)
&& !record_resume_step)
regcache_write_pc (regcache,
tmp_pc +
- gdbarch_decr_pc_after_break
- (get_regcache_arch (regcache)));
+ gdbarch_decr_pc_after_break (gdbarch));
goto replay_out;
}
}
if (record_debug > 1)
fprintf_unfiltered (gdb_stdlog,
"Process record: record_mem %s to "
- "inferior addr = 0x%s len = %d.\n",
+ "inferior addr = %s len = %d.\n",
host_address_to_string (record_list),
- paddr_nz (record_list->u.mem.addr),
+ paddress (gdbarch, record_list->u.mem.addr),
record_list->u.mem.len);
if (target_read_memory
(record_list->u.mem.addr, mem, record_list->u.mem.len))
error (_("Process record: error reading memory at "
- "addr = 0x%s len = %d."),
- paddr_nz (record_list->u.mem.addr),
+ "addr = %s len = %d."),
+ paddress (gdbarch, record_list->u.mem.addr),
record_list->u.mem.len);
if (target_write_memory
record_list->u.mem.len))
error (_
("Process record: error writing memory at "
- "addr = 0x%s len = %d."),
- paddr_nz (record_list->u.mem.addr),
+ "addr = %s len = %d."),
+ paddress (gdbarch, record_list->u.mem.addr),
record_list->u.mem.len);
memcpy (record_list->u.mem.val, mem, record_list->u.mem.len);
if (record_debug)
fprintf_unfiltered (gdb_stdlog,
"Process record: break "
- "at 0x%s.\n",
- paddr_nz (tmp_pc));
- if (gdbarch_decr_pc_after_break (get_regcache_arch (regcache))
+ "at %s.\n",
+ paddress (gdbarch, tmp_pc));
+ if (gdbarch_decr_pc_after_break (gdbarch)
&& execution_direction == EXEC_FORWARD
&& !record_resume_step)
regcache_write_pc (regcache,
tmp_pc +
- gdbarch_decr_pc_after_break
- (get_regcache_arch (regcache)));
+ gdbarch_decr_pc_after_break (gdbarch));
continue_flag = 0;
}
}
/* Let user choose if he wants to write memory or not. */
if (!nquery (_("Because GDB is in replay mode, writing to memory "
"will make the execution log unusable from this "
- "point onward. Write memory at address 0x%s?"),
- paddr_nz (offset)))
+ "point onward. Write memory at address %s?"),
+ paddress (target_gdbarch, offset)))
return -1;
/* Destroy the record from here forward. */
{
if (write)
fprintf_unfiltered (gdb_stdlog, "m32r_xfer_memory(%s,%d,write)\n",
- paddr (memaddr), len);
+ paddress (target_gdbarch, memaddr), len);
else
fprintf_unfiltered (gdb_stdlog, "m32r_xfer_memory(%s,%d,read)\n",
- paddr (memaddr), len);
+ paddress (target_gdbarch, memaddr), len);
}
if (write)
if (remote_debug)
fprintf_unfiltered (gdb_stdlog, "m32r_insert_breakpoint(%s,...)\n",
- paddr (addr));
+ paddress (gdbarch, addr));
if (use_ib_breakpoints)
ib_breakpoints = max_ib_breakpoints;
if (remote_debug)
fprintf_unfiltered (gdb_stdlog, "m32r_remove_breakpoint(%s)\n",
- paddr (addr));
+ paddress (gdbarch, addr));
for (i = 0; i < MAX_BREAKPOINTS; i++)
{
if (remote_debug)
fprintf_unfiltered (gdb_stdlog, "m32r_insert_watchpoint(%s,%d,%d)\n",
- paddr (addr), len, type);
+ paddress (target_gdbarch, addr), len, type);
for (i = 0; i < MAX_ACCESS_BREAKS; i++)
{
if (remote_debug)
fprintf_unfiltered (gdb_stdlog, "m32r_remove_watchpoint(%s,%d,%d)\n",
- paddr (addr), len, type);
+ paddress (target_gdbarch, addr), len, type);
for (i = 0; i < MAX_ACCESS_BREAKS; i++)
{
int timeout,
char *buff)
{
+ int addr_size = gdbarch_addr_bit (target_gdbarch) / 8;
char myBuff[DATA_MAXLEN + 1];
int len;
int rpid;
if (mips_need_reply)
internal_error (__FILE__, __LINE__,
_("mips_request: Trying to send command before reply"));
- sprintf (buff, "0x0 %c 0x%s 0x%s", cmd, paddr_nz (addr), paddr_nz (data));
+ sprintf (buff, "0x0 %c 0x%s 0x%s", cmd,
+ phex_nz (addr, addr_size), phex_nz (data, addr_size));
mips_send_packet (buff, 1);
mips_need_reply = 1;
}
val = mips_request ('i', addr, 0, &err,
mips_receive_wait, NULL);
if (err)
- mips_error ("Can't read address 0x%s: %s",
- paddr_nz (addr), safe_strerror (errno));
+ mips_error ("Can't read address %s: %s",
+ paddress (target_gdbarch, addr), safe_strerror (errno));
}
return val;
}
mips_check_lsi_error (CORE_ADDR addr, int rerrflg)
{
struct lsi_error *err;
- char *saddr = paddr_nz (addr); /* printable address string */
+ char *saddr = paddress (target_gdbarch, addr);
if (rerrflg == 0) /* no error */
return 0;
{
found = 1;
fprintf_unfiltered (gdb_stderr, "\
-mips_common_breakpoint (0x%s): Warning: %s\n",
+mips_common_breakpoint (%s): Warning: %s\n",
saddr,
err->string);
}
}
if (!found)
fprintf_unfiltered (gdb_stderr, "\
-mips_common_breakpoint (0x%s): Unknown warning: 0x%x\n",
+mips_common_breakpoint (%s): Unknown warning: 0x%x\n",
saddr,
rerrflg);
}
if ((err->code & rerrflg) == err->code)
{
fprintf_unfiltered (gdb_stderr, "\
-mips_common_breakpoint (0x%s): Error: %s\n",
+mips_common_breakpoint (%s): Error: %s\n",
saddr,
err->string);
return 1;
}
}
fprintf_unfiltered (gdb_stderr, "\
-mips_common_breakpoint (0x%s): Unknown error: 0x%x\n",
+mips_common_breakpoint (%s): Unknown error: 0x%x\n",
saddr,
rerrflg);
return 1;
static int
mips_common_breakpoint (int set, CORE_ADDR addr, int len, enum break_type type)
{
+ int addr_size = gdbarch_addr_bit (target_gdbarch) / 8;
char buf[DATA_MAXLEN + 1];
char cmd, rcmd;
int rpid, rerrflg, rresponse, rlen;
{
warning ("\
mips_common_breakpoint: Attempt to clear bogus breakpoint at %s\n",
- paddr_nz (addr));
+ paddress (target_gdbarch, addr));
return 1;
}
if (type == BREAK_FETCH) /* instruction breakpoint */
{
cmd = 'B';
- sprintf (buf, "0x0 B 0x%s 0x0", paddr_nz (addr));
+ sprintf (buf, "0x0 B 0x%s 0x0", phex_nz (addr, addr_size));
}
else
/* watchpoint */
{
cmd = 'A';
- sprintf (buf, "0x0 A 0x%s 0x%x 0x%s", paddr_nz (addr),
- type == BREAK_READ ? 1 : (type == BREAK_WRITE ? 2 : 3),
- paddr_nz (addr + len - 1));
+ sprintf (buf, "0x0 A 0x%s 0x%x 0x%s",
+ phex_nz (addr, addr_size),
+ type == BREAK_READ ? 1 : (type == BREAK_WRITE ? 2 : 3),
+ phex_nz (addr + len - 1, addr_size));
}
mips_send_packet (buf, 1);
}
cmd = 'B';
- sprintf (buf, "0x0 B 0x%s 0x%s %s", paddr_nz (addr),
- paddr_nz (mask), flags);
+ sprintf (buf, "0x0 B 0x%s 0x%s %s", phex_nz (addr, addr_size),
+ phex_nz (mask, addr_size), flags);
}
else
{
cmd = 'b';
- sprintf (buf, "0x0 b 0x%s", paddr_nz (addr));
+ sprintf (buf, "0x0 b 0x%s", phex_nz (addr, addr_size));
}
mips_send_packet (buf, 1);
rresponse = rerrflg;
if (rresponse != 22) /* invalid argument */
fprintf_unfiltered (gdb_stderr, "\
-mips_common_breakpoint (0x%s): Got error: 0x%x\n",
- paddr_nz (addr), rresponse);
+mips_common_breakpoint (%s): Got error: 0x%x\n",
+ paddress (target_gdbarch, addr), rresponse);
return 1;
}
}
case 0x6: /* ACK */
return;
case 0x15: /* NACK */
- fprintf_unfiltered (gdb_stderr, "Download got a NACK at byte 0x%s! Retrying.\n", paddr_nz (addr));
+ fprintf_unfiltered (gdb_stderr, "Download got a NACK at byte %s! Retrying.\n",
+ paddress (target_gdbarch, addr));
continue;
default:
error ("Download got unexpected ack char: 0x%x, retrying.\n", ch);
/* FIXME: Send to something other than STDOUT? */
printf_filtered ("gdbsim_xfer_inferior_memory: myaddr 0x");
gdb_print_host_address (myaddr, gdb_stdout);
- printf_filtered (", memaddr 0x%s, len %d, write %d\n",
- paddr_nz (memaddr), len, write);
+ printf_filtered (", memaddr %s, len %d, write %d\n",
+ paddress (target_gdbarch, memaddr), len, write);
if (remote_debug && write)
dump_mem (myaddr, len);
}
xsnprintf (msg, get_remote_packet_size (), "qSymbol::%s", &reply[8]);
else
{
+ int addr_size = gdbarch_addr_bit (target_gdbarch) / 8;
CORE_ADDR sym_addr = SYMBOL_VALUE_ADDRESS (sym);
/* If this is a function address, return the start of code
¤t_target);
xsnprintf (msg, get_remote_packet_size (), "qSymbol:%s:%s",
- paddr_nz (sym_addr), &reply[8]);
+ phex_nz (sym_addr, addr_size), &reply[8]);
}
putpkt (msg);
remote_flash_erase (struct target_ops *ops,
ULONGEST address, LONGEST length)
{
+ int addr_size = gdbarch_addr_bit (target_gdbarch) / 8;
int saved_remote_timeout = remote_timeout;
enum packet_result ret;
remote_timeout = remote_flash_timeout;
ret = remote_send_printf ("vFlashErase:%s,%s",
- paddr (address),
+ phex (address, addr_size),
phex (length, 4));
switch (ret)
{
getpkt (&rs->buf, &rs->buf_size, 0);
if (rs->buf[0] == 'E')
- error (_("target memory fault, section %s, range 0x%s -- 0x%s"),
- sectname, paddr (lma), paddr (lma + size));
+ error (_("target memory fault, section %s, range %s -- %s"), sectname,
+ paddress (target_gdbarch, lma),
+ paddress (target_gdbarch, lma + size));
if (rs->buf[0] != 'C')
error (_("remote target does not support this operation"));
for (target_crc = 0, tmp = &rs->buf[1]; *tmp; tmp++)
target_crc = target_crc * 16 + fromhex (*tmp);
- printf_filtered ("Section %s, range 0x%s -- 0x%s: ",
- sectname, paddr (lma), paddr (lma + size));
+ printf_filtered ("Section %s, range %s -- %s: ", sectname,
+ paddress (target_gdbarch, lma),
+ paddress (target_gdbarch, lma + size));
if (host_crc == target_crc)
printf_filtered ("matched.\n");
else
const gdb_byte *pattern, ULONGEST pattern_len,
CORE_ADDR *found_addrp)
{
+ int addr_size = gdbarch_addr_bit (target_gdbarch) / 8;
struct remote_state *rs = get_remote_state ();
int max_size = get_memory_write_packet_size ();
struct packet_config *packet =
/* Insert header. */
i = snprintf (rs->buf, max_size,
"qSearch:memory:%s;%s;",
- paddr_nz (start_addr),
+ phex_nz (start_addr, addr_size),
phex_nz (search_space_len, sizeof (search_space_len)));
max_size -= (i + 1);
if (debug_displaced)
fprintf_unfiltered (gdb_stdlog,
- "displaced: (ppc) fixup (0x%s, 0x%s)\n",
- paddr_nz (from), paddr_nz (to));
+ "displaced: (ppc) fixup (%s, %s)\n",
+ paddress (gdbarch, from), paddress (gdbarch, to));
/* Handle PC-relative branch instructions. */
if (debug_displaced)
fprintf_unfiltered
(gdb_stdlog,
- "displaced: (ppc) branch instruction: 0x%s\n"
- "displaced: (ppc) adjusted PC from 0x%s to 0x%s\n",
- paddr_nz (insn), paddr_nz (current_pc),
- paddr_nz (from + offset));
+ "displaced: (ppc) branch instruction: %s\n"
+ "displaced: (ppc) adjusted PC from %s to %s\n",
+ paddress (gdbarch, insn), paddress (gdbarch, current_pc),
+ paddress (gdbarch, from + offset));
regcache_cooked_write_unsigned (regs, gdbarch_pc_regnum (gdbarch),
from + offset);
from + PPC_INSN_SIZE);
if (debug_displaced)
fprintf_unfiltered (gdb_stdlog,
- "displaced: (ppc) adjusted LR to 0x%s\n",
- paddr_nz (from + PPC_INSN_SIZE));
+ "displaced: (ppc) adjusted LR to %s\n",
+ paddress (gdbarch, from + PPC_INSN_SIZE));
}
}
if (SCM_CELLP (ptr))
fprintf_filtered (stream, " (0x%lx . 0x%lx) @",
(long) SCM_CAR (ptr), (long) SCM_CDR (ptr));
- fprintf_filtered (stream, " 0x%s>", paddr_nz (ptr));
+ fprintf_filtered (stream, " 0x%s>", phex_nz (ptr, SCM_SIZE));
#undef SCM_SIZE
}
(sizet) LENGTH (name),
port);
#endif
- fprintf_filtered (stream, " #X%s>", paddr_nz (svalue));
+ fprintf_filtered (stream, " #X%s>", phex_nz (svalue, SCM_SIZE));
break;
}
case scm_tcs_cons_imcar:
{
printf_filtered
(" PC %s SR %08lx PR %08lx MACH %08lx\n",
- paddr (get_frame_register_unsigned (frame,
- gdbarch_pc_regnum
- (get_frame_arch (frame)))),
+ phex (get_frame_register_unsigned (frame,
+ gdbarch_pc_regnum
+ (get_frame_arch (frame))), 4),
(long) get_frame_register_unsigned (frame, SR_REGNUM),
(long) get_frame_register_unsigned (frame, PR_REGNUM),
(long) get_frame_register_unsigned (frame, MACH_REGNUM));
{
printf_filtered
(" PC %s SR %08lx PR %08lx MACH %08lx\n",
- paddr (get_frame_register_unsigned (frame,
- gdbarch_pc_regnum
- (get_frame_arch (frame)))),
+ phex (get_frame_register_unsigned (frame,
+ gdbarch_pc_regnum
+ (get_frame_arch (frame))), 4),
(long) get_frame_register_unsigned (frame, SR_REGNUM),
(long) get_frame_register_unsigned (frame, PR_REGNUM),
(long) get_frame_register_unsigned (frame, MACH_REGNUM));
struct gdbarch *gdbarch = get_frame_arch (frame);
printf_filtered
(" PC %s SR %08lx PR %08lx MACH %08lx\n",
- paddr (get_frame_register_unsigned (frame,
- gdbarch_pc_regnum (gdbarch))),
+ phex (get_frame_register_unsigned (frame,
+ gdbarch_pc_regnum (gdbarch)), 4),
(long) get_frame_register_unsigned (frame, SR_REGNUM),
(long) get_frame_register_unsigned (frame, PR_REGNUM),
(long) get_frame_register_unsigned (frame, MACH_REGNUM));
printf_filtered
(" PC %s SR %08lx PR %08lx MACH %08lx\n",
- paddr (get_frame_register_unsigned (frame,
- gdbarch_pc_regnum (gdbarch))),
+ phex (get_frame_register_unsigned (frame,
+ gdbarch_pc_regnum (gdbarch)), 4),
(long) get_frame_register_unsigned (frame, SR_REGNUM),
(long) get_frame_register_unsigned (frame, PR_REGNUM),
(long) get_frame_register_unsigned (frame, MACH_REGNUM));
printf_filtered
(" PC %s SR %08lx PR %08lx MACH %08lx\n",
- paddr (get_frame_register_unsigned (frame,
- gdbarch_pc_regnum
- (get_frame_arch (frame)))),
+ phex (get_frame_register_unsigned (frame,
+ gdbarch_pc_regnum
+ (get_frame_arch (frame))), 4),
(long) get_frame_register_unsigned (frame, SR_REGNUM),
(long) get_frame_register_unsigned (frame, PR_REGNUM),
(long) get_frame_register_unsigned (frame, MACH_REGNUM));
struct gdbarch *gdbarch = get_frame_arch (frame);
printf_filtered
(" PC %s SR %08lx PR %08lx MACH %08lx\n",
- paddr (get_frame_register_unsigned (frame,
- gdbarch_pc_regnum (gdbarch))),
+ phex (get_frame_register_unsigned (frame,
+ gdbarch_pc_regnum (gdbarch)), 4),
(long) get_frame_register_unsigned (frame, SR_REGNUM),
(long) get_frame_register_unsigned (frame, PR_REGNUM),
(long) get_frame_register_unsigned (frame, MACH_REGNUM));
{
printf_filtered
(" PC %s SR %08lx PR %08lx MACH %08lx\n",
- paddr (get_frame_register_unsigned (frame,
- gdbarch_pc_regnum
- (get_frame_arch (frame)))),
+ phex (get_frame_register_unsigned (frame,
+ gdbarch_pc_regnum
+ (get_frame_arch (frame))), 4),
(long) get_frame_register_unsigned (frame, SR_REGNUM),
(long) get_frame_register_unsigned (frame, PR_REGNUM),
(long) get_frame_register_unsigned (frame, MACH_REGNUM));
printf_filtered
(" PC %s SR %08lx PR %08lx MACH %08lx\n",
- paddr (get_frame_register_unsigned (frame,
- gdbarch_pc_regnum (gdbarch))),
+ phex (get_frame_register_unsigned (frame,
+ gdbarch_pc_regnum (gdbarch)), 4),
(long) get_frame_register_unsigned (frame, SR_REGNUM),
(long) get_frame_register_unsigned (frame, PR_REGNUM),
(long) get_frame_register_unsigned (frame, MACH_REGNUM));
{
printf_filtered
(" PC %s SR %08lx PR %08lx MACH %08lx\n",
- paddr (get_frame_register_unsigned (frame,
- gdbarch_pc_regnum
- (get_frame_arch (frame)))),
+ phex (get_frame_register_unsigned (frame,
+ gdbarch_pc_regnum
+ (get_frame_arch (frame))), 4),
(long) get_frame_register_unsigned (frame, SR_REGNUM),
(long) get_frame_register_unsigned (frame, PR_REGNUM),
(long) get_frame_register_unsigned (frame, MACH_REGNUM));
{
printf_filtered
(" PC %s SR %08lx PR %08lx MACH %08lx\n",
- paddr (get_frame_register_unsigned (frame,
- gdbarch_pc_regnum
- (get_frame_arch (frame)))),
+ phex (get_frame_register_unsigned (frame,
+ gdbarch_pc_regnum
+ (get_frame_arch (frame))), 4),
(long) get_frame_register_unsigned (frame, SR_REGNUM),
(long) get_frame_register_unsigned (frame, PR_REGNUM),
(long) get_frame_register_unsigned (frame, MACH_REGNUM));
printf_filtered
("PC=%s SR=%016llx \n",
- paddr (get_frame_register_unsigned (frame,
- gdbarch_pc_regnum (gdbarch))),
+ phex (get_frame_register_unsigned (frame,
+ gdbarch_pc_regnum (gdbarch)), 8),
(long long) get_frame_register_unsigned (frame, SR_REGNUM));
printf_filtered
printf_filtered
("PC=%s \n",
- paddr (get_frame_register_unsigned (frame, PC_C_REGNUM)));
+ phex (get_frame_register_unsigned (frame, PC_C_REGNUM), 8));
printf_filtered
("GBR=%08lx MACH=%08lx MACL=%08lx PR=%08lx T=%08lx\n",
printf_filtered (" startfunc: %s\n",
SYMBOL_PRINT_NAME (msym));
else
- printf_filtered (" startfunc: 0x%s\n", paddr (ti.ti_startfunc));
+ printf_filtered (" startfunc: %s\n",
+ paddress (target_gdbarch, ti.ti_startfunc));
}
/* If thread is asleep, print function that went to sleep. */
printf_filtered (" - Sleep func: %s\n",
SYMBOL_PRINT_NAME (msym));
else
- printf_filtered (" - Sleep func: 0x%s\n", paddr (ti.ti_startfunc));
+ printf_filtered (" - Sleep func: %s\n",
+ paddress (target_gdbarch, ti.ti_startfunc));
}
/* Wrap up line, if necessary. */
lmi->tsd_start_addr = extract_unsigned_integer (tsdbuf, 4);
#ifdef SOLIB_SOM_DBG
- printf ("\n+ library \"%s\" is described at 0x%s\n", new->so_name,
- paddr_nz (lm));
+ printf ("\n+ library \"%s\" is described at %s\n", new->so_name,
+ paddress (target_gdbarch, lm));
printf (" 'version' is %d\n", new->lm_info->struct_version);
printf (" 'bind_mode' is %d\n", new->lm_info->bind_mode);
printf (" 'library_version' is %d\n",
new->lm_info->library_version);
- printf (" 'text_addr' is 0x%s\n",
- paddr_nz (new->lm_info->text_addr));
- printf (" 'text_link_addr' is 0x%s\n",
- paddr_nz (new->lm_info->text_link_addr));
- printf (" 'text_end' is 0x%s\n",
- paddr_nz (new->lm_info->text_end));
- printf (" 'data_start' is 0x%s\n",
- paddr_nz (new->lm_info->data_start));
- printf (" 'bss_start' is 0x%s\n",
- paddr_nz (new->lm_info->bss_start));
- printf (" 'data_end' is 0x%s\n",
- paddr_nz (new->lm_info->data_end));
- printf (" 'got_value' is %s\n",
- paddr_nz (new->lm_info->got_value));
- printf (" 'tsd_start_addr' is 0x%s\n",
- paddr_nz (new->lm_info->tsd_start_addr));
+ printf (" 'text_addr' is %s\n",
+ paddress (target_gdbarch, new->lm_info->text_addr));
+ printf (" 'text_link_addr' is %s\n",
+ paddress (target_gdbarch, new->lm_info->text_link_addr));
+ printf (" 'text_end' is %s\n",
+ paddress (target_gdbarch, new->lm_info->text_end));
+ printf (" 'data_start' is %s\n",
+ paddress (target_gdbarch, new->lm_info->data_start));
+ printf (" 'bss_start' is %s\n",
+ paddress (target_gdbarch, new->lm_info->bss_start));
+ printf (" 'data_end' is %s\n",
+ paddress (target_gdbarch, new->lm_info->data_end));
+ printf (" 'got_value' is %s\n",
+ paddress (target_gdbarch, new->lm_info->got_value));
+ printf (" 'tsd_start_addr' is %s\n",
+ paddress (target_gdbarch, new->lm_info->tsd_start_addr));
#endif
new->addr_low = lmi->text_addr;
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+#include "arch-utils.h"
#include "symtab.h"
#include "expression.h"
#include "language.h"
/* Don't index off the end of the line_charpos array. */
return 0;
annotate_source (s->fullname, line, s->line_charpos[line - 1],
- mid_statement, pc);
+ mid_statement, get_objfile_arch (s->objfile), pc);
current_source_line = line;
first_line_listed = line;
if (sal.symtab == 0)
{
+ struct gdbarch *gdbarch = get_current_arch ();
+
printf_filtered (_("No line number information available"));
if (sal.pc != 0)
{
address. */
printf_filtered (" for address ");
wrap_here (" ");
- print_address (sal.pc, gdb_stdout);
+ print_address (gdbarch, sal.pc, gdb_stdout);
}
else
printf_filtered (".");
else if (sal.line > 0
&& find_line_pc_range (sal, &start_pc, &end_pc))
{
+ struct gdbarch *gdbarch = get_objfile_arch (sal.symtab->objfile);
+
if (start_pc == end_pc)
{
printf_filtered ("Line %d of \"%s\"",
sal.line, sal.symtab->filename);
wrap_here (" ");
printf_filtered (" is at address ");
- print_address (start_pc, gdb_stdout);
+ print_address (gdbarch, start_pc, gdb_stdout);
wrap_here (" ");
printf_filtered (" but contains no code.\n");
}
sal.line, sal.symtab->filename);
wrap_here (" ");
printf_filtered (" starts at address ");
- print_address (start_pc, gdb_stdout);
+ print_address (gdbarch, start_pc, gdb_stdout);
wrap_here (" ");
printf_filtered (" and ends at ");
- print_address (end_pc, gdb_stdout);
+ print_address (gdbarch, end_pc, gdb_stdout);
printf_filtered (".\n");
}
/* x/i should display this line's code. */
- set_next_address (get_objfile_arch (sal.symtab->objfile), start_pc);
+ set_next_address (gdbarch, start_pc);
/* Repeating "info line" should do the following line. */
last_line_listed = sal.line + 1;
print_frame_info (struct frame_info *frame, int print_level,
enum print_what print_what, int print_args)
{
+ struct gdbarch *gdbarch = get_frame_arch (frame);
struct symtab_and_line sal;
int source_print;
int location_print;
= make_cleanup_ui_out_tuple_begin_end (uiout, "frame");
annotate_frame_begin (print_level ? frame_relative_level (frame) : 0,
- get_frame_pc (frame));
+ gdbarch, get_frame_pc (frame));
/* Do this regardless of SOURCE because we don't have any source
to list for this frame. */
if (ui_out_is_mi_like_p (uiout))
{
annotate_frame_address ();
- ui_out_field_core_addr (uiout, "addr", get_frame_pc (frame));
+ ui_out_field_core_addr (uiout, "addr",
+ gdbarch, get_frame_pc (frame));
annotate_frame_address_end ();
}
ability to decide for themselves if it is desired. */
if (opts.addressprint && mid_statement)
{
- ui_out_field_core_addr (uiout, "addr", get_frame_pc (frame));
+ ui_out_field_core_addr (uiout, "addr",
+ gdbarch, get_frame_pc (frame));
ui_out_text (uiout, "\t");
}
enum print_what print_what, int print_args,
struct symtab_and_line sal)
{
+ struct gdbarch *gdbarch = get_frame_arch (frame);
char *funname = NULL;
enum language funlang = language_unknown;
struct ui_stream *stb;
find_frame_funname (frame, &funname, &funlang);
annotate_frame_begin (print_level ? frame_relative_level (frame) : 0,
- get_frame_pc (frame));
+ gdbarch, get_frame_pc (frame));
list_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "frame");
|| print_what == LOC_AND_ADDRESS)
{
annotate_frame_address ();
- ui_out_field_core_addr (uiout, "addr", get_frame_pc (frame));
+ ui_out_field_core_addr (uiout, "addr", gdbarch, get_frame_pc (frame));
annotate_frame_address_end ();
ui_out_text (uiout, " in ");
}
{
printf_filtered (_("Stack frame at "));
}
- fputs_filtered (paddress (get_frame_base (fi)), gdb_stdout);
+ fputs_filtered (paddress (gdbarch, get_frame_base (fi)), gdb_stdout);
printf_filtered (":\n");
printf_filtered (" %s = ", pc_regname);
- fputs_filtered (paddress (get_frame_pc (fi)), gdb_stdout);
+ fputs_filtered (paddress (gdbarch, get_frame_pc (fi)), gdb_stdout);
wrap_here (" ");
if (funname)
puts_filtered ("; ");
wrap_here (" ");
printf_filtered ("saved %s ", pc_regname);
- fputs_filtered (paddress (frame_unwind_caller_pc (fi)), gdb_stdout);
+ fputs_filtered (paddress (gdbarch, frame_unwind_caller_pc (fi)), gdb_stdout);
printf_filtered ("\n");
if (calling_frame_info == NULL)
else
{
printf_filtered (" called by frame at ");
- fputs_filtered (paddress (get_frame_base (calling_frame_info)),
+ fputs_filtered (paddress (gdbarch, get_frame_base (calling_frame_info)),
gdb_stdout);
}
if (get_next_frame (fi) && calling_frame_info)
if (get_next_frame (fi))
{
printf_filtered (" caller of frame at ");
- fputs_filtered (paddress (get_frame_base (get_next_frame (fi))),
+ fputs_filtered (paddress (gdbarch, get_frame_base (get_next_frame (fi))),
gdb_stdout);
}
if (get_next_frame (fi) || calling_frame_info)
else
{
printf_filtered (" Arglist at ");
- fputs_filtered (paddress (arg_list), gdb_stdout);
+ fputs_filtered (paddress (gdbarch, arg_list), gdb_stdout);
printf_filtered (",");
if (!gdbarch_frame_num_args_p (gdbarch))
else
{
printf_filtered (" Locals at ");
- fputs_filtered (paddress (arg_list), gdb_stdout);
+ fputs_filtered (paddress (gdbarch, arg_list), gdb_stdout);
printf_filtered (",");
}
}
register_size (gdbarch,
gdbarch_sp_regnum (gdbarch)));
printf_filtered (" Previous frame's sp is ");
- fputs_filtered (paddress (sp), gdb_stdout);
+ fputs_filtered (paddress (gdbarch, sp), gdb_stdout);
printf_filtered ("\n");
need_nl = 0;
}
else if (!optimized && lval == lval_memory)
{
printf_filtered (" Previous frame's sp at ");
- fputs_filtered (paddress (addr), gdb_stdout);
+ fputs_filtered (paddress (gdbarch, addr), gdb_stdout);
printf_filtered ("\n");
need_nl = 0;
}
wrap_here (" ");
printf_filtered (" %s at ",
gdbarch_register_name (gdbarch, i));
- fputs_filtered (paddress (addr), gdb_stdout);
+ fputs_filtered (paddress (gdbarch, addr), gdb_stdout);
count++;
}
}
/* Same, but print labels. */
static int
-print_block_frame_labels (struct block *b, int *have_default,
- struct ui_file *stream)
+print_block_frame_labels (struct gdbarch *gdbarch, struct block *b,
+ int *have_default, struct ui_file *stream)
{
struct dict_iterator iter;
struct symbol *sym;
if (opts.addressprint)
{
fprintf_filtered (stream, " ");
- fputs_filtered (paddress (SYMBOL_VALUE_ADDRESS (sym)), stream);
+ fputs_filtered (paddress (gdbarch, SYMBOL_VALUE_ADDRESS (sym)),
+ stream);
}
fprintf_filtered (stream, " in file %s, line %d\n",
sal.symtab->filename, sal.line);
#else
struct blockvector *bl;
struct block *block = get_frame_block (frame, 0);
+ struct gdbarch *gdbarch = get_frame_arch (frame);
int values_printed = 0;
int index, have_default = 0;
char *blocks_printed;
{
if (blocks_printed[index] == 0)
{
- if (print_block_frame_labels (BLOCKVECTOR_BLOCK (bl, index),
+ if (print_block_frame_labels (gdbarch,
+ BLOCKVECTOR_BLOCK (bl, index),
&have_default, stream))
values_printed = 1;
blocks_printed[index] = 1;
}
args.bfd = bfd;
args.sysinfo_ehdr = sysinfo_ehdr;
- args.name = xstrprintf ("system-supplied DSO at 0x%s",
- paddr_nz (sysinfo_ehdr));
+ args.name = xstrprintf ("system-supplied DSO at %s",
+ paddress (target_gdbarch, sysinfo_ehdr));
/* Pass zero for FROM_TTY, because the action of loading the
vsyscall DSO was not triggered by the user, even if the user
typed "run" at the TTY. */
{
/* The write is just starting. Let the user know we've started
this section. */
- ui_out_message (uiout, 0, "Loading section %s, size 0x%s lma 0x%s\n",
- args->section_name, paddr_nz (args->section_size),
- paddr_nz (args->lma));
+ ui_out_message (uiout, 0, "Loading section %s, size %s lma %s\n",
+ args->section_name, hex_string (args->section_size),
+ paddress (target_gdbarch, args->lma));
return;
}
struct cleanup *verify_cleanups = make_cleanup (xfree, check);
if (target_read_memory (args->lma, check, bytes) != 0)
- error (_("Download verify read failed at 0x%s"),
- paddr (args->lma));
+ error (_("Download verify read failed at %s"),
+ paddress (target_gdbarch, args->lma));
if (memcmp (args->buffer, check, bytes) != 0)
- error (_("Download verify compare failed at 0x%s"),
- paddr (args->lma));
+ error (_("Download verify compare failed at %s"),
+ paddress (target_gdbarch, args->lma));
do_cleanups (verify_cleanups);
}
totals->data_count += bytes;
entry = bfd_get_start_address (loadfile_bfd);
ui_out_text (uiout, "Start address ");
- ui_out_field_fmt (uiout, "address", "0x%s", paddr_nz (entry));
+ ui_out_field_fmt (uiout, "address", "%s", paddress (target_gdbarch, entry));
ui_out_text (uiout, ", load size ");
ui_out_field_fmt (uiout, "load-size", "%lu", total_progress.data_count);
ui_out_text (uiout, "\n");
static void
add_symbol_file_command (char *args, int from_tty)
{
+ struct gdbarch *gdbarch = get_current_arch ();
char *filename = NULL;
int flags = OBJF_USERLOADED;
char *arg;
entered on the command line. */
section_addrs->other[sec_num].name = sec;
section_addrs->other[sec_num].addr = addr;
- printf_unfiltered ("\t%s_addr = %s\n", sec, paddress (addr));
+ printf_unfiltered ("\t%s_addr = %s\n", sec,
+ paddress (gdbarch, addr));
sec_num++;
/* The object's sections are initialized when a
ALL_OBJSECTIONS (objfile, osect)
if (section_is_mapped (osect))
{
+ struct gdbarch *gdbarch = get_objfile_arch (objfile);
const char *name;
bfd_vma lma, vma;
int size;
name = bfd_section_name (objfile->obfd, osect->the_bfd_section);
printf_filtered ("Section %s, loaded at ", name);
- fputs_filtered (paddress (lma), gdb_stdout);
+ fputs_filtered (paddress (gdbarch, lma), gdb_stdout);
puts_filtered (" - ");
- fputs_filtered (paddress (lma + size), gdb_stdout);
+ fputs_filtered (paddress (gdbarch, lma + size), gdb_stdout);
printf_filtered (", mapped at ");
- fputs_filtered (paddress (vma), gdb_stdout);
+ fputs_filtered (paddress (gdbarch, vma), gdb_stdout);
puts_filtered (" - ");
- fputs_filtered (paddress (vma + size), gdb_stdout);
+ fputs_filtered (paddress (gdbarch, vma + size), gdb_stdout);
puts_filtered ("\n");
nmapped++;
static int block_depth (struct block *);
-static void print_partial_symbols (struct partial_symbol **, int,
+static void print_partial_symbols (struct gdbarch *,
+ struct partial_symbol **, int,
char *, struct ui_file *);
void _initialize_symmisc (void);
struct print_symbol_args
{
+ struct gdbarch *gdbarch;
struct symbol *symbol;
int depth;
struct ui_file *outfile;
static void
dump_msymbols (struct objfile *objfile, struct ui_file *outfile)
{
+ struct gdbarch *gdbarch = get_objfile_arch (objfile);
struct minimal_symbol *msymbol;
int index;
char ms_type;
break;
}
fprintf_filtered (outfile, "[%2d] %c ", index, ms_type);
- fputs_filtered (paddress (SYMBOL_VALUE_ADDRESS (msymbol)), outfile);
+ fputs_filtered (paddress (gdbarch, SYMBOL_VALUE_ADDRESS (msymbol)),
+ outfile);
fprintf_filtered (outfile, " %s", SYMBOL_LINKAGE_NAME (msymbol));
if (section)
fprintf_filtered (outfile, " section %s",
dump_psymtab (struct objfile *objfile, struct partial_symtab *psymtab,
struct ui_file *outfile)
{
+ struct gdbarch *gdbarch = get_objfile_arch (objfile);
int i;
fprintf_filtered (outfile, "\nPartial symtab for source file %s ",
if (i != 0)
fprintf_filtered (outfile, ", ");
wrap_here (" ");
- fputs_filtered (paddress (ANOFFSET (psymtab->section_offsets, i)),
+ fputs_filtered (paddress (gdbarch,
+ ANOFFSET (psymtab->section_offsets, i)),
outfile);
}
fprintf_filtered (outfile, "\n");
fprintf_filtered (outfile, " Symbols cover text addresses ");
- fputs_filtered (paddress (psymtab->textlow), outfile);
+ fputs_filtered (paddress (gdbarch, psymtab->textlow), outfile);
fprintf_filtered (outfile, "-");
- fputs_filtered (paddress (psymtab->texthigh), outfile);
+ fputs_filtered (paddress (gdbarch, psymtab->texthigh), outfile);
fprintf_filtered (outfile, "\n");
fprintf_filtered (outfile, " Depends on %d other partial symtabs.\n",
psymtab->number_of_dependencies);
}
if (psymtab->n_global_syms > 0)
{
- print_partial_symbols (objfile->global_psymbols.list
+ print_partial_symbols (gdbarch,
+ objfile->global_psymbols.list
+ psymtab->globals_offset,
psymtab->n_global_syms, "Global", outfile);
}
if (psymtab->n_static_syms > 0)
{
- print_partial_symbols (objfile->static_psymbols.list
+ print_partial_symbols (gdbarch,
+ objfile->static_psymbols.list
+ psymtab->statics_offset,
psymtab->n_static_syms, "Static", outfile);
}
dump_symtab_1 (struct objfile *objfile, struct symtab *symtab,
struct ui_file *outfile)
{
+ struct gdbarch *gdbarch = get_objfile_arch (objfile);
int i;
struct dict_iterator iter;
int len, blen;
for (i = 0; i < len; i++)
{
fprintf_filtered (outfile, " line %d at ", l->item[i].line);
- fputs_filtered (paddress (l->item[i].pc), outfile);
+ fputs_filtered (paddress (gdbarch, l->item[i].pc), outfile);
fprintf_filtered (outfile, "\n");
}
}
wants it. */
fprintf_filtered (outfile, ", %d syms/buckets in ",
dict_size (BLOCK_DICT (b)));
- fputs_filtered (paddress (BLOCK_START (b)), outfile);
+ fputs_filtered (paddress (gdbarch, BLOCK_START (b)), outfile);
fprintf_filtered (outfile, "..");
- fputs_filtered (paddress (BLOCK_END (b)), outfile);
+ fputs_filtered (paddress (gdbarch, BLOCK_END (b)), outfile);
if (BLOCK_FUNCTION (b))
{
fprintf_filtered (outfile, ", function %s",
ALL_BLOCK_SYMBOLS (b, iter, sym)
{
struct print_symbol_args s;
+ s.gdbarch = gdbarch;
s.symbol = sym;
s.depth = depth + 1;
s.outfile = outfile;
static int
print_symbol (void *args)
{
+ struct gdbarch *gdbarch = ((struct print_symbol_args *) args)->gdbarch;
struct symbol *symbol = ((struct print_symbol_args *) args)->symbol;
int depth = ((struct print_symbol_args *) args)->depth;
struct ui_file *outfile = ((struct print_symbol_args *) args)->outfile;
if (SYMBOL_DOMAIN (symbol) == LABEL_DOMAIN)
{
fprintf_filtered (outfile, "label %s at ", SYMBOL_PRINT_NAME (symbol));
- fputs_filtered (paddress (SYMBOL_VALUE_ADDRESS (symbol)), outfile);
+ fputs_filtered (paddress (gdbarch, SYMBOL_VALUE_ADDRESS (symbol)),
+ outfile);
if (section)
fprintf_filtered (outfile, " section %s\n",
bfd_section_name (section->the_bfd_section->owner,
case LOC_STATIC:
fprintf_filtered (outfile, "static at ");
- fputs_filtered (paddress (SYMBOL_VALUE_ADDRESS (symbol)), outfile);
+ fputs_filtered (paddress (gdbarch, SYMBOL_VALUE_ADDRESS (symbol)),
+ outfile);
if (section)
fprintf_filtered (outfile, " section %s",
bfd_section_name (section->the_bfd_section->owner,
case LOC_LABEL:
fprintf_filtered (outfile, "label at ");
- fputs_filtered (paddress (SYMBOL_VALUE_ADDRESS (symbol)), outfile);
+ fputs_filtered (paddress (gdbarch, SYMBOL_VALUE_ADDRESS (symbol)),
+ outfile);
if (section)
fprintf_filtered (outfile, " section %s",
bfd_section_name (section->the_bfd_section->owner,
fprintf_filtered (outfile, "block object ");
gdb_print_host_address (SYMBOL_BLOCK_VALUE (symbol), outfile);
fprintf_filtered (outfile, ", ");
- fputs_filtered (paddress (BLOCK_START (SYMBOL_BLOCK_VALUE (symbol))),
+ fputs_filtered (paddress (gdbarch,
+ BLOCK_START (SYMBOL_BLOCK_VALUE (symbol))),
outfile);
fprintf_filtered (outfile, "..");
- fputs_filtered (paddress (BLOCK_END (SYMBOL_BLOCK_VALUE (symbol))),
+ fputs_filtered (paddress (gdbarch,
+ BLOCK_END (SYMBOL_BLOCK_VALUE (symbol))),
outfile);
if (section)
fprintf_filtered (outfile, " section %s",
}
static void
-print_partial_symbols (struct partial_symbol **p, int count, char *what,
+print_partial_symbols (struct gdbarch *gdbarch,
+ struct partial_symbol **p, int count, char *what,
struct ui_file *outfile)
{
fprintf_filtered (outfile, " %s partial symbols:\n", what);
break;
}
fputs_filtered (", ", outfile);
- fputs_filtered (paddress (SYMBOL_VALUE_ADDRESS (*p)), outfile);
+ fputs_filtered (paddress (gdbarch, SYMBOL_VALUE_ADDRESS (*p)), outfile);
fprintf_filtered (outfile, "\n");
p++;
}
ALL_OBJFILES (objfile)
{
+ struct gdbarch *gdbarch = get_objfile_arch (objfile);
struct partial_symtab *psymtab;
/* We don't want to print anything for this objfile until we
printf_filtered (" fullname %s\n",
psymtab->fullname ? psymtab->fullname : "(null)");
printf_filtered (" text addresses ");
- fputs_filtered (paddress (psymtab->textlow), gdb_stdout);
+ fputs_filtered (paddress (gdbarch, psymtab->textlow),
+ gdb_stdout);
printf_filtered (" -- ");
- fputs_filtered (paddress (psymtab->texthigh), gdb_stdout);
+ fputs_filtered (paddress (gdbarch, psymtab->texthigh),
+ gdb_stdout);
printf_filtered ("\n");
printf_filtered (" globals ");
if (psymtab->n_global_syms)
ALL_PSYMTABS (objfile, ps)
{
+ struct gdbarch *gdbarch = get_objfile_arch (objfile);
s = PSYMTAB_TO_SYMTAB (ps);
if (s == NULL)
continue;
printf_filtered ("Psymtab ");
puts_filtered (ps->filename);
printf_filtered (" covers bad range ");
- fputs_filtered (paddress (ps->textlow), gdb_stdout);
+ fputs_filtered (paddress (gdbarch, ps->textlow), gdb_stdout);
printf_filtered (" - ");
- fputs_filtered (paddress (ps->texthigh), gdb_stdout);
+ fputs_filtered (paddress (gdbarch, ps->texthigh), gdb_stdout);
printf_filtered ("\n");
continue;
}
printf_filtered ("Psymtab ");
puts_filtered (ps->filename);
printf_filtered (" covers ");
- fputs_filtered (paddress (ps->textlow), gdb_stdout);
+ fputs_filtered (paddress (gdbarch, ps->textlow), gdb_stdout);
printf_filtered (" - ");
- fputs_filtered (paddress (ps->texthigh), gdb_stdout);
+ fputs_filtered (paddress (gdbarch, ps->texthigh), gdb_stdout);
printf_filtered (" but symtab covers only ");
- fputs_filtered (paddress (BLOCK_START (b)), gdb_stdout);
+ fputs_filtered (paddress (gdbarch, BLOCK_START (b)), gdb_stdout);
printf_filtered (" - ");
- fputs_filtered (paddress (BLOCK_END (b)), gdb_stdout);
+ fputs_filtered (paddress (gdbarch, BLOCK_END (b)), gdb_stdout);
printf_filtered ("\n");
}
}
will cause a core dump), but maybe we can successfully
continue, so let's not. */
warning (_("\
-(Internal error: pc 0x%s in read in psymtab, but not in symtab.)\n"),
- paddr_nz (pc));
+(Internal error: pc %s in read in psymtab, but not in symtab.)\n"),
+ paddress (get_objfile_arch (ps->objfile), pc));
s = PSYMTAB_TO_SYMTAB (ps);
}
return (s);
{
if (targetdebug)
fprintf_unfiltered (gdb_stdlog, "target_flash_erase (%s, %s)\n",
- paddr (address), phex (length, 0));
+ hex_string (address), phex (length, 0));
t->to_flash_erase (t, address, length);
return;
}
fprintf_unfiltered (gdb_stdlog,
"target_xfer_memory (%s, xxx, %d, %s, xxx) = %d",
- paddress (memaddr), len, write ? "write" : "read",
- retval);
+ paddress (target_gdbarch, memaddr), len,
+ write ? "write" : "read", retval);
if (retval > 0)
{
+2009-07-02 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
+
+ * gdb.threads/tls-shared.exp: Update to locexpr_describe_location
+ change to prefix TLS offset in hex with 0x.
+
2009-07-02 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
* gdb.base/default.exp: Update test case for "x" changes.
gdb_test "ptype i_tls" "int" "ptype of thread local storage variable"
gdb_test "info address i_tls" \
- "Symbol \\\"i_tls\\\" is a thread-local variable at offset 0 in the thread-local storage for .*tls-main.." \
+ "Symbol \\\"i_tls\\\" is a thread-local variable at offset 0x0 in the thread-local storage for .*tls-main.." \
"print storage info for thread local storage variable"
set line_number [gdb_get_line_number "break here to check result"]
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+#include "arch-utils.h"
#include "symtab.h"
#include "frame.h"
#include "gdbtypes.h"
old_chain = make_cleanup (xfree, sals.sals);
if (sal.symtab == 0)
{
+ struct gdbarch *gdbarch = get_current_arch ();
+
printf_filtered ("TFIND: No line number information available");
if (sal.pc != 0)
{
have the symbolic address. */
printf_filtered (" for address ");
wrap_here (" ");
- print_address (sal.pc, gdb_stdout);
+ print_address (gdbarch, sal.pc, gdb_stdout);
printf_filtered (";\n -- will attempt to find by PC. \n");
}
else
else if (sal.line > 0
&& find_line_pc_range (sal, &start_pc, &end_pc))
{
+ struct gdbarch *gdbarch = get_objfile_arch (sal.symtab->objfile);
+
if (start_pc == end_pc)
{
printf_filtered ("Line %d of \"%s\"",
sal.line, sal.symtab->filename);
wrap_here (" ");
printf_filtered (" is at address ");
- print_address (start_pc, gdb_stdout);
+ print_address (gdbarch, start_pc, gdb_stdout);
wrap_here (" ");
printf_filtered (" but contains no code.\n");
sal = find_pc_line (start_pc, 0);
break;
case LOC_STATIC:
printf_filtered ("in static storage at address ");
- printf_filtered ("%s", paddress (SYMBOL_VALUE_ADDRESS (sym)));
+ printf_filtered ("%s", paddress (gdbarch,
+ SYMBOL_VALUE_ADDRESS (sym)));
break;
case LOC_REGISTER:
/* GDBARCH is the architecture associated with the objfile
continue;
case LOC_LABEL:
printf_filtered ("a label at address ");
- printf_filtered ("%s", paddress (SYMBOL_VALUE_ADDRESS (sym)));
+ printf_filtered ("%s", paddress (gdbarch,
+ SYMBOL_VALUE_ADDRESS (sym)));
break;
case LOC_BLOCK:
printf_filtered ("a function at address ");
- printf_filtered ("%s", paddress (BLOCK_START (SYMBOL_BLOCK_VALUE (sym))));
+ printf_filtered ("%s",
+ paddress (gdbarch, BLOCK_START (SYMBOL_BLOCK_VALUE (sym))));
break;
case LOC_UNRESOLVED:
msym = lookup_minimal_symbol (SYMBOL_LINKAGE_NAME (sym),
else
{
printf_filtered ("static storage at address ");
- printf_filtered ("%s", paddress (SYMBOL_VALUE_ADDRESS (msym)));
+ printf_filtered ("%s",
+ paddress (gdbarch, SYMBOL_VALUE_ADDRESS (msym)));
}
break;
case LOC_OPTIMIZED_OUT:
if (asm_lines->insn)
xfree (asm_lines->insn);
- print_address (pc, gdb_dis_out);
+ print_address (gdbarch, pc, gdb_dis_out);
asm_lines->addr = pc;
asm_lines->addr_string = xstrdup (tui_file_get_strbuf (gdb_dis_out));
/* Translate PC address. */
pc_out = tui_sfileopen (128);
- fputs_filtered (paddress (loc->addr), pc_out);
+ fputs_filtered (paddress (loc->gdbarch, loc->addr), pc_out);
pc_buf = tui_file_get_strbuf (pc_out);
pc_width = strlen (pc_buf);
void
ui_out_field_core_addr (struct ui_out *uiout,
const char *fldname,
+ struct gdbarch *gdbarch,
CORE_ADDR address)
{
char addstr[20];
- int addr_bit = gdbarch_addr_bit (current_gdbarch);
+ int addr_bit = gdbarch_addr_bit (gdbarch);
if (addr_bit < (sizeof (CORE_ADDR) * HOST_CHAR_BIT))
address &= ((CORE_ADDR) 1 << addr_bit) - 1;
int value);
extern void ui_out_field_core_addr (struct ui_out *uiout, const char *fldname,
- CORE_ADDR address);
+ struct gdbarch *gdbarch, CORE_ADDR address);
extern void ui_out_field_string (struct ui_out * uiout, const char *fldname,
const char *string);
return buf[cell];
}
-int
-strlen_paddr (void)
-{
- return (gdbarch_addr_bit (current_gdbarch) / 8 * 2);
-}
-
-char *
-paddr (CORE_ADDR addr)
-{
- return phex (addr, gdbarch_addr_bit (current_gdbarch) / 8);
-}
-
-char *
-paddr_nz (CORE_ADDR addr)
-{
- return phex_nz (addr, gdbarch_addr_bit (current_gdbarch) / 8);
-}
-
const char *
-paddress (CORE_ADDR addr)
+paddress (struct gdbarch *gdbarch, CORE_ADDR addr)
{
/* Truncate address to the size of a target address, avoiding shifts
larger or equal than the width of a CORE_ADDR. The local
either zero or sign extended. Should gdbarch_address_to_pointer or
some ADDRESS_TO_PRINTABLE() be used to do the conversion? */
- int addr_bit = gdbarch_addr_bit (current_gdbarch);
+ int addr_bit = gdbarch_addr_bit (gdbarch);
if (addr_bit < (sizeof (CORE_ADDR) * HOST_CHAR_BIT))
addr &= ((CORE_ADDR) 1 << addr_bit) - 1;
fprintf_unfiltered (gdb_stdlog, " register=%d",
VALUE_REGNUM (new_val));
else if (VALUE_LVAL (new_val) == lval_memory)
- fprintf_unfiltered (gdb_stdlog, " address=0x%s",
- paddr_nz (value_address (new_val)));
+ fprintf_unfiltered (gdb_stdlog, " address=%s",
+ paddress (gdbarch,
+ value_address (new_val)));
else
fprintf_unfiltered (gdb_stdlog, " computed");
int bytes_read;
gdb_byte *buffer = NULL; /* Dynamically growable fetch buffer. */
struct cleanup *old_chain = NULL; /* Top of the old cleanup chain. */
+ struct gdbarch *gdbarch = get_type_arch (elttype);
int width = TYPE_LENGTH (elttype);
/* First we need to figure out the limit on the number of characters we are
if (errcode == EIO)
{
fprintf_filtered (stream, " <Address ");
- fputs_filtered (paddress (addr), stream);
+ fputs_filtered (paddress (gdbarch, addr), stream);
fprintf_filtered (stream, " out of bounds>");
}
else
{
fprintf_filtered (stream, " <Error reading address ");
- fputs_filtered (paddress (addr), stream);
+ fputs_filtered (paddress (gdbarch, addr), stream);
fprintf_filtered (stream, ": %s>", safe_strerror (errcode));
}
}
struct frame_info;
struct fn_field;
-extern void print_address_demangle (CORE_ADDR, struct ui_file *, int);
+extern void print_address_demangle (struct gdbarch *, CORE_ADDR,
+ struct ui_file *, int);
extern LONGEST value_as_long (struct value *val);
extern DOUBLEST value_as_double (struct value *val);
obstack_grow_str (&obstack, "<library-list>\n");
for (so = solib_start.next; so; so = so->next)
windows_xfer_shared_library (so->so_name, (CORE_ADDR) (uintptr_t) so->lm_info->load_addr,
- &obstack);
+ target_gdbarch, &obstack);
obstack_grow_str0 (&obstack, "</library-list>\n");
buf = obstack_finish (&obstack);
void
windows_xfer_shared_library (const char* so_name, CORE_ADDR load_addr,
- struct obstack *obstack)
+ struct gdbarch *gdbarch, struct obstack *obstack)
{
char *p;
obstack_grow_str (obstack, "<library name=\"");
p = xml_escape_text (so_name);
obstack_grow_str (obstack, p);
xfree (p);
- obstack_grow_str (obstack, "\"><segment address=\"0x");
+ obstack_grow_str (obstack, "\"><segment address=\"");
/* The symbols in a dll are offset by 0x1000, which is the the
offset from 0 of the first byte in an image - because of the file
header and the section alignment. */
- p = paddr_nz (load_addr + 0x1000);
- obstack_grow_str (obstack, p);
+ obstack_grow_str (obstack, paddress (gdbarch, load_addr + 0x1000));
obstack_grow_str (obstack, "\"/></library>");
}
#define WINDOWS_TDEP_H
struct obstack;
+struct gdbarch;
extern void windows_xfer_shared_library (const char* so_name,
CORE_ADDR load_addr,
+ struct gdbarch *gdbarch,
struct obstack *obstack);
#endif
static void
solib_info (char *args, int from_tty)
{
+ int addr_size = gdbarch_addr_bit (target_gdbarch) / 8;
struct vmap *vp = vmap;
/* Check for new shared libraries loaded with load (). */
for (; vp != NULL; vp = vp->nxt)
{
printf_unfiltered ("0x%s-0x%s 0x%s-0x%s %s %s%s%s%s\n",
- paddr (vp->tstart),paddr (vp->tend),
- paddr (vp->dstart), paddr (vp->dend),
+ phex (vp->tstart, addr_size),
+ phex (vp->tend, addr_size),
+ phex (vp->dstart, addr_size),
+ phex (vp->dend, addr_size),
vp->loaded ? "Yes" : "No ",
vp->name,
*vp->member ? "(" : "",