diff options
Diffstat (limited to 'gdb/cli')
-rw-r--r-- | gdb/cli/cli-cmds.c | 25 | ||||
-rw-r--r-- | gdb/cli/cli-dump.c | 10 |
2 files changed, 24 insertions, 11 deletions
diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c index c9cdfbe..37b027b 100644 --- a/gdb/cli/cli-cmds.c +++ b/gdb/cli/cli-cmds.c @@ -672,17 +672,22 @@ edit_command (char *arg, int from_tty) 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); } @@ -832,17 +837,22 @@ list_command (char *arg, int from_tty) 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); } @@ -904,7 +914,8 @@ print_disassembly (struct gdbarch *gdbarch, const char *name, 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); diff --git a/gdb/cli/cli-dump.c b/gdb/cli/cli-dump.c index 82062a1..79d468e 100644 --- a/gdb/cli/cli-dump.c +++ b/gdb/cli/cli-dump.c @@ -488,11 +488,13 @@ restore_section_callback (bfd *ibfd, asection *isec, void *args) (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"); |