2002-09-30 15:57:26 +00:00
|
|
|
/* Disassemble support for GDB.
|
2003-01-13 Andrew Cagney <ac131313@redhat.com>
* ax-gdb.c, c-valprint.c, charset.c, corefile.c: Update copyright.
* demangle.c, disasm.c, dwarf2cfi.c, dwarfread.c: Update copyright.
* elfread.c, eval.c, expprint.c, expression.h: Update copyright.
* f-typeprint.c, findvar.c, gcore.c, gdb_mbuild.sh: Update copyright.
* gdbtypes.h, gnu-v2-abi.c, inferior.h, inftarg.c: Update copyright.
* language.c, language.h, m32r-tdep.c: Update copyright.
* mn10200-tdep.c, scm-lang.c, scm-lang.h: Update copyright.
* somsolib.c, somsolib.h, symfile.c, symtab.h: Update copyright.
* thread-db.c, typeprint.c, utils.c, valarith.c: Update copyright.
* values.c, win32-nat.c, x86-64-linux-nat.c: Update copyright.
* x86-64-linux-tdep.c, z8k-tdep.c: Update copyright.
* cli/cli-decode.h, config/h8500/tm-h8500.h: Update copyright.
Index: mi/ChangeLog
2003-01-13 Andrew Cagney <ac131313@redhat.com>
* mi-cmd-env.c: Update copyright.
2003-01-14 00:49:06 +00:00
|
|
|
|
2015-01-01 09:32:14 +00:00
|
|
|
Copyright (C) 2000-2015 Free Software Foundation, Inc.
|
2002-09-30 15:57:26 +00:00
|
|
|
|
|
|
|
This file is part of GDB.
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
2007-08-23 18:08:50 +00:00
|
|
|
the Free Software Foundation; either version 3 of the License, or
|
2002-09-30 15:57:26 +00:00
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
2007-08-23 18:08:50 +00:00
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
2002-09-30 15:57:26 +00:00
|
|
|
|
|
|
|
#include "defs.h"
|
|
|
|
#include "target.h"
|
|
|
|
#include "value.h"
|
|
|
|
#include "ui-out.h"
|
|
|
|
#include "disasm.h"
|
2003-04-30 Andrew Cagney <cagney@redhat.com>
* gdbarch.sh (deprecated_tm_print_insn_info): Rename
"tm_print_insn_info".
(TARGET_PRINT_INSN_INFO): Delete macro.
(dis_asm_read_memory): Delete function declaration.
(dis_asm_memory_error, dis_asm_print_address): Ditto.
(tm_print_insn_info): Delete variable definition.
(_initialize_gdbarch): Do not initialize "tm_print_insn_info".
* gdbarch.h, gdbarch.c: Re-generate.
* d10v-tdep.c (display_trace): Replace "tm_print_insn_info" with
"deprecated_tm_print_insn_info".
* mcore-tdep.c (mcore_dump_insn): Ditto.
* mips-tdep.c (mips_gdbarch_init): Ditto.
* sparc-tdep.c (_initialize_sparc_tdep): Ditto.
* v850-tdep.c (v850_scan_prologue, v850_gdbarch_init): Ditto.
* ia64-tdep.c (_initialize_ia64_tdep): Ditto.
* printcmd.c (print_insn): Use "deprecated_tm_print_insn_info"
instead of TARGET_PRINT_INSN_INFO, add comment.
* s390-tdep.c (s390_get_frame_info): Instead of
"dis_asm_read_memory", use "deprecated_tm_print_insn_info".
(s390_check_function_end, s390_is_sigreturn): Ditto.
* corefile.c (dis_asm_read_memory): Move to "disasm.c".
(dis_asm_memory_error, dis_asm_print_address): Ditto.
* disasm.c: Include "gdbcore.h".
(_initialize_disasm): New function, initialize
"deprecated_tm_print_insn_info".
(deprecated_tm_print_insn_info): New variable.
(dis_asm_read_memory): Moved from "corefile.c", made static.
(dis_asm_print_address, dis_asm_memory_error): Ditto.
* Makefile.in (disasm.o): Update dependencies.
2003-04-28 Andrew Cagney <cagney@redhat.com>
* gdbint.texinfo (Target Architecture Definition): Replace
read_fp, TARGET_READ_FP and FP_REGNUM, with deprecated_read_fp,
DEPRECATED_TARGET_READ_FP and DEPRECATED_REGNUM.
2003-04-30 22:01:38 +00:00
|
|
|
#include "gdbcore.h"
|
2003-09-04 Andrew Cagney <cagney@redhat.com>
* avr-tdep.c: Include "dis-asm.h".
* cris-tdep.c: Include "dis-asm.h".
(cris_delayed_get_disassembler): Use "struct disassemble_info"
instead of corresponding typedef.
* h8300-tdep.c: Include "dis-asm.h".
* ia64-tdep.c: Include "dis-asm.h".
* i386-tdep.c: Include "dis-asm.h".
(i386_print_insn): Use "struct disassemble_info" instead of
corresponding typedef.
* m68k-tdep.c: Include "dis-asm.h".
* mcore-tdep.c: Include "dis-asm.h".
* mips-tdep.c: Include "dis-asm.h".
(gdb_print_insn_mips): Make static, use "struct disassemble_info"
instead of corresponding typedef.
* ns32k-tdep.c: Include "dis-asm.h".
* s390-tdep.c: Include "dis-asm.h".
* sparc-tdep.c: Include "dis-asm.h".
* vax-tdep.c: Include "dis-asm.h".
* v850-tdep.c: Include "dis-asm.h".
* mn10300-tdep.c: Include "dis-asm.h".
* rs6000-tdep.c: Include "dis-asm.h".
* xstormy16-tdep.c: Include "dis-asm.h".
(_initialize_xstormy16_tdep): Delete "extern" declaration of
print_insn_xstormy16.
* Makefile.in (v850-tdep.o): Update dependencies.
(vax-tdep.o, sparc-tdep.o, s390-tdep.o): Ditto.
(ns32k-tdep.o, mips-tdep.o, mcore-tdep.o): Ditto.
(m68k-tdep.o, ia64-tdep.o, i386-tdep.o): Ditto.
(h8300-tdep.o, cris-tdep.o, avr-tdep.o): Ditto.
(mn10300-tdep.o, xstormy16-tdep.o, disasm.o): Ditto.
(gdbarch_h): Remove $(dis_asm_h).
* disasm.c: Include "dis-asm.h".
(dis_asm_read_memory): Use "struct disassemble_info" instead of
corresponding typedef.
(dis_asm_memory_error, dump_insns, do_assembly_only): Ditto.
(gdb_disassemble_info, gdb_disassembly, gdb_print_insn): Ditto.
* gdbarch.sh: Do not include "dis-asm.h".
(struct disassemble_info): Declare opaque.
(TARGET_PRINT_INSN): Update declaration.
* gdbarch.h, gdbarch.c: Re-generate.
2003-09-09 04:41:32 +00:00
|
|
|
#include "dis-asm.h"
|
2015-08-15 04:45:54 +00:00
|
|
|
#include "source.h"
|
2002-09-30 15:57:26 +00:00
|
|
|
|
|
|
|
/* Disassemble functions.
|
|
|
|
FIXME: We should get rid of all the duplicate code in gdb that does
|
2011-01-07 19:36:19 +00:00
|
|
|
the same thing: disassemble_command() and the gdbtk variation. */
|
2002-09-30 15:57:26 +00:00
|
|
|
|
2015-08-15 04:45:54 +00:00
|
|
|
/* This structure is used to store line number information for the
|
|
|
|
deprecated /m option.
|
2002-09-30 15:57:26 +00:00
|
|
|
We need a different sort of line table from the normal one cuz we can't
|
|
|
|
depend upon implicit line-end pc's for lines to do the
|
|
|
|
reordering in this function. */
|
|
|
|
|
2015-08-15 04:45:54 +00:00
|
|
|
struct deprecated_dis_line_entry
|
2002-09-30 15:57:26 +00:00
|
|
|
{
|
|
|
|
int line;
|
|
|
|
CORE_ADDR start_pc;
|
|
|
|
CORE_ADDR end_pc;
|
|
|
|
};
|
|
|
|
|
2015-08-15 04:45:54 +00:00
|
|
|
/* This Structure is used to store line number information.
|
|
|
|
We need a different sort of line table from the normal one cuz we can't
|
|
|
|
depend upon implicit line-end pc's for lines to do the
|
|
|
|
reordering in this function. */
|
|
|
|
|
|
|
|
struct dis_line_entry
|
|
|
|
{
|
|
|
|
struct symtab *symtab;
|
|
|
|
int line;
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Hash function for dis_line_entry. */
|
|
|
|
|
|
|
|
static hashval_t
|
|
|
|
hash_dis_line_entry (const void *item)
|
|
|
|
{
|
|
|
|
const struct dis_line_entry *dle = item;
|
|
|
|
|
|
|
|
return htab_hash_pointer (dle->symtab) + dle->line;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Equal function for dis_line_entry. */
|
|
|
|
|
|
|
|
static int
|
|
|
|
eq_dis_line_entry (const void *item_lhs, const void *item_rhs)
|
|
|
|
{
|
|
|
|
const struct dis_line_entry *lhs = item_lhs;
|
|
|
|
const struct dis_line_entry *rhs = item_rhs;
|
|
|
|
|
|
|
|
return (lhs->symtab == rhs->symtab
|
|
|
|
&& lhs->line == rhs->line);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Create the table to manage lines for mixed source/disassembly. */
|
|
|
|
|
|
|
|
static htab_t
|
|
|
|
allocate_dis_line_table (void)
|
|
|
|
{
|
|
|
|
return htab_create_alloc (41,
|
|
|
|
hash_dis_line_entry, eq_dis_line_entry,
|
|
|
|
xfree, xcalloc, xfree);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Add DLE to TABLE.
|
|
|
|
Returns 1 if added, 0 if already present. */
|
|
|
|
|
|
|
|
static void
|
|
|
|
maybe_add_dis_line_entry (htab_t table, struct symtab *symtab, int line)
|
|
|
|
{
|
|
|
|
void **slot;
|
|
|
|
struct dis_line_entry dle, *dlep;
|
|
|
|
|
|
|
|
dle.symtab = symtab;
|
|
|
|
dle.line = line;
|
|
|
|
slot = htab_find_slot (table, &dle, INSERT);
|
|
|
|
if (*slot == NULL)
|
|
|
|
{
|
|
|
|
dlep = XNEW (struct dis_line_entry);
|
|
|
|
dlep->symtab = symtab;
|
|
|
|
dlep->line = line;
|
|
|
|
*slot = dlep;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Return non-zero if SYMTAB, LINE are in TABLE. */
|
|
|
|
|
|
|
|
static int
|
|
|
|
line_has_code_p (htab_t table, struct symtab *symtab, int line)
|
|
|
|
{
|
|
|
|
struct dis_line_entry dle;
|
|
|
|
|
|
|
|
dle.symtab = symtab;
|
|
|
|
dle.line = line;
|
|
|
|
return htab_find (table, &dle) != NULL;
|
|
|
|
}
|
|
|
|
|
2003-04-30 Andrew Cagney <cagney@redhat.com>
* gdbarch.sh (deprecated_tm_print_insn_info): Rename
"tm_print_insn_info".
(TARGET_PRINT_INSN_INFO): Delete macro.
(dis_asm_read_memory): Delete function declaration.
(dis_asm_memory_error, dis_asm_print_address): Ditto.
(tm_print_insn_info): Delete variable definition.
(_initialize_gdbarch): Do not initialize "tm_print_insn_info".
* gdbarch.h, gdbarch.c: Re-generate.
* d10v-tdep.c (display_trace): Replace "tm_print_insn_info" with
"deprecated_tm_print_insn_info".
* mcore-tdep.c (mcore_dump_insn): Ditto.
* mips-tdep.c (mips_gdbarch_init): Ditto.
* sparc-tdep.c (_initialize_sparc_tdep): Ditto.
* v850-tdep.c (v850_scan_prologue, v850_gdbarch_init): Ditto.
* ia64-tdep.c (_initialize_ia64_tdep): Ditto.
* printcmd.c (print_insn): Use "deprecated_tm_print_insn_info"
instead of TARGET_PRINT_INSN_INFO, add comment.
* s390-tdep.c (s390_get_frame_info): Instead of
"dis_asm_read_memory", use "deprecated_tm_print_insn_info".
(s390_check_function_end, s390_is_sigreturn): Ditto.
* corefile.c (dis_asm_read_memory): Move to "disasm.c".
(dis_asm_memory_error, dis_asm_print_address): Ditto.
* disasm.c: Include "gdbcore.h".
(_initialize_disasm): New function, initialize
"deprecated_tm_print_insn_info".
(deprecated_tm_print_insn_info): New variable.
(dis_asm_read_memory): Moved from "corefile.c", made static.
(dis_asm_print_address, dis_asm_memory_error): Ditto.
* Makefile.in (disasm.o): Update dependencies.
2003-04-28 Andrew Cagney <cagney@redhat.com>
* gdbint.texinfo (Target Architecture Definition): Replace
read_fp, TARGET_READ_FP and FP_REGNUM, with deprecated_read_fp,
DEPRECATED_TARGET_READ_FP and DEPRECATED_REGNUM.
2003-04-30 22:01:38 +00:00
|
|
|
/* Like target_read_memory, but slightly different parameters. */
|
|
|
|
static int
|
2005-05-16 Andrew Cagney <cagney@gnu.org>
* target.h (target_read_partial, target_write_partial)
(do_xfer_memory, xfer_memory, target_read, target_write)
(get_target_memory): For buffers, change "void*" to gdb_byte.
(struct target_ops): Ditto for to_xfer_partial and
deprecated_xfer_memory.
* dcache.h (dcache_xfer_memory): Ditto.
* target.c (default_xfer_partial, target_read_partial)
(target_write_partial, target_read, target_write)
(do_xfer_memory, update_current_target, get_target_memory): Update.
(target_read_string): Change buf to a gdb_byte.
* dcache.c (dcache_xfer_memory): Update.
* exec.c (xfer_memory): Make buffer type to gdb_byte.
* mem-break.c (default_memory_insert_breakpoint): Remove cast.
* disasm.c (dis_asm_read_memory): Remove cast, use gdb_byte.
2005-05-16 04:45:43 +00:00
|
|
|
dis_asm_read_memory (bfd_vma memaddr, gdb_byte *myaddr, unsigned int len,
|
2003-09-04 Andrew Cagney <cagney@redhat.com>
* avr-tdep.c: Include "dis-asm.h".
* cris-tdep.c: Include "dis-asm.h".
(cris_delayed_get_disassembler): Use "struct disassemble_info"
instead of corresponding typedef.
* h8300-tdep.c: Include "dis-asm.h".
* ia64-tdep.c: Include "dis-asm.h".
* i386-tdep.c: Include "dis-asm.h".
(i386_print_insn): Use "struct disassemble_info" instead of
corresponding typedef.
* m68k-tdep.c: Include "dis-asm.h".
* mcore-tdep.c: Include "dis-asm.h".
* mips-tdep.c: Include "dis-asm.h".
(gdb_print_insn_mips): Make static, use "struct disassemble_info"
instead of corresponding typedef.
* ns32k-tdep.c: Include "dis-asm.h".
* s390-tdep.c: Include "dis-asm.h".
* sparc-tdep.c: Include "dis-asm.h".
* vax-tdep.c: Include "dis-asm.h".
* v850-tdep.c: Include "dis-asm.h".
* mn10300-tdep.c: Include "dis-asm.h".
* rs6000-tdep.c: Include "dis-asm.h".
* xstormy16-tdep.c: Include "dis-asm.h".
(_initialize_xstormy16_tdep): Delete "extern" declaration of
print_insn_xstormy16.
* Makefile.in (v850-tdep.o): Update dependencies.
(vax-tdep.o, sparc-tdep.o, s390-tdep.o): Ditto.
(ns32k-tdep.o, mips-tdep.o, mcore-tdep.o): Ditto.
(m68k-tdep.o, ia64-tdep.o, i386-tdep.o): Ditto.
(h8300-tdep.o, cris-tdep.o, avr-tdep.o): Ditto.
(mn10300-tdep.o, xstormy16-tdep.o, disasm.o): Ditto.
(gdbarch_h): Remove $(dis_asm_h).
* disasm.c: Include "dis-asm.h".
(dis_asm_read_memory): Use "struct disassemble_info" instead of
corresponding typedef.
(dis_asm_memory_error, dump_insns, do_assembly_only): Ditto.
(gdb_disassemble_info, gdb_disassembly, gdb_print_insn): Ditto.
* gdbarch.sh: Do not include "dis-asm.h".
(struct disassemble_info): Declare opaque.
(TARGET_PRINT_INSN): Update declaration.
* gdbarch.h, gdbarch.c: Re-generate.
2003-09-09 04:41:32 +00:00
|
|
|
struct disassemble_info *info)
|
2003-04-30 Andrew Cagney <cagney@redhat.com>
* gdbarch.sh (deprecated_tm_print_insn_info): Rename
"tm_print_insn_info".
(TARGET_PRINT_INSN_INFO): Delete macro.
(dis_asm_read_memory): Delete function declaration.
(dis_asm_memory_error, dis_asm_print_address): Ditto.
(tm_print_insn_info): Delete variable definition.
(_initialize_gdbarch): Do not initialize "tm_print_insn_info".
* gdbarch.h, gdbarch.c: Re-generate.
* d10v-tdep.c (display_trace): Replace "tm_print_insn_info" with
"deprecated_tm_print_insn_info".
* mcore-tdep.c (mcore_dump_insn): Ditto.
* mips-tdep.c (mips_gdbarch_init): Ditto.
* sparc-tdep.c (_initialize_sparc_tdep): Ditto.
* v850-tdep.c (v850_scan_prologue, v850_gdbarch_init): Ditto.
* ia64-tdep.c (_initialize_ia64_tdep): Ditto.
* printcmd.c (print_insn): Use "deprecated_tm_print_insn_info"
instead of TARGET_PRINT_INSN_INFO, add comment.
* s390-tdep.c (s390_get_frame_info): Instead of
"dis_asm_read_memory", use "deprecated_tm_print_insn_info".
(s390_check_function_end, s390_is_sigreturn): Ditto.
* corefile.c (dis_asm_read_memory): Move to "disasm.c".
(dis_asm_memory_error, dis_asm_print_address): Ditto.
* disasm.c: Include "gdbcore.h".
(_initialize_disasm): New function, initialize
"deprecated_tm_print_insn_info".
(deprecated_tm_print_insn_info): New variable.
(dis_asm_read_memory): Moved from "corefile.c", made static.
(dis_asm_print_address, dis_asm_memory_error): Ditto.
* Makefile.in (disasm.o): Update dependencies.
2003-04-28 Andrew Cagney <cagney@redhat.com>
* gdbint.texinfo (Target Architecture Definition): Replace
read_fp, TARGET_READ_FP and FP_REGNUM, with deprecated_read_fp,
DEPRECATED_TARGET_READ_FP and DEPRECATED_REGNUM.
2003-04-30 22:01:38 +00:00
|
|
|
{
|
2013-11-01 04:28:54 +00:00
|
|
|
return target_read_code (memaddr, myaddr, len);
|
2003-04-30 Andrew Cagney <cagney@redhat.com>
* gdbarch.sh (deprecated_tm_print_insn_info): Rename
"tm_print_insn_info".
(TARGET_PRINT_INSN_INFO): Delete macro.
(dis_asm_read_memory): Delete function declaration.
(dis_asm_memory_error, dis_asm_print_address): Ditto.
(tm_print_insn_info): Delete variable definition.
(_initialize_gdbarch): Do not initialize "tm_print_insn_info".
* gdbarch.h, gdbarch.c: Re-generate.
* d10v-tdep.c (display_trace): Replace "tm_print_insn_info" with
"deprecated_tm_print_insn_info".
* mcore-tdep.c (mcore_dump_insn): Ditto.
* mips-tdep.c (mips_gdbarch_init): Ditto.
* sparc-tdep.c (_initialize_sparc_tdep): Ditto.
* v850-tdep.c (v850_scan_prologue, v850_gdbarch_init): Ditto.
* ia64-tdep.c (_initialize_ia64_tdep): Ditto.
* printcmd.c (print_insn): Use "deprecated_tm_print_insn_info"
instead of TARGET_PRINT_INSN_INFO, add comment.
* s390-tdep.c (s390_get_frame_info): Instead of
"dis_asm_read_memory", use "deprecated_tm_print_insn_info".
(s390_check_function_end, s390_is_sigreturn): Ditto.
* corefile.c (dis_asm_read_memory): Move to "disasm.c".
(dis_asm_memory_error, dis_asm_print_address): Ditto.
* disasm.c: Include "gdbcore.h".
(_initialize_disasm): New function, initialize
"deprecated_tm_print_insn_info".
(deprecated_tm_print_insn_info): New variable.
(dis_asm_read_memory): Moved from "corefile.c", made static.
(dis_asm_print_address, dis_asm_memory_error): Ditto.
* Makefile.in (disasm.o): Update dependencies.
2003-04-28 Andrew Cagney <cagney@redhat.com>
* gdbint.texinfo (Target Architecture Definition): Replace
read_fp, TARGET_READ_FP and FP_REGNUM, with deprecated_read_fp,
DEPRECATED_TARGET_READ_FP and DEPRECATED_REGNUM.
2003-04-30 22:01:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Like memory_error with slightly different parameters. */
|
|
|
|
static void
|
2003-09-04 Andrew Cagney <cagney@redhat.com>
* avr-tdep.c: Include "dis-asm.h".
* cris-tdep.c: Include "dis-asm.h".
(cris_delayed_get_disassembler): Use "struct disassemble_info"
instead of corresponding typedef.
* h8300-tdep.c: Include "dis-asm.h".
* ia64-tdep.c: Include "dis-asm.h".
* i386-tdep.c: Include "dis-asm.h".
(i386_print_insn): Use "struct disassemble_info" instead of
corresponding typedef.
* m68k-tdep.c: Include "dis-asm.h".
* mcore-tdep.c: Include "dis-asm.h".
* mips-tdep.c: Include "dis-asm.h".
(gdb_print_insn_mips): Make static, use "struct disassemble_info"
instead of corresponding typedef.
* ns32k-tdep.c: Include "dis-asm.h".
* s390-tdep.c: Include "dis-asm.h".
* sparc-tdep.c: Include "dis-asm.h".
* vax-tdep.c: Include "dis-asm.h".
* v850-tdep.c: Include "dis-asm.h".
* mn10300-tdep.c: Include "dis-asm.h".
* rs6000-tdep.c: Include "dis-asm.h".
* xstormy16-tdep.c: Include "dis-asm.h".
(_initialize_xstormy16_tdep): Delete "extern" declaration of
print_insn_xstormy16.
* Makefile.in (v850-tdep.o): Update dependencies.
(vax-tdep.o, sparc-tdep.o, s390-tdep.o): Ditto.
(ns32k-tdep.o, mips-tdep.o, mcore-tdep.o): Ditto.
(m68k-tdep.o, ia64-tdep.o, i386-tdep.o): Ditto.
(h8300-tdep.o, cris-tdep.o, avr-tdep.o): Ditto.
(mn10300-tdep.o, xstormy16-tdep.o, disasm.o): Ditto.
(gdbarch_h): Remove $(dis_asm_h).
* disasm.c: Include "dis-asm.h".
(dis_asm_read_memory): Use "struct disassemble_info" instead of
corresponding typedef.
(dis_asm_memory_error, dump_insns, do_assembly_only): Ditto.
(gdb_disassemble_info, gdb_disassembly, gdb_print_insn): Ditto.
* gdbarch.sh: Do not include "dis-asm.h".
(struct disassemble_info): Declare opaque.
(TARGET_PRINT_INSN): Update declaration.
* gdbarch.h, gdbarch.c: Re-generate.
2003-09-09 04:41:32 +00:00
|
|
|
dis_asm_memory_error (int status, bfd_vma memaddr,
|
|
|
|
struct disassemble_info *info)
|
2003-04-30 Andrew Cagney <cagney@redhat.com>
* gdbarch.sh (deprecated_tm_print_insn_info): Rename
"tm_print_insn_info".
(TARGET_PRINT_INSN_INFO): Delete macro.
(dis_asm_read_memory): Delete function declaration.
(dis_asm_memory_error, dis_asm_print_address): Ditto.
(tm_print_insn_info): Delete variable definition.
(_initialize_gdbarch): Do not initialize "tm_print_insn_info".
* gdbarch.h, gdbarch.c: Re-generate.
* d10v-tdep.c (display_trace): Replace "tm_print_insn_info" with
"deprecated_tm_print_insn_info".
* mcore-tdep.c (mcore_dump_insn): Ditto.
* mips-tdep.c (mips_gdbarch_init): Ditto.
* sparc-tdep.c (_initialize_sparc_tdep): Ditto.
* v850-tdep.c (v850_scan_prologue, v850_gdbarch_init): Ditto.
* ia64-tdep.c (_initialize_ia64_tdep): Ditto.
* printcmd.c (print_insn): Use "deprecated_tm_print_insn_info"
instead of TARGET_PRINT_INSN_INFO, add comment.
* s390-tdep.c (s390_get_frame_info): Instead of
"dis_asm_read_memory", use "deprecated_tm_print_insn_info".
(s390_check_function_end, s390_is_sigreturn): Ditto.
* corefile.c (dis_asm_read_memory): Move to "disasm.c".
(dis_asm_memory_error, dis_asm_print_address): Ditto.
* disasm.c: Include "gdbcore.h".
(_initialize_disasm): New function, initialize
"deprecated_tm_print_insn_info".
(deprecated_tm_print_insn_info): New variable.
(dis_asm_read_memory): Moved from "corefile.c", made static.
(dis_asm_print_address, dis_asm_memory_error): Ditto.
* Makefile.in (disasm.o): Update dependencies.
2003-04-28 Andrew Cagney <cagney@redhat.com>
* gdbint.texinfo (Target Architecture Definition): Replace
read_fp, TARGET_READ_FP and FP_REGNUM, with deprecated_read_fp,
DEPRECATED_TARGET_READ_FP and DEPRECATED_REGNUM.
2003-04-30 22:01:38 +00:00
|
|
|
{
|
|
|
|
memory_error (status, memaddr);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Like print_address with slightly different parameters. */
|
|
|
|
static void
|
|
|
|
dis_asm_print_address (bfd_vma addr, struct disassemble_info *info)
|
|
|
|
{
|
* 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.
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 17:21:10 +00:00
|
|
|
struct gdbarch *gdbarch = info->application_data;
|
2010-05-14 17:53:16 +00:00
|
|
|
|
* 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.
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 17:21:10 +00:00
|
|
|
print_address (gdbarch, addr, info->stream);
|
2003-04-30 Andrew Cagney <cagney@redhat.com>
* gdbarch.sh (deprecated_tm_print_insn_info): Rename
"tm_print_insn_info".
(TARGET_PRINT_INSN_INFO): Delete macro.
(dis_asm_read_memory): Delete function declaration.
(dis_asm_memory_error, dis_asm_print_address): Ditto.
(tm_print_insn_info): Delete variable definition.
(_initialize_gdbarch): Do not initialize "tm_print_insn_info".
* gdbarch.h, gdbarch.c: Re-generate.
* d10v-tdep.c (display_trace): Replace "tm_print_insn_info" with
"deprecated_tm_print_insn_info".
* mcore-tdep.c (mcore_dump_insn): Ditto.
* mips-tdep.c (mips_gdbarch_init): Ditto.
* sparc-tdep.c (_initialize_sparc_tdep): Ditto.
* v850-tdep.c (v850_scan_prologue, v850_gdbarch_init): Ditto.
* ia64-tdep.c (_initialize_ia64_tdep): Ditto.
* printcmd.c (print_insn): Use "deprecated_tm_print_insn_info"
instead of TARGET_PRINT_INSN_INFO, add comment.
* s390-tdep.c (s390_get_frame_info): Instead of
"dis_asm_read_memory", use "deprecated_tm_print_insn_info".
(s390_check_function_end, s390_is_sigreturn): Ditto.
* corefile.c (dis_asm_read_memory): Move to "disasm.c".
(dis_asm_memory_error, dis_asm_print_address): Ditto.
* disasm.c: Include "gdbcore.h".
(_initialize_disasm): New function, initialize
"deprecated_tm_print_insn_info".
(deprecated_tm_print_insn_info): New variable.
(dis_asm_read_memory): Moved from "corefile.c", made static.
(dis_asm_print_address, dis_asm_memory_error): Ditto.
* Makefile.in (disasm.o): Update dependencies.
2003-04-28 Andrew Cagney <cagney@redhat.com>
* gdbint.texinfo (Target Architecture Definition): Replace
read_fp, TARGET_READ_FP and FP_REGNUM, with deprecated_read_fp,
DEPRECATED_TARGET_READ_FP and DEPRECATED_REGNUM.
2003-04-30 22:01:38 +00:00
|
|
|
}
|
|
|
|
|
2002-09-30 15:57:26 +00:00
|
|
|
static int
|
2003-01-09 18:30:32 +00:00
|
|
|
compare_lines (const void *mle1p, const void *mle2p)
|
2002-09-30 15:57:26 +00:00
|
|
|
{
|
2015-08-15 04:45:54 +00:00
|
|
|
struct deprecated_dis_line_entry *mle1, *mle2;
|
2002-09-30 15:57:26 +00:00
|
|
|
int val;
|
|
|
|
|
2015-08-15 04:45:54 +00:00
|
|
|
mle1 = (struct deprecated_dis_line_entry *) mle1p;
|
|
|
|
mle2 = (struct deprecated_dis_line_entry *) mle2p;
|
2002-09-30 15:57:26 +00:00
|
|
|
|
2011-02-03 14:45:37 +00:00
|
|
|
/* End of sequence markers have a line number of 0 but don't want to
|
|
|
|
be sorted to the head of the list, instead sort by PC. */
|
|
|
|
if (mle1->line == 0 || mle2->line == 0)
|
|
|
|
{
|
|
|
|
val = mle1->start_pc - mle2->start_pc;
|
|
|
|
if (val == 0)
|
|
|
|
val = mle1->line - mle2->line;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
val = mle1->line - mle2->line;
|
|
|
|
if (val == 0)
|
|
|
|
val = mle1->start_pc - mle2->start_pc;
|
|
|
|
}
|
|
|
|
return val;
|
2002-09-30 15:57:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2009-07-02 17:17:42 +00:00
|
|
|
dump_insns (struct gdbarch *gdbarch, struct ui_out *uiout,
|
|
|
|
struct disassemble_info * di,
|
2002-09-30 15:57:26 +00:00
|
|
|
CORE_ADDR low, CORE_ADDR high,
|
2015-08-15 04:45:54 +00:00
|
|
|
int how_many, int flags, struct ui_file *stb,
|
|
|
|
CORE_ADDR *end_pc)
|
2002-09-30 15:57:26 +00:00
|
|
|
{
|
|
|
|
int num_displayed = 0;
|
|
|
|
CORE_ADDR pc;
|
|
|
|
|
|
|
|
/* parts of the symbolic representation of the address */
|
|
|
|
int unmapped;
|
|
|
|
int offset;
|
|
|
|
int line;
|
2003-02-02 Elena Zannoni <ezannoni@redhat.com>
Fix PR gdb/742 gdb/743
* disasm.c (dump_insns): Use make_cleanup_ui_out_tuple_begin_end.
(do_mixed_source_and_assembly): Use
make_cleanup_ui_out_tuple_begin_end and
make_cleanup_ui_out_tuple_begin_end.
(do_mixed_source_and_assembly): Ditto.
* thread.c (do_captured_list_thread_ids): Ditto.
* ui-out.h (ui_out_table_begin, ui_out_list_begin,
ui_out_tuple_begin, ui_out_table_end, ui_out_list_end,
ui_out_tuple_end): Delete prototypes.
* ui-out.c (ui_out_list_begin, ui_out_tuple_begin,
ui_out_list_end, ui_out_tuple_end): Delete.
From Kevin Buettner <kevinb@redhat.com>:
* ui-out.h (make_cleanup_ui_out_table_begin_end): New function.
* ui-out.c (make_cleanup_ui_out_table_begin_end)
(do_cleanup_table_end): New functions.
* breakpoint.c (print_it_typical, print_one_breakpoint, mention):
Use cleanups to invoke_ui_out_tuple_end().
(breakpoint_1): Use cleanup to invoke ui_out_table_end().
* cli/cli-setshow.c (cmd_show_list): Use
make_cleanup_ui_out_tuple_begin_end.
2003-02-03 01:18:37 +00:00
|
|
|
struct cleanup *ui_out_chain;
|
2002-09-30 15:57:26 +00:00
|
|
|
|
|
|
|
for (pc = low; pc < high;)
|
|
|
|
{
|
2003-04-08 01:40:31 +00:00
|
|
|
char *filename = NULL;
|
|
|
|
char *name = NULL;
|
|
|
|
|
2002-09-30 15:57:26 +00:00
|
|
|
QUIT;
|
|
|
|
if (how_many >= 0)
|
|
|
|
{
|
|
|
|
if (num_displayed >= how_many)
|
|
|
|
break;
|
|
|
|
else
|
|
|
|
num_displayed++;
|
|
|
|
}
|
2003-02-02 Elena Zannoni <ezannoni@redhat.com>
Fix PR gdb/742 gdb/743
* disasm.c (dump_insns): Use make_cleanup_ui_out_tuple_begin_end.
(do_mixed_source_and_assembly): Use
make_cleanup_ui_out_tuple_begin_end and
make_cleanup_ui_out_tuple_begin_end.
(do_mixed_source_and_assembly): Ditto.
* thread.c (do_captured_list_thread_ids): Ditto.
* ui-out.h (ui_out_table_begin, ui_out_list_begin,
ui_out_tuple_begin, ui_out_table_end, ui_out_list_end,
ui_out_tuple_end): Delete prototypes.
* ui-out.c (ui_out_list_begin, ui_out_tuple_begin,
ui_out_list_end, ui_out_tuple_end): Delete.
From Kevin Buettner <kevinb@redhat.com>:
* ui-out.h (make_cleanup_ui_out_table_begin_end): New function.
* ui-out.c (make_cleanup_ui_out_table_begin_end)
(do_cleanup_table_end): New functions.
* breakpoint.c (print_it_typical, print_one_breakpoint, mention):
Use cleanups to invoke_ui_out_tuple_end().
(breakpoint_1): Use cleanup to invoke ui_out_table_end().
* cli/cli-setshow.c (cmd_show_list): Use
make_cleanup_ui_out_tuple_begin_end.
2003-02-03 01:18:37 +00:00
|
|
|
ui_out_chain = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
|
2013-03-11 08:53:17 +00:00
|
|
|
|
|
|
|
if ((flags & DISASSEMBLY_OMIT_PC) == 0)
|
|
|
|
ui_out_text (uiout, pc_prefix (pc));
|
* 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.
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 17:21:10 +00:00
|
|
|
ui_out_field_core_addr (uiout, "address", gdbarch, pc);
|
2002-09-30 15:57:26 +00:00
|
|
|
|
2009-12-28 21:12:24 +00:00
|
|
|
if (!build_address_symbolic (gdbarch, pc, 0, &name, &offset, &filename,
|
2002-09-30 15:57:26 +00:00
|
|
|
&line, &unmapped))
|
|
|
|
{
|
|
|
|
/* We don't care now about line, filename and
|
2011-01-07 19:36:19 +00:00
|
|
|
unmapped. But we might in the future. */
|
2002-09-30 15:57:26 +00:00
|
|
|
ui_out_text (uiout, " <");
|
2009-10-23 00:49:33 +00:00
|
|
|
if ((flags & DISASSEMBLY_OMIT_FNAME) == 0)
|
|
|
|
ui_out_field_string (uiout, "func-name", name);
|
2002-09-30 15:57:26 +00:00
|
|
|
ui_out_text (uiout, "+");
|
|
|
|
ui_out_field_int (uiout, "offset", offset);
|
|
|
|
ui_out_text (uiout, ">:\t");
|
|
|
|
}
|
2003-07-07 15:13:17 +00:00
|
|
|
else
|
|
|
|
ui_out_text (uiout, ":\t");
|
|
|
|
|
2002-09-30 15:57:26 +00:00
|
|
|
if (filename != NULL)
|
|
|
|
xfree (filename);
|
|
|
|
if (name != NULL)
|
|
|
|
xfree (name);
|
|
|
|
|
2012-03-27 19:08:37 +00:00
|
|
|
ui_file_rewind (stb);
|
2009-07-11 14:04:23 +00:00
|
|
|
if (flags & DISASSEMBLY_RAW_INSN)
|
|
|
|
{
|
|
|
|
CORE_ADDR old_pc = pc;
|
|
|
|
bfd_byte data;
|
|
|
|
int status;
|
2011-01-12 15:02:12 +00:00
|
|
|
const char *spacer = "";
|
|
|
|
|
|
|
|
/* Build the opcodes using a temporary stream so we can
|
|
|
|
write them out in a single go for the MI. */
|
2012-03-27 19:08:37 +00:00
|
|
|
struct ui_file *opcode_stream = mem_fileopen ();
|
2011-01-12 15:02:12 +00:00
|
|
|
struct cleanup *cleanups =
|
2012-03-27 19:08:37 +00:00
|
|
|
make_cleanup_ui_file_delete (opcode_stream);
|
2010-05-14 17:53:16 +00:00
|
|
|
|
2009-07-11 14:04:23 +00:00
|
|
|
pc += gdbarch_print_insn (gdbarch, pc, di);
|
|
|
|
for (;old_pc < pc; old_pc++)
|
|
|
|
{
|
|
|
|
status = (*di->read_memory_func) (old_pc, &data, 1, di);
|
|
|
|
if (status != 0)
|
|
|
|
(*di->memory_error_func) (status, old_pc, di);
|
2012-03-27 19:08:37 +00:00
|
|
|
fprintf_filtered (opcode_stream, "%s%02x",
|
2011-01-12 15:02:12 +00:00
|
|
|
spacer, (unsigned) data);
|
|
|
|
spacer = " ";
|
2009-07-11 14:04:23 +00:00
|
|
|
}
|
2011-01-12 15:02:12 +00:00
|
|
|
ui_out_field_stream (uiout, "opcodes", opcode_stream);
|
2009-07-11 14:04:23 +00:00
|
|
|
ui_out_text (uiout, "\t");
|
2011-01-12 15:02:12 +00:00
|
|
|
|
|
|
|
do_cleanups (cleanups);
|
2009-07-11 14:04:23 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
pc += gdbarch_print_insn (gdbarch, pc, di);
|
2002-09-30 15:57:26 +00:00
|
|
|
ui_out_field_stream (uiout, "inst", stb);
|
2012-03-27 19:08:37 +00:00
|
|
|
ui_file_rewind (stb);
|
2003-02-02 Elena Zannoni <ezannoni@redhat.com>
Fix PR gdb/742 gdb/743
* disasm.c (dump_insns): Use make_cleanup_ui_out_tuple_begin_end.
(do_mixed_source_and_assembly): Use
make_cleanup_ui_out_tuple_begin_end and
make_cleanup_ui_out_tuple_begin_end.
(do_mixed_source_and_assembly): Ditto.
* thread.c (do_captured_list_thread_ids): Ditto.
* ui-out.h (ui_out_table_begin, ui_out_list_begin,
ui_out_tuple_begin, ui_out_table_end, ui_out_list_end,
ui_out_tuple_end): Delete prototypes.
* ui-out.c (ui_out_list_begin, ui_out_tuple_begin,
ui_out_list_end, ui_out_tuple_end): Delete.
From Kevin Buettner <kevinb@redhat.com>:
* ui-out.h (make_cleanup_ui_out_table_begin_end): New function.
* ui-out.c (make_cleanup_ui_out_table_begin_end)
(do_cleanup_table_end): New functions.
* breakpoint.c (print_it_typical, print_one_breakpoint, mention):
Use cleanups to invoke_ui_out_tuple_end().
(breakpoint_1): Use cleanup to invoke ui_out_table_end().
* cli/cli-setshow.c (cmd_show_list): Use
make_cleanup_ui_out_tuple_begin_end.
2003-02-03 01:18:37 +00:00
|
|
|
do_cleanups (ui_out_chain);
|
2002-09-30 15:57:26 +00:00
|
|
|
ui_out_text (uiout, "\n");
|
|
|
|
}
|
2015-08-15 04:45:54 +00:00
|
|
|
|
|
|
|
if (end_pc != NULL)
|
|
|
|
*end_pc = pc;
|
2002-09-30 15:57:26 +00:00
|
|
|
return num_displayed;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* The idea here is to present a source-O-centric view of a
|
|
|
|
function to the user. This means that things are presented
|
|
|
|
in source order, with (possibly) out of order assembly
|
2015-08-15 04:45:54 +00:00
|
|
|
immediately following.
|
|
|
|
|
|
|
|
N.B. This view is deprecated. */
|
2011-01-07 19:36:19 +00:00
|
|
|
|
2002-09-30 15:57:26 +00:00
|
|
|
static void
|
2015-08-15 04:45:54 +00:00
|
|
|
do_mixed_source_and_assembly_deprecated
|
|
|
|
(struct gdbarch *gdbarch, struct ui_out *uiout,
|
|
|
|
struct disassemble_info *di, struct symtab *symtab,
|
|
|
|
CORE_ADDR low, CORE_ADDR high,
|
|
|
|
int how_many, int flags, struct ui_file *stb)
|
2002-09-30 15:57:26 +00:00
|
|
|
{
|
|
|
|
int newlines = 0;
|
2015-08-15 04:45:54 +00:00
|
|
|
int nlines;
|
|
|
|
struct linetable_entry *le;
|
|
|
|
struct deprecated_dis_line_entry *mle;
|
2002-09-30 15:57:26 +00:00
|
|
|
struct symtab_and_line sal;
|
|
|
|
int i;
|
|
|
|
int out_of_order = 0;
|
|
|
|
int next_line = 0;
|
|
|
|
int num_displayed = 0;
|
2012-11-13 15:35:43 +00:00
|
|
|
enum print_source_lines_flags psl_flags = 0;
|
2003-02-02 Elena Zannoni <ezannoni@redhat.com>
Fix PR gdb/742 gdb/743
* disasm.c (dump_insns): Use make_cleanup_ui_out_tuple_begin_end.
(do_mixed_source_and_assembly): Use
make_cleanup_ui_out_tuple_begin_end and
make_cleanup_ui_out_tuple_begin_end.
(do_mixed_source_and_assembly): Ditto.
* thread.c (do_captured_list_thread_ids): Ditto.
* ui-out.h (ui_out_table_begin, ui_out_list_begin,
ui_out_tuple_begin, ui_out_table_end, ui_out_list_end,
ui_out_tuple_end): Delete prototypes.
* ui-out.c (ui_out_list_begin, ui_out_tuple_begin,
ui_out_list_end, ui_out_tuple_end): Delete.
From Kevin Buettner <kevinb@redhat.com>:
* ui-out.h (make_cleanup_ui_out_table_begin_end): New function.
* ui-out.c (make_cleanup_ui_out_table_begin_end)
(do_cleanup_table_end): New functions.
* breakpoint.c (print_it_typical, print_one_breakpoint, mention):
Use cleanups to invoke_ui_out_tuple_end().
(breakpoint_1): Use cleanup to invoke ui_out_table_end().
* cli/cli-setshow.c (cmd_show_list): Use
make_cleanup_ui_out_tuple_begin_end.
2003-02-03 01:18:37 +00:00
|
|
|
struct cleanup *ui_out_chain;
|
2004-01-06 19:06:39 +00:00
|
|
|
struct cleanup *ui_out_tuple_chain = make_cleanup (null_cleanup, 0);
|
|
|
|
struct cleanup *ui_out_list_chain = make_cleanup (null_cleanup, 0);
|
2002-09-30 15:57:26 +00:00
|
|
|
|
2015-08-15 04:45:54 +00:00
|
|
|
gdb_assert (symtab != NULL && SYMTAB_LINETABLE (symtab) != NULL);
|
|
|
|
|
|
|
|
nlines = SYMTAB_LINETABLE (symtab)->nitems;
|
|
|
|
le = SYMTAB_LINETABLE (symtab)->item;
|
|
|
|
|
2012-11-13 15:35:43 +00:00
|
|
|
if (flags & DISASSEMBLY_FILENAME)
|
|
|
|
psl_flags |= PRINT_SOURCE_LINES_FILENAME;
|
|
|
|
|
2015-08-15 04:45:54 +00:00
|
|
|
mle = (struct deprecated_dis_line_entry *)
|
|
|
|
alloca (nlines * sizeof (struct deprecated_dis_line_entry));
|
2002-09-30 15:57:26 +00:00
|
|
|
|
|
|
|
/* Copy linetable entries for this function into our data
|
|
|
|
structure, creating end_pc's and setting out_of_order as
|
|
|
|
appropriate. */
|
|
|
|
|
|
|
|
/* First, skip all the preceding functions. */
|
|
|
|
|
|
|
|
for (i = 0; i < nlines - 1 && le[i].pc < low; i++);
|
|
|
|
|
|
|
|
/* Now, copy all entries before the end of this function. */
|
|
|
|
|
|
|
|
for (; i < nlines - 1 && le[i].pc < high; i++)
|
|
|
|
{
|
|
|
|
if (le[i].line == le[i + 1].line && le[i].pc == le[i + 1].pc)
|
2011-01-07 19:36:19 +00:00
|
|
|
continue; /* Ignore duplicates. */
|
2002-09-30 15:57:26 +00:00
|
|
|
|
|
|
|
/* Skip any end-of-function markers. */
|
|
|
|
if (le[i].line == 0)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
mle[newlines].line = le[i].line;
|
|
|
|
if (le[i].line > le[i + 1].line)
|
|
|
|
out_of_order = 1;
|
|
|
|
mle[newlines].start_pc = le[i].pc;
|
|
|
|
mle[newlines].end_pc = le[i + 1].pc;
|
|
|
|
newlines++;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* If we're on the last line, and it's part of the function,
|
|
|
|
then we need to get the end pc in a special way. */
|
|
|
|
|
|
|
|
if (i == nlines - 1 && le[i].pc < high)
|
|
|
|
{
|
|
|
|
mle[newlines].line = le[i].line;
|
|
|
|
mle[newlines].start_pc = le[i].pc;
|
|
|
|
sal = find_pc_line (le[i].pc, 0);
|
|
|
|
mle[newlines].end_pc = sal.end;
|
|
|
|
newlines++;
|
|
|
|
}
|
|
|
|
|
2015-08-15 04:45:54 +00:00
|
|
|
/* Now, sort mle by line #s (and, then by addresses within lines). */
|
2002-09-30 15:57:26 +00:00
|
|
|
|
|
|
|
if (out_of_order)
|
2015-08-15 04:45:54 +00:00
|
|
|
qsort (mle, newlines, sizeof (struct deprecated_dis_line_entry),
|
|
|
|
compare_lines);
|
2002-09-30 15:57:26 +00:00
|
|
|
|
|
|
|
/* Now, for each line entry, emit the specified lines (unless
|
|
|
|
they have been emitted before), followed by the assembly code
|
|
|
|
for that line. */
|
|
|
|
|
2003-02-02 Elena Zannoni <ezannoni@redhat.com>
Fix PR gdb/742 gdb/743
* disasm.c (dump_insns): Use make_cleanup_ui_out_tuple_begin_end.
(do_mixed_source_and_assembly): Use
make_cleanup_ui_out_tuple_begin_end and
make_cleanup_ui_out_tuple_begin_end.
(do_mixed_source_and_assembly): Ditto.
* thread.c (do_captured_list_thread_ids): Ditto.
* ui-out.h (ui_out_table_begin, ui_out_list_begin,
ui_out_tuple_begin, ui_out_table_end, ui_out_list_end,
ui_out_tuple_end): Delete prototypes.
* ui-out.c (ui_out_list_begin, ui_out_tuple_begin,
ui_out_list_end, ui_out_tuple_end): Delete.
From Kevin Buettner <kevinb@redhat.com>:
* ui-out.h (make_cleanup_ui_out_table_begin_end): New function.
* ui-out.c (make_cleanup_ui_out_table_begin_end)
(do_cleanup_table_end): New functions.
* breakpoint.c (print_it_typical, print_one_breakpoint, mention):
Use cleanups to invoke_ui_out_tuple_end().
(breakpoint_1): Use cleanup to invoke ui_out_table_end().
* cli/cli-setshow.c (cmd_show_list): Use
make_cleanup_ui_out_tuple_begin_end.
2003-02-03 01:18:37 +00:00
|
|
|
ui_out_chain = make_cleanup_ui_out_list_begin_end (uiout, "asm_insns");
|
2002-09-30 15:57:26 +00:00
|
|
|
|
|
|
|
for (i = 0; i < newlines; i++)
|
|
|
|
{
|
|
|
|
/* Print out everything from next_line to the current line. */
|
|
|
|
if (mle[i].line >= next_line)
|
|
|
|
{
|
|
|
|
if (next_line != 0)
|
|
|
|
{
|
2011-01-07 19:36:19 +00:00
|
|
|
/* Just one line to print. */
|
2002-09-30 15:57:26 +00:00
|
|
|
if (next_line == mle[i].line)
|
|
|
|
{
|
2003-02-02 Elena Zannoni <ezannoni@redhat.com>
Fix PR gdb/742 gdb/743
* disasm.c (dump_insns): Use make_cleanup_ui_out_tuple_begin_end.
(do_mixed_source_and_assembly): Use
make_cleanup_ui_out_tuple_begin_end and
make_cleanup_ui_out_tuple_begin_end.
(do_mixed_source_and_assembly): Ditto.
* thread.c (do_captured_list_thread_ids): Ditto.
* ui-out.h (ui_out_table_begin, ui_out_list_begin,
ui_out_tuple_begin, ui_out_table_end, ui_out_list_end,
ui_out_tuple_end): Delete prototypes.
* ui-out.c (ui_out_list_begin, ui_out_tuple_begin,
ui_out_list_end, ui_out_tuple_end): Delete.
From Kevin Buettner <kevinb@redhat.com>:
* ui-out.h (make_cleanup_ui_out_table_begin_end): New function.
* ui-out.c (make_cleanup_ui_out_table_begin_end)
(do_cleanup_table_end): New functions.
* breakpoint.c (print_it_typical, print_one_breakpoint, mention):
Use cleanups to invoke_ui_out_tuple_end().
(breakpoint_1): Use cleanup to invoke ui_out_table_end().
* cli/cli-setshow.c (cmd_show_list): Use
make_cleanup_ui_out_tuple_begin_end.
2003-02-03 01:18:37 +00:00
|
|
|
ui_out_tuple_chain
|
|
|
|
= make_cleanup_ui_out_tuple_begin_end (uiout,
|
|
|
|
"src_and_asm_line");
|
2012-11-13 15:35:43 +00:00
|
|
|
print_source_lines (symtab, next_line, mle[i].line + 1, psl_flags);
|
2002-09-30 15:57:26 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-01-07 19:36:19 +00:00
|
|
|
/* Several source lines w/o asm instructions associated. */
|
2002-09-30 15:57:26 +00:00
|
|
|
for (; next_line < mle[i].line; next_line++)
|
|
|
|
{
|
2003-02-02 Elena Zannoni <ezannoni@redhat.com>
Fix PR gdb/742 gdb/743
* disasm.c (dump_insns): Use make_cleanup_ui_out_tuple_begin_end.
(do_mixed_source_and_assembly): Use
make_cleanup_ui_out_tuple_begin_end and
make_cleanup_ui_out_tuple_begin_end.
(do_mixed_source_and_assembly): Ditto.
* thread.c (do_captured_list_thread_ids): Ditto.
* ui-out.h (ui_out_table_begin, ui_out_list_begin,
ui_out_tuple_begin, ui_out_table_end, ui_out_list_end,
ui_out_tuple_end): Delete prototypes.
* ui-out.c (ui_out_list_begin, ui_out_tuple_begin,
ui_out_list_end, ui_out_tuple_end): Delete.
From Kevin Buettner <kevinb@redhat.com>:
* ui-out.h (make_cleanup_ui_out_table_begin_end): New function.
* ui-out.c (make_cleanup_ui_out_table_begin_end)
(do_cleanup_table_end): New functions.
* breakpoint.c (print_it_typical, print_one_breakpoint, mention):
Use cleanups to invoke_ui_out_tuple_end().
(breakpoint_1): Use cleanup to invoke ui_out_table_end().
* cli/cli-setshow.c (cmd_show_list): Use
make_cleanup_ui_out_tuple_begin_end.
2003-02-03 01:18:37 +00:00
|
|
|
struct cleanup *ui_out_list_chain_line;
|
|
|
|
struct cleanup *ui_out_tuple_chain_line;
|
|
|
|
|
|
|
|
ui_out_tuple_chain_line
|
|
|
|
= make_cleanup_ui_out_tuple_begin_end (uiout,
|
|
|
|
"src_and_asm_line");
|
2002-09-30 15:57:26 +00:00
|
|
|
print_source_lines (symtab, next_line, next_line + 1,
|
2012-11-13 15:35:43 +00:00
|
|
|
psl_flags);
|
2003-02-02 Elena Zannoni <ezannoni@redhat.com>
Fix PR gdb/742 gdb/743
* disasm.c (dump_insns): Use make_cleanup_ui_out_tuple_begin_end.
(do_mixed_source_and_assembly): Use
make_cleanup_ui_out_tuple_begin_end and
make_cleanup_ui_out_tuple_begin_end.
(do_mixed_source_and_assembly): Ditto.
* thread.c (do_captured_list_thread_ids): Ditto.
* ui-out.h (ui_out_table_begin, ui_out_list_begin,
ui_out_tuple_begin, ui_out_table_end, ui_out_list_end,
ui_out_tuple_end): Delete prototypes.
* ui-out.c (ui_out_list_begin, ui_out_tuple_begin,
ui_out_list_end, ui_out_tuple_end): Delete.
From Kevin Buettner <kevinb@redhat.com>:
* ui-out.h (make_cleanup_ui_out_table_begin_end): New function.
* ui-out.c (make_cleanup_ui_out_table_begin_end)
(do_cleanup_table_end): New functions.
* breakpoint.c (print_it_typical, print_one_breakpoint, mention):
Use cleanups to invoke_ui_out_tuple_end().
(breakpoint_1): Use cleanup to invoke ui_out_table_end().
* cli/cli-setshow.c (cmd_show_list): Use
make_cleanup_ui_out_tuple_begin_end.
2003-02-03 01:18:37 +00:00
|
|
|
ui_out_list_chain_line
|
|
|
|
= make_cleanup_ui_out_list_begin_end (uiout,
|
|
|
|
"line_asm_insn");
|
|
|
|
do_cleanups (ui_out_list_chain_line);
|
|
|
|
do_cleanups (ui_out_tuple_chain_line);
|
2002-09-30 15:57:26 +00:00
|
|
|
}
|
|
|
|
/* Print the last line and leave list open for
|
2011-01-07 19:36:19 +00:00
|
|
|
asm instructions to be added. */
|
2003-02-02 Elena Zannoni <ezannoni@redhat.com>
Fix PR gdb/742 gdb/743
* disasm.c (dump_insns): Use make_cleanup_ui_out_tuple_begin_end.
(do_mixed_source_and_assembly): Use
make_cleanup_ui_out_tuple_begin_end and
make_cleanup_ui_out_tuple_begin_end.
(do_mixed_source_and_assembly): Ditto.
* thread.c (do_captured_list_thread_ids): Ditto.
* ui-out.h (ui_out_table_begin, ui_out_list_begin,
ui_out_tuple_begin, ui_out_table_end, ui_out_list_end,
ui_out_tuple_end): Delete prototypes.
* ui-out.c (ui_out_list_begin, ui_out_tuple_begin,
ui_out_list_end, ui_out_tuple_end): Delete.
From Kevin Buettner <kevinb@redhat.com>:
* ui-out.h (make_cleanup_ui_out_table_begin_end): New function.
* ui-out.c (make_cleanup_ui_out_table_begin_end)
(do_cleanup_table_end): New functions.
* breakpoint.c (print_it_typical, print_one_breakpoint, mention):
Use cleanups to invoke_ui_out_tuple_end().
(breakpoint_1): Use cleanup to invoke ui_out_table_end().
* cli/cli-setshow.c (cmd_show_list): Use
make_cleanup_ui_out_tuple_begin_end.
2003-02-03 01:18:37 +00:00
|
|
|
ui_out_tuple_chain
|
|
|
|
= make_cleanup_ui_out_tuple_begin_end (uiout,
|
|
|
|
"src_and_asm_line");
|
2012-11-13 15:35:43 +00:00
|
|
|
print_source_lines (symtab, next_line, mle[i].line + 1, psl_flags);
|
2002-09-30 15:57:26 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2003-02-02 Elena Zannoni <ezannoni@redhat.com>
Fix PR gdb/742 gdb/743
* disasm.c (dump_insns): Use make_cleanup_ui_out_tuple_begin_end.
(do_mixed_source_and_assembly): Use
make_cleanup_ui_out_tuple_begin_end and
make_cleanup_ui_out_tuple_begin_end.
(do_mixed_source_and_assembly): Ditto.
* thread.c (do_captured_list_thread_ids): Ditto.
* ui-out.h (ui_out_table_begin, ui_out_list_begin,
ui_out_tuple_begin, ui_out_table_end, ui_out_list_end,
ui_out_tuple_end): Delete prototypes.
* ui-out.c (ui_out_list_begin, ui_out_tuple_begin,
ui_out_list_end, ui_out_tuple_end): Delete.
From Kevin Buettner <kevinb@redhat.com>:
* ui-out.h (make_cleanup_ui_out_table_begin_end): New function.
* ui-out.c (make_cleanup_ui_out_table_begin_end)
(do_cleanup_table_end): New functions.
* breakpoint.c (print_it_typical, print_one_breakpoint, mention):
Use cleanups to invoke_ui_out_tuple_end().
(breakpoint_1): Use cleanup to invoke ui_out_table_end().
* cli/cli-setshow.c (cmd_show_list): Use
make_cleanup_ui_out_tuple_begin_end.
2003-02-03 01:18:37 +00:00
|
|
|
ui_out_tuple_chain
|
2011-01-05 22:22:53 +00:00
|
|
|
= make_cleanup_ui_out_tuple_begin_end (uiout,
|
|
|
|
"src_and_asm_line");
|
2012-11-13 15:35:43 +00:00
|
|
|
print_source_lines (symtab, mle[i].line, mle[i].line + 1, psl_flags);
|
2002-09-30 15:57:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
next_line = mle[i].line + 1;
|
2003-02-02 Elena Zannoni <ezannoni@redhat.com>
Fix PR gdb/742 gdb/743
* disasm.c (dump_insns): Use make_cleanup_ui_out_tuple_begin_end.
(do_mixed_source_and_assembly): Use
make_cleanup_ui_out_tuple_begin_end and
make_cleanup_ui_out_tuple_begin_end.
(do_mixed_source_and_assembly): Ditto.
* thread.c (do_captured_list_thread_ids): Ditto.
* ui-out.h (ui_out_table_begin, ui_out_list_begin,
ui_out_tuple_begin, ui_out_table_end, ui_out_list_end,
ui_out_tuple_end): Delete prototypes.
* ui-out.c (ui_out_list_begin, ui_out_tuple_begin,
ui_out_list_end, ui_out_tuple_end): Delete.
From Kevin Buettner <kevinb@redhat.com>:
* ui-out.h (make_cleanup_ui_out_table_begin_end): New function.
* ui-out.c (make_cleanup_ui_out_table_begin_end)
(do_cleanup_table_end): New functions.
* breakpoint.c (print_it_typical, print_one_breakpoint, mention):
Use cleanups to invoke_ui_out_tuple_end().
(breakpoint_1): Use cleanup to invoke ui_out_table_end().
* cli/cli-setshow.c (cmd_show_list): Use
make_cleanup_ui_out_tuple_begin_end.
2003-02-03 01:18:37 +00:00
|
|
|
ui_out_list_chain
|
|
|
|
= make_cleanup_ui_out_list_begin_end (uiout, "line_asm_insn");
|
2002-09-30 15:57:26 +00:00
|
|
|
}
|
|
|
|
|
2009-07-02 17:17:42 +00:00
|
|
|
num_displayed += dump_insns (gdbarch, uiout, di,
|
|
|
|
mle[i].start_pc, mle[i].end_pc,
|
2015-08-15 04:45:54 +00:00
|
|
|
how_many, flags, stb, NULL);
|
2004-01-06 19:06:39 +00:00
|
|
|
|
|
|
|
/* When we've reached the end of the mle array, or we've seen the last
|
|
|
|
assembly range for this source line, close out the list/tuple. */
|
|
|
|
if (i == (newlines - 1) || mle[i + 1].line > mle[i].line)
|
2002-09-30 15:57:26 +00:00
|
|
|
{
|
2003-02-02 Elena Zannoni <ezannoni@redhat.com>
Fix PR gdb/742 gdb/743
* disasm.c (dump_insns): Use make_cleanup_ui_out_tuple_begin_end.
(do_mixed_source_and_assembly): Use
make_cleanup_ui_out_tuple_begin_end and
make_cleanup_ui_out_tuple_begin_end.
(do_mixed_source_and_assembly): Ditto.
* thread.c (do_captured_list_thread_ids): Ditto.
* ui-out.h (ui_out_table_begin, ui_out_list_begin,
ui_out_tuple_begin, ui_out_table_end, ui_out_list_end,
ui_out_tuple_end): Delete prototypes.
* ui-out.c (ui_out_list_begin, ui_out_tuple_begin,
ui_out_list_end, ui_out_tuple_end): Delete.
From Kevin Buettner <kevinb@redhat.com>:
* ui-out.h (make_cleanup_ui_out_table_begin_end): New function.
* ui-out.c (make_cleanup_ui_out_table_begin_end)
(do_cleanup_table_end): New functions.
* breakpoint.c (print_it_typical, print_one_breakpoint, mention):
Use cleanups to invoke_ui_out_tuple_end().
(breakpoint_1): Use cleanup to invoke ui_out_table_end().
* cli/cli-setshow.c (cmd_show_list): Use
make_cleanup_ui_out_tuple_begin_end.
2003-02-03 01:18:37 +00:00
|
|
|
do_cleanups (ui_out_list_chain);
|
|
|
|
do_cleanups (ui_out_tuple_chain);
|
2004-01-06 19:06:39 +00:00
|
|
|
ui_out_tuple_chain = make_cleanup (null_cleanup, 0);
|
|
|
|
ui_out_list_chain = make_cleanup (null_cleanup, 0);
|
2002-09-30 15:57:26 +00:00
|
|
|
ui_out_text (uiout, "\n");
|
|
|
|
}
|
2004-01-06 19:06:39 +00:00
|
|
|
if (how_many >= 0 && num_displayed >= how_many)
|
|
|
|
break;
|
2002-09-30 15:57:26 +00:00
|
|
|
}
|
2003-02-02 Elena Zannoni <ezannoni@redhat.com>
Fix PR gdb/742 gdb/743
* disasm.c (dump_insns): Use make_cleanup_ui_out_tuple_begin_end.
(do_mixed_source_and_assembly): Use
make_cleanup_ui_out_tuple_begin_end and
make_cleanup_ui_out_tuple_begin_end.
(do_mixed_source_and_assembly): Ditto.
* thread.c (do_captured_list_thread_ids): Ditto.
* ui-out.h (ui_out_table_begin, ui_out_list_begin,
ui_out_tuple_begin, ui_out_table_end, ui_out_list_end,
ui_out_tuple_end): Delete prototypes.
* ui-out.c (ui_out_list_begin, ui_out_tuple_begin,
ui_out_list_end, ui_out_tuple_end): Delete.
From Kevin Buettner <kevinb@redhat.com>:
* ui-out.h (make_cleanup_ui_out_table_begin_end): New function.
* ui-out.c (make_cleanup_ui_out_table_begin_end)
(do_cleanup_table_end): New functions.
* breakpoint.c (print_it_typical, print_one_breakpoint, mention):
Use cleanups to invoke_ui_out_tuple_end().
(breakpoint_1): Use cleanup to invoke ui_out_table_end().
* cli/cli-setshow.c (cmd_show_list): Use
make_cleanup_ui_out_tuple_begin_end.
2003-02-03 01:18:37 +00:00
|
|
|
do_cleanups (ui_out_chain);
|
2002-09-30 15:57:26 +00:00
|
|
|
}
|
|
|
|
|
2015-08-15 04:45:54 +00:00
|
|
|
/* The idea here is to present a source-O-centric view of a
|
|
|
|
function to the user. This means that things are presented
|
|
|
|
in source order, with (possibly) out of order assembly
|
|
|
|
immediately following. */
|
|
|
|
|
|
|
|
static void
|
|
|
|
do_mixed_source_and_assembly (struct gdbarch *gdbarch, struct ui_out *uiout,
|
|
|
|
struct disassemble_info *di,
|
|
|
|
struct symtab *main_symtab,
|
|
|
|
CORE_ADDR low, CORE_ADDR high,
|
|
|
|
int how_many, int flags, struct ui_file *stb)
|
|
|
|
{
|
|
|
|
int newlines = 0;
|
|
|
|
const struct linetable_entry *le, *first_le;
|
|
|
|
struct symtab_and_line sal;
|
|
|
|
int i, nlines;
|
|
|
|
int out_of_order = 0;
|
|
|
|
int next_line = 0;
|
|
|
|
int num_displayed = 0;
|
|
|
|
enum print_source_lines_flags psl_flags = 0;
|
|
|
|
struct cleanup *cleanups;
|
|
|
|
struct cleanup *ui_out_chain;
|
|
|
|
struct cleanup *ui_out_tuple_chain;
|
|
|
|
struct cleanup *ui_out_list_chain;
|
|
|
|
CORE_ADDR pc;
|
|
|
|
struct symtab *last_symtab;
|
|
|
|
int last_line;
|
|
|
|
htab_t dis_line_table;
|
|
|
|
|
|
|
|
gdb_assert (main_symtab != NULL && SYMTAB_LINETABLE (main_symtab) != NULL);
|
|
|
|
|
|
|
|
/* First pass: collect the list of all source files and lines.
|
|
|
|
We do this so that we can only print lines containing code once.
|
|
|
|
We try to print the source text leading up to the next instruction,
|
|
|
|
but if that text is for code that will be disassembled later, then
|
|
|
|
we'll want to defer printing it until later with its associated code. */
|
|
|
|
|
|
|
|
dis_line_table = allocate_dis_line_table ();
|
|
|
|
cleanups = make_cleanup_htab_delete (dis_line_table);
|
|
|
|
|
|
|
|
pc = low;
|
|
|
|
|
|
|
|
/* The prologue may be empty, but there may still be a line number entry
|
|
|
|
for the opening brace which is distinct from the first line of code.
|
|
|
|
If the prologue has been eliminated find_pc_line may return the source
|
|
|
|
line after the opening brace. We still want to print this opening brace.
|
|
|
|
first_le is used to implement this. */
|
|
|
|
|
|
|
|
nlines = SYMTAB_LINETABLE (main_symtab)->nitems;
|
|
|
|
le = SYMTAB_LINETABLE (main_symtab)->item;
|
|
|
|
first_le = NULL;
|
|
|
|
|
|
|
|
/* Skip all the preceding functions. */
|
|
|
|
for (i = 0; i < nlines && le[i].pc < low; i++)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
if (i < nlines && le[i].pc < high)
|
|
|
|
first_le = &le[i];
|
|
|
|
|
|
|
|
/* Add lines for every pc value. */
|
|
|
|
while (pc < high)
|
|
|
|
{
|
|
|
|
struct symtab_and_line sal;
|
|
|
|
int length;
|
|
|
|
|
|
|
|
sal = find_pc_line (pc, 0);
|
|
|
|
length = gdb_insn_length (gdbarch, pc);
|
|
|
|
pc += length;
|
|
|
|
|
|
|
|
if (sal.symtab != NULL)
|
|
|
|
maybe_add_dis_line_entry (dis_line_table, sal.symtab, sal.line);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Second pass: print the disassembly.
|
|
|
|
|
|
|
|
Output format, from an MI perspective:
|
|
|
|
The result is a ui_out list, field name "asm_insns", where elements have
|
|
|
|
name "src_and_asm_line".
|
|
|
|
Each element is a tuple of source line specs (field names line, file,
|
|
|
|
fullname), and field "line_asm_insn" which contains the disassembly.
|
|
|
|
Field "line_asm_insn" is a list of tuples: address, func-name, offset,
|
|
|
|
opcodes, inst.
|
|
|
|
|
|
|
|
CLI output works on top of this because MI ignores ui_out_text output,
|
|
|
|
which is where we put file name and source line contents output.
|
|
|
|
|
|
|
|
Cleanup usage:
|
|
|
|
cleanups:
|
|
|
|
For things created at the beginning of this function and need to be
|
|
|
|
kept until the end of this function.
|
|
|
|
ui_out_chain
|
|
|
|
Handles the outer "asm_insns" list.
|
|
|
|
ui_out_tuple_chain
|
|
|
|
The tuples for each group of consecutive disassemblies.
|
|
|
|
ui_out_list_chain
|
|
|
|
List of consecutive source lines or disassembled insns. */
|
|
|
|
|
|
|
|
if (flags & DISASSEMBLY_FILENAME)
|
|
|
|
psl_flags |= PRINT_SOURCE_LINES_FILENAME;
|
|
|
|
|
|
|
|
ui_out_chain = make_cleanup_ui_out_list_begin_end (uiout, "asm_insns");
|
|
|
|
|
|
|
|
ui_out_tuple_chain = NULL;
|
|
|
|
ui_out_list_chain = NULL;
|
|
|
|
|
|
|
|
last_symtab = NULL;
|
|
|
|
last_line = 0;
|
|
|
|
pc = low;
|
|
|
|
|
|
|
|
while (pc < high)
|
|
|
|
{
|
|
|
|
struct linetable_entry *le = NULL;
|
|
|
|
struct symtab_and_line sal;
|
|
|
|
CORE_ADDR end_pc;
|
|
|
|
int start_preceding_line_to_display = 0;
|
|
|
|
int end_preceding_line_to_display = 0;
|
|
|
|
int new_source_line = 0;
|
|
|
|
|
|
|
|
sal = find_pc_line (pc, 0);
|
|
|
|
|
|
|
|
if (sal.symtab != last_symtab)
|
|
|
|
{
|
|
|
|
/* New source file. */
|
|
|
|
new_source_line = 1;
|
|
|
|
|
|
|
|
/* If this is the first line of output, check for any preceding
|
|
|
|
lines. */
|
|
|
|
if (last_line == 0
|
|
|
|
&& first_le != NULL
|
|
|
|
&& first_le->line < sal.line)
|
|
|
|
{
|
|
|
|
start_preceding_line_to_display = first_le->line;
|
|
|
|
end_preceding_line_to_display = sal.line;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Same source file as last time. */
|
|
|
|
if (sal.symtab != NULL)
|
|
|
|
{
|
|
|
|
if (sal.line > last_line + 1 && last_line != 0)
|
|
|
|
{
|
|
|
|
int l;
|
|
|
|
|
|
|
|
/* Several preceding source lines. Print the trailing ones
|
|
|
|
not associated with code that we'll print later. */
|
|
|
|
for (l = sal.line - 1; l > last_line; --l)
|
|
|
|
{
|
|
|
|
if (line_has_code_p (dis_line_table, sal.symtab, l))
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (l < sal.line - 1)
|
|
|
|
{
|
|
|
|
start_preceding_line_to_display = l + 1;
|
|
|
|
end_preceding_line_to_display = sal.line;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (sal.line != last_line)
|
|
|
|
new_source_line = 1;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Same source line as last time. This can happen, depending
|
|
|
|
on the debug info. */
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (new_source_line)
|
|
|
|
{
|
|
|
|
/* Skip the newline if this is the first instruction. */
|
|
|
|
if (pc > low)
|
|
|
|
ui_out_text (uiout, "\n");
|
|
|
|
if (ui_out_tuple_chain != NULL)
|
|
|
|
{
|
|
|
|
gdb_assert (ui_out_list_chain != NULL);
|
|
|
|
do_cleanups (ui_out_list_chain);
|
|
|
|
do_cleanups (ui_out_tuple_chain);
|
|
|
|
}
|
|
|
|
if (sal.symtab != last_symtab
|
|
|
|
&& !(flags & DISASSEMBLY_FILENAME))
|
|
|
|
{
|
|
|
|
/* Remember MI ignores ui_out_text.
|
|
|
|
We don't have to do anything here for MI because MI
|
|
|
|
output includes the source specs for each line. */
|
|
|
|
if (sal.symtab != NULL)
|
|
|
|
{
|
|
|
|
ui_out_text (uiout,
|
|
|
|
symtab_to_filename_for_display (sal.symtab));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
ui_out_text (uiout, "unknown");
|
|
|
|
ui_out_text (uiout, ":\n");
|
|
|
|
}
|
|
|
|
if (start_preceding_line_to_display > 0)
|
|
|
|
{
|
|
|
|
/* Several source lines w/o asm instructions associated.
|
|
|
|
We need to preserve the structure of the output, so output
|
|
|
|
a bunch of line tuples with no asm entries. */
|
|
|
|
int l;
|
|
|
|
struct cleanup *ui_out_list_chain_line;
|
|
|
|
struct cleanup *ui_out_tuple_chain_line;
|
|
|
|
|
|
|
|
gdb_assert (sal.symtab != NULL);
|
|
|
|
for (l = start_preceding_line_to_display;
|
|
|
|
l < end_preceding_line_to_display;
|
|
|
|
++l)
|
|
|
|
{
|
|
|
|
ui_out_tuple_chain_line
|
|
|
|
= make_cleanup_ui_out_tuple_begin_end (uiout,
|
|
|
|
"src_and_asm_line");
|
|
|
|
print_source_lines (sal.symtab, l, l + 1, psl_flags);
|
|
|
|
ui_out_list_chain_line
|
|
|
|
= make_cleanup_ui_out_list_begin_end (uiout,
|
|
|
|
"line_asm_insn");
|
|
|
|
do_cleanups (ui_out_list_chain_line);
|
|
|
|
do_cleanups (ui_out_tuple_chain_line);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ui_out_tuple_chain
|
|
|
|
= make_cleanup_ui_out_tuple_begin_end (uiout, "src_and_asm_line");
|
|
|
|
if (sal.symtab != NULL)
|
|
|
|
print_source_lines (sal.symtab, sal.line, sal.line + 1, psl_flags);
|
|
|
|
else
|
|
|
|
ui_out_text (uiout, _("--- no source info for this pc ---\n"));
|
|
|
|
ui_out_list_chain
|
|
|
|
= make_cleanup_ui_out_list_begin_end (uiout, "line_asm_insn");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Here we're appending instructions to an existing line.
|
|
|
|
By construction the very first insn will have a symtab
|
|
|
|
and follow the new_source_line path above. */
|
|
|
|
gdb_assert (ui_out_tuple_chain != NULL);
|
|
|
|
gdb_assert (ui_out_list_chain != NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (sal.end != 0)
|
|
|
|
end_pc = min (sal.end, high);
|
|
|
|
else
|
|
|
|
end_pc = pc + 1;
|
|
|
|
num_displayed += dump_insns (gdbarch, uiout, di, pc, end_pc,
|
|
|
|
how_many, flags, stb, &end_pc);
|
|
|
|
pc = end_pc;
|
|
|
|
|
|
|
|
if (how_many >= 0 && num_displayed >= how_many)
|
|
|
|
break;
|
|
|
|
|
|
|
|
last_symtab = sal.symtab;
|
|
|
|
last_line = sal.line;
|
|
|
|
}
|
|
|
|
|
|
|
|
do_cleanups (ui_out_chain);
|
|
|
|
do_cleanups (cleanups);
|
|
|
|
}
|
2002-09-30 15:57:26 +00:00
|
|
|
|
|
|
|
static void
|
2009-07-02 17:17:42 +00:00
|
|
|
do_assembly_only (struct gdbarch *gdbarch, struct ui_out *uiout,
|
|
|
|
struct disassemble_info * di,
|
2002-09-30 15:57:26 +00:00
|
|
|
CORE_ADDR low, CORE_ADDR high,
|
2012-03-27 19:08:37 +00:00
|
|
|
int how_many, int flags, struct ui_file *stb)
|
2002-09-30 15:57:26 +00:00
|
|
|
{
|
|
|
|
int num_displayed = 0;
|
2003-02-02 Elena Zannoni <ezannoni@redhat.com>
Fix PR gdb/742 gdb/743
* disasm.c (dump_insns): Use make_cleanup_ui_out_tuple_begin_end.
(do_mixed_source_and_assembly): Use
make_cleanup_ui_out_tuple_begin_end and
make_cleanup_ui_out_tuple_begin_end.
(do_mixed_source_and_assembly): Ditto.
* thread.c (do_captured_list_thread_ids): Ditto.
* ui-out.h (ui_out_table_begin, ui_out_list_begin,
ui_out_tuple_begin, ui_out_table_end, ui_out_list_end,
ui_out_tuple_end): Delete prototypes.
* ui-out.c (ui_out_list_begin, ui_out_tuple_begin,
ui_out_list_end, ui_out_tuple_end): Delete.
From Kevin Buettner <kevinb@redhat.com>:
* ui-out.h (make_cleanup_ui_out_table_begin_end): New function.
* ui-out.c (make_cleanup_ui_out_table_begin_end)
(do_cleanup_table_end): New functions.
* breakpoint.c (print_it_typical, print_one_breakpoint, mention):
Use cleanups to invoke_ui_out_tuple_end().
(breakpoint_1): Use cleanup to invoke ui_out_table_end().
* cli/cli-setshow.c (cmd_show_list): Use
make_cleanup_ui_out_tuple_begin_end.
2003-02-03 01:18:37 +00:00
|
|
|
struct cleanup *ui_out_chain;
|
2002-09-30 15:57:26 +00:00
|
|
|
|
2003-02-02 Elena Zannoni <ezannoni@redhat.com>
Fix PR gdb/742 gdb/743
* disasm.c (dump_insns): Use make_cleanup_ui_out_tuple_begin_end.
(do_mixed_source_and_assembly): Use
make_cleanup_ui_out_tuple_begin_end and
make_cleanup_ui_out_tuple_begin_end.
(do_mixed_source_and_assembly): Ditto.
* thread.c (do_captured_list_thread_ids): Ditto.
* ui-out.h (ui_out_table_begin, ui_out_list_begin,
ui_out_tuple_begin, ui_out_table_end, ui_out_list_end,
ui_out_tuple_end): Delete prototypes.
* ui-out.c (ui_out_list_begin, ui_out_tuple_begin,
ui_out_list_end, ui_out_tuple_end): Delete.
From Kevin Buettner <kevinb@redhat.com>:
* ui-out.h (make_cleanup_ui_out_table_begin_end): New function.
* ui-out.c (make_cleanup_ui_out_table_begin_end)
(do_cleanup_table_end): New functions.
* breakpoint.c (print_it_typical, print_one_breakpoint, mention):
Use cleanups to invoke_ui_out_tuple_end().
(breakpoint_1): Use cleanup to invoke ui_out_table_end().
* cli/cli-setshow.c (cmd_show_list): Use
make_cleanup_ui_out_tuple_begin_end.
2003-02-03 01:18:37 +00:00
|
|
|
ui_out_chain = make_cleanup_ui_out_list_begin_end (uiout, "asm_insns");
|
2002-09-30 15:57:26 +00:00
|
|
|
|
2009-07-11 14:04:23 +00:00
|
|
|
num_displayed = dump_insns (gdbarch, uiout, di, low, high, how_many,
|
2015-08-15 04:45:54 +00:00
|
|
|
flags, stb, NULL);
|
2002-09-30 15:57:26 +00:00
|
|
|
|
2003-02-02 Elena Zannoni <ezannoni@redhat.com>
Fix PR gdb/742 gdb/743
* disasm.c (dump_insns): Use make_cleanup_ui_out_tuple_begin_end.
(do_mixed_source_and_assembly): Use
make_cleanup_ui_out_tuple_begin_end and
make_cleanup_ui_out_tuple_begin_end.
(do_mixed_source_and_assembly): Ditto.
* thread.c (do_captured_list_thread_ids): Ditto.
* ui-out.h (ui_out_table_begin, ui_out_list_begin,
ui_out_tuple_begin, ui_out_table_end, ui_out_list_end,
ui_out_tuple_end): Delete prototypes.
* ui-out.c (ui_out_list_begin, ui_out_tuple_begin,
ui_out_list_end, ui_out_tuple_end): Delete.
From Kevin Buettner <kevinb@redhat.com>:
* ui-out.h (make_cleanup_ui_out_table_begin_end): New function.
* ui-out.c (make_cleanup_ui_out_table_begin_end)
(do_cleanup_table_end): New functions.
* breakpoint.c (print_it_typical, print_one_breakpoint, mention):
Use cleanups to invoke_ui_out_tuple_end().
(breakpoint_1): Use cleanup to invoke ui_out_table_end().
* cli/cli-setshow.c (cmd_show_list): Use
make_cleanup_ui_out_tuple_begin_end.
2003-02-03 01:18:37 +00:00
|
|
|
do_cleanups (ui_out_chain);
|
2002-09-30 15:57:26 +00:00
|
|
|
}
|
|
|
|
|
2003-05-03 19:13:04 +00:00
|
|
|
/* Initialize the disassemble info struct ready for the specified
|
|
|
|
stream. */
|
|
|
|
|
gdb/
* ada-lang.c (lim_warning): Change ATTR_FORMAT to ATTRIBUTE_PRINTF.
* amd64-tdep.c (amd64_insn_length_fprintf): Likewise.
* cli-out.c (cli_field_fmt): New ATTRIBUTE_PRINTF.
(cli_message, out_field_fmt): Change ATTR_FORMAT to ATTRIBUTE_PRINTF.
* complaints.c (find_complaint): New ATTRIBUTE_PRINTF.
(vcomplaint): Change ATTR_FORMAT to ATTRIBUTE_PRINTF.
* complaints.h (complaint, internal_complaint): Likewise.
* defs.h: Change ATTR_FORMAT to ATTRIBUTE_PRINTF in the top comment.
(ATTR_FORMAT): Remove.
(query, nquery, yquery, vprintf_filtered, vfprintf_filtered)
(fprintf_filtered, fprintfi_filtered, printf_filtered, printfi_filtered)
(vprintf_unfiltered, vfprintf_unfiltered, fprintf_unfiltered)
(printf_unfiltered, xasprintf, xvasprintf, xstrprintf, xstrvprintf)
(xsnprintf, verror, error, vfatal, fatal, internal_verror)
(internal_error, internal_vwarning, internal_warning, warning)
(vwarning): Change ATTR_FORMAT to ATTRIBUTE_PRINTF.
* disasm.c (fprintf_disasm): Likewise.
* exceptions.c (throw_it): Likewise.
* exceptions.h (exception_fprintf, throw_verror, throw_vfatal)
(throw_error): Likewise.
* language.h (type_error, range_error): Likewise.
* linespec.c (cplusplus_error): Likewise.
* mi/mi-interp.c (mi_interp_query_hook): Likewise.
* mi/mi-out.c (mi_field_fmt, mi_message): Likewise.
* monitor.c (monitor_debug): Likewise.
* parser-defs.h (parser_fprintf): Likewise.
* serial.h (serial_printf): Likewise.
* tui/tui-hooks.c (tui_query_hook): Likewise.
* ui-out.c (default_field_fmt, default_message, uo_field_fmt)
(uo_message): Likewise.
* ui-out.h (ui_out_field_fmt, ui_out_message): Likewise.
* utils.c (vfprintf_maybe_filtered, internal_vproblem, defaulted_query):
Likewise.
* xml-support.h (gdb_xml_debug, gdb_xml_error): Likewise.
2010-05-02 21:14:59 +00:00
|
|
|
static int ATTRIBUTE_PRINTF (2, 3)
|
2003-09-03 23:46:58 +00:00
|
|
|
fprintf_disasm (void *stream, const char *format, ...)
|
|
|
|
{
|
|
|
|
va_list args;
|
2010-05-14 17:53:16 +00:00
|
|
|
|
2003-09-03 23:46:58 +00:00
|
|
|
va_start (args, format);
|
|
|
|
vfprintf_filtered (stream, format, args);
|
|
|
|
va_end (args);
|
|
|
|
/* Something non -ve. */
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
Add Guile as an extension language.
* NEWS: Mention Guile scripting.
* Makefile.in (SUBDIR_GUILE_OBS): New variable.
(SUBDIR_GUILE_SRCS, SUBDIR_GUILE_DEPS): New variables
(SUBDIR_GUILE_LDFLAGS, SUBDIR_GUILE_CFLAGS): New variables.
(INTERNAL_CPPFLAGS): Add GUILE_CPPFLAGS.
(CLIBS): Add GUILE_LIBS.
(install-guile): New rule.
(guile.o): New rule.
(scm-arch.o, scm-auto-load.o, scm-block.o): New rules.
(scm-breakpoint.o, scm-disasm.o, scm-exception.o): New rules.
(scm-frame.o, scm-iterator.o, scm-lazy-string.o): New rules.
(scm-math.o, scm-objfile.o, scm-ports.o): New rules.
(scm-pretty-print.o, scm-safe-call.o, scm-gsmob.o): New rules.
(scm-string.o, scm-symbol.o, scm-symtab.o): New rules.
(scm-type.o, scm-utils.o, scm-value.o): New rules.
* configure.ac: New option --with-guile.
* configure: Regenerate.
* config.in: Regenerate.
* auto-load.c: Remove #include "python/python.h". Add #include
"gdb/section-scripts.h".
(source_section_scripts): Handle Guile scripts.
(_initialize_auto_load): Add name of Guile objfile script to
scripts-directory help text.
* breakpoint.c (condition_command): Tweak comment to include Scheme.
* breakpoint.h (gdbscm_breakpoint_object): Add forward decl.
(struct breakpoint): New member scm_bp_object.
* defs.h (enum command_control_type): New value guile_control.
* cli/cli-cmds.c: Remove #include "python/python.h". Add #include
"extension.h".
(show_user): Update comment.
(_initialize_cli_cmds): Update help text for "show user". Update help
text for max-user-call-depth.
* cli/cli-script.c: Remove #include "python/python.h". Add #include
"extension.h".
(multi_line_command_p): Add guile_control.
(print_command_lines): Handle guile_control.
(execute_control_command, recurse_read_control_structure): Ditto.
(process_next_line): Recognize "guile" commands.
* disasm.c (gdb_disassemble_info): Make non-static.
* disasm.h: #include "dis-asm.h".
(struct gdbarch): Add forward decl.
(gdb_disassemble_info): Declare.
* extension.c: #include "guile/guile.h".
(extension_languages): Add guile.
(get_ext_lang_defn): Handle EXT_LANG_GDB.
* extension.h (enum extension_language): New value EXT_LANG_GUILE.
* gdbtypes.c (get_unsigned_type_max): New function.
(get_signed_type_minmax): New function.
* gdbtypes.h (get_unsigned_type_max): Declare.
(get_signed_type_minmax): Declare.
* guile/README: New file.
* guile/guile-internal.h: New file.
* guile/guile.c: New file.
* guile/guile.h: New file.
* guile/scm-arch.c: New file.
* guile/scm-auto-load.c: New file.
* guile/scm-block.c: New file.
* guile/scm-breakpoint.c: New file.
* guile/scm-disasm.c: New file.
* guile/scm-exception.c: New file.
* guile/scm-frame.c: New file.
* guile/scm-gsmob.c: New file.
* guile/scm-iterator.c: New file.
* guile/scm-lazy-string.c: New file.
* guile/scm-math.c: New file.
* guile/scm-objfile.c: New file.
* guile/scm-ports.c: New file.
* guile/scm-pretty-print.c: New file.
* guile/scm-safe-call.c: New file.
* guile/scm-string.c: New file.
* guile/scm-symbol.c: New file.
* guile/scm-symtab.c: New file.
* guile/scm-type.c: New file.
* guile/scm-utils.c: New file.
* guile/scm-value.c: New file.
* guile/lib/gdb.scm: New file.
* guile/lib/gdb/boot.scm: New file.
* guile/lib/gdb/experimental.scm: New file.
* guile/lib/gdb/init.scm: New file.
* guile/lib/gdb/iterator.scm: New file.
* guile/lib/gdb/printing.scm: New file.
* guile/lib/gdb/types.scm: New file.
* data-directory/Makefile.in (GUILE_SRCDIR): New variable.
(VPATH): Add $(GUILE_SRCDIR).
(GUILE_DIR): New variable.
(GUILE_INSTALL_DIR, GUILE_FILES): New variables.
(all): Add stamp-guile dependency.
(stamp-guile): New rule.
(clean-guile, install-guile, uninstall-guile): New rules.
(install-only): Add install-guile dependency.
(uninstall): Add uninstall-guile dependency.
(clean): Add clean-guile dependency.
doc/
* Makefile.in (GDB_DOC_FILES): Add guile.texi.
* gdb.texinfo (Auto-loading): Add set/show auto-load guile-scripts.
(Extending GDB): New menu entries Guile, Multiple Extension Languages.
(Guile docs): Include guile.texi.
(objfile-gdbdotext file): Add objfile-gdb.scm.
(dotdebug_gdb_scripts section): Mention Guile scripts.
(Multiple Extension Languages): New node.
* guile.texi: New file.
testsuite/
* configure.ac (AC_OUTPUT): Add gdb.guile.
* configure: Regenerate.
* lib/gdb-guile.exp: New file.
* lib/gdb.exp (get_target_charset): New function.
* gdb.base/help.exp: Update expected output from "apropos apropos".
* gdb.guile/Makefile.in: New file.
* gdb.guile/guile.exp: New file.
* gdb.guile/scm-arch.c: New file.
* gdb.guile/scm-arch.exp: New file.
* gdb.guile/scm-block.c: New file.
* gdb.guile/scm-block.exp: New file.
* gdb.guile/scm-breakpoint.c: New file.
* gdb.guile/scm-breakpoint.exp: New file.
* gdb.guile/scm-disasm.c: New file.
* gdb.guile/scm-disasm.exp: New file.
* gdb.guile/scm-equal.c: New file.
* gdb.guile/scm-equal.exp: New file.
* gdb.guile/scm-error.exp: New file.
* gdb.guile/scm-error.scm: New file.
* gdb.guile/scm-frame-args.c: New file.
* gdb.guile/scm-frame-args.exp: New file.
* gdb.guile/scm-frame-args.scm: New file.
* gdb.guile/scm-frame-inline.c: New file.
* gdb.guile/scm-frame-inline.exp: New file.
* gdb.guile/scm-frame.c: New file.
* gdb.guile/scm-frame.exp: New file.
* gdb.guile/scm-generics.exp: New file.
* gdb.guile/scm-gsmob.exp: New file.
* gdb.guile/scm-iterator.c: New file.
* gdb.guile/scm-iterator.exp: New file.
* gdb.guile/scm-math.c: New file.
* gdb.guile/scm-math.exp: New file.
* gdb.guile/scm-objfile-script-gdb.in: New file.
* gdb.guile/scm-objfile-script.c: New file.
* gdb.guile/scm-objfile-script.exp: New file.
* gdb.guile/scm-objfile.c: New file.
* gdb.guile/scm-objfile.exp: New file.
* gdb.guile/scm-ports.exp: New file.
* gdb.guile/scm-pretty-print.c: New file.
* gdb.guile/scm-pretty-print.exp: New file.
* gdb.guile/scm-pretty-print.scm: New file.
* gdb.guile/scm-section-script.c: New file.
* gdb.guile/scm-section-script.exp: New file.
* gdb.guile/scm-section-script.scm: New file.
* gdb.guile/scm-symbol.c: New file.
* gdb.guile/scm-symbol.exp: New file.
* gdb.guile/scm-symtab-2.c: New file.
* gdb.guile/scm-symtab.c: New file.
* gdb.guile/scm-symtab.exp: New file.
* gdb.guile/scm-type.c: New file.
* gdb.guile/scm-type.exp: New file.
* gdb.guile/scm-value-cc.cc: New file.
* gdb.guile/scm-value-cc.exp: New file.
* gdb.guile/scm-value.c: New file.
* gdb.guile/scm-value.exp: New file.
* gdb.guile/source2.scm: New file.
* gdb.guile/types-module.cc: New file.
* gdb.guile/types-module.exp: New file.
2014-02-10 03:40:01 +00:00
|
|
|
struct disassemble_info
|
2003-05-03 19:13:04 +00:00
|
|
|
gdb_disassemble_info (struct gdbarch *gdbarch, struct ui_file *file)
|
2002-09-30 15:57:26 +00:00
|
|
|
{
|
2003-09-04 Andrew Cagney <cagney@redhat.com>
* avr-tdep.c: Include "dis-asm.h".
* cris-tdep.c: Include "dis-asm.h".
(cris_delayed_get_disassembler): Use "struct disassemble_info"
instead of corresponding typedef.
* h8300-tdep.c: Include "dis-asm.h".
* ia64-tdep.c: Include "dis-asm.h".
* i386-tdep.c: Include "dis-asm.h".
(i386_print_insn): Use "struct disassemble_info" instead of
corresponding typedef.
* m68k-tdep.c: Include "dis-asm.h".
* mcore-tdep.c: Include "dis-asm.h".
* mips-tdep.c: Include "dis-asm.h".
(gdb_print_insn_mips): Make static, use "struct disassemble_info"
instead of corresponding typedef.
* ns32k-tdep.c: Include "dis-asm.h".
* s390-tdep.c: Include "dis-asm.h".
* sparc-tdep.c: Include "dis-asm.h".
* vax-tdep.c: Include "dis-asm.h".
* v850-tdep.c: Include "dis-asm.h".
* mn10300-tdep.c: Include "dis-asm.h".
* rs6000-tdep.c: Include "dis-asm.h".
* xstormy16-tdep.c: Include "dis-asm.h".
(_initialize_xstormy16_tdep): Delete "extern" declaration of
print_insn_xstormy16.
* Makefile.in (v850-tdep.o): Update dependencies.
(vax-tdep.o, sparc-tdep.o, s390-tdep.o): Ditto.
(ns32k-tdep.o, mips-tdep.o, mcore-tdep.o): Ditto.
(m68k-tdep.o, ia64-tdep.o, i386-tdep.o): Ditto.
(h8300-tdep.o, cris-tdep.o, avr-tdep.o): Ditto.
(mn10300-tdep.o, xstormy16-tdep.o, disasm.o): Ditto.
(gdbarch_h): Remove $(dis_asm_h).
* disasm.c: Include "dis-asm.h".
(dis_asm_read_memory): Use "struct disassemble_info" instead of
corresponding typedef.
(dis_asm_memory_error, dump_insns, do_assembly_only): Ditto.
(gdb_disassemble_info, gdb_disassembly, gdb_print_insn): Ditto.
* gdbarch.sh: Do not include "dis-asm.h".
(struct disassemble_info): Declare opaque.
(TARGET_PRINT_INSN): Update declaration.
* gdbarch.h, gdbarch.c: Re-generate.
2003-09-09 04:41:32 +00:00
|
|
|
struct disassemble_info di;
|
2010-05-14 17:53:16 +00:00
|
|
|
|
2003-09-03 23:46:58 +00:00
|
|
|
init_disassemble_info (&di, file, fprintf_disasm);
|
2003-05-01 23:21:08 +00:00
|
|
|
di.flavour = bfd_target_unknown_flavour;
|
|
|
|
di.memory_error_func = dis_asm_memory_error;
|
|
|
|
di.print_address_func = dis_asm_print_address;
|
|
|
|
/* NOTE: cagney/2003-04-28: The original code, from the old Insight
|
|
|
|
disassembler had a local optomization here. By default it would
|
|
|
|
access the executable file, instead of the target memory (there
|
Index: mi/ChangeLog
2003-10-24 Andrew Cagney <cagney@redhat.com>
* tui-out.c: Fix "fortunatly"[sic].
Index: doc/ChangeLog
2003-10-24 Andrew Cagney <cagney@redhat.com>
* annotate.texinfo: Fix "fortunatly"[sic].
2003-10-24 Andrew Cagney <cagney@redhat.com>
* osabi.c (gdbarch_init_osabi): Fix typos, and "fortunatly"[sic].
* PROBLEMS, arch-utils.c, cli-out.c, command.h: Ditto.
* complaints.c, cris-tdep.c, disasm.c, dwarf2-frame.c: Ditto.
* frame.c, frame.h, infcall.c, infcmd.c, infrun.c: Ditto.
* kod.c, mips-tdep.c, regcache.c, regcache.h, remote.c: Ditto.
2003-10-24 17:37:04 +00:00
|
|
|
was a growing list of exceptions though). Unfortunately, the
|
2003-05-01 23:21:08 +00:00
|
|
|
heuristic was flawed. Commands like "disassemble &variable"
|
|
|
|
didn't work as they relied on the access going to the target.
|
|
|
|
Further, it has been supperseeded by trust-read-only-sections
|
|
|
|
(although that should be superseeded by target_trust..._p()). */
|
|
|
|
di.read_memory_func = dis_asm_read_memory;
|
2003-07-18 20:16:23 +00:00
|
|
|
di.arch = gdbarch_bfd_arch_info (gdbarch)->arch;
|
2003-05-03 19:13:04 +00:00
|
|
|
di.mach = gdbarch_bfd_arch_info (gdbarch)->mach;
|
|
|
|
di.endian = gdbarch_byte_order (gdbarch);
|
2008-08-11 19:00:25 +00:00
|
|
|
di.endian_code = gdbarch_byte_order_for_code (gdbarch);
|
* 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.
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 17:21:10 +00:00
|
|
|
di.application_data = gdbarch;
|
2005-02-23 16:06:58 +00:00
|
|
|
disassemble_init_for_target (&di);
|
2003-05-03 19:13:04 +00:00
|
|
|
return di;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2009-07-02 17:17:42 +00:00
|
|
|
gdb_disassembly (struct gdbarch *gdbarch, struct ui_out *uiout,
|
2009-10-23 00:49:33 +00:00
|
|
|
char *file_string, int flags, int how_many,
|
|
|
|
CORE_ADDR low, CORE_ADDR high)
|
2003-05-03 19:13:04 +00:00
|
|
|
{
|
2012-03-27 19:08:37 +00:00
|
|
|
struct ui_file *stb = mem_fileopen ();
|
|
|
|
struct cleanup *cleanups = make_cleanup_ui_file_delete (stb);
|
|
|
|
struct disassemble_info di = gdb_disassemble_info (gdbarch, stb);
|
2014-11-15 18:08:34 +00:00
|
|
|
struct symtab *symtab;
|
2003-05-03 19:13:04 +00:00
|
|
|
struct linetable_entry *le = NULL;
|
|
|
|
int nlines = -1;
|
2002-09-30 15:57:26 +00:00
|
|
|
|
2011-01-07 19:36:19 +00:00
|
|
|
/* Assume symtab is valid for whole PC range. */
|
2014-11-15 18:08:34 +00:00
|
|
|
symtab = find_pc_line_symtab (low);
|
2002-09-30 15:57:26 +00:00
|
|
|
|
2014-11-18 17:32:10 +00:00
|
|
|
if (symtab != NULL && SYMTAB_LINETABLE (symtab) != NULL)
|
2015-08-15 04:45:54 +00:00
|
|
|
nlines = SYMTAB_LINETABLE (symtab)->nitems;
|
2002-09-30 15:57:26 +00:00
|
|
|
|
2015-08-15 04:45:54 +00:00
|
|
|
if (!(flags & (DISASSEMBLY_SOURCE_DEPRECATED | DISASSEMBLY_SOURCE))
|
|
|
|
|| nlines <= 0)
|
2009-07-11 14:04:23 +00:00
|
|
|
do_assembly_only (gdbarch, uiout, &di, low, high, how_many, flags, stb);
|
2002-09-30 15:57:26 +00:00
|
|
|
|
2009-07-11 14:04:23 +00:00
|
|
|
else if (flags & DISASSEMBLY_SOURCE)
|
2015-08-15 04:45:54 +00:00
|
|
|
do_mixed_source_and_assembly (gdbarch, uiout, &di, symtab, low, high,
|
|
|
|
how_many, flags, stb);
|
|
|
|
|
|
|
|
else if (flags & DISASSEMBLY_SOURCE_DEPRECATED)
|
|
|
|
do_mixed_source_and_assembly_deprecated (gdbarch, uiout, &di, symtab,
|
|
|
|
low, high, how_many, flags, stb);
|
2002-09-30 15:57:26 +00:00
|
|
|
|
2003-05-01 23:21:08 +00:00
|
|
|
do_cleanups (cleanups);
|
2002-09-30 15:57:26 +00:00
|
|
|
gdb_flush (gdb_stdout);
|
|
|
|
}
|
2003-04-30 Andrew Cagney <cagney@redhat.com>
* gdbarch.sh (deprecated_tm_print_insn_info): Rename
"tm_print_insn_info".
(TARGET_PRINT_INSN_INFO): Delete macro.
(dis_asm_read_memory): Delete function declaration.
(dis_asm_memory_error, dis_asm_print_address): Ditto.
(tm_print_insn_info): Delete variable definition.
(_initialize_gdbarch): Do not initialize "tm_print_insn_info".
* gdbarch.h, gdbarch.c: Re-generate.
* d10v-tdep.c (display_trace): Replace "tm_print_insn_info" with
"deprecated_tm_print_insn_info".
* mcore-tdep.c (mcore_dump_insn): Ditto.
* mips-tdep.c (mips_gdbarch_init): Ditto.
* sparc-tdep.c (_initialize_sparc_tdep): Ditto.
* v850-tdep.c (v850_scan_prologue, v850_gdbarch_init): Ditto.
* ia64-tdep.c (_initialize_ia64_tdep): Ditto.
* printcmd.c (print_insn): Use "deprecated_tm_print_insn_info"
instead of TARGET_PRINT_INSN_INFO, add comment.
* s390-tdep.c (s390_get_frame_info): Instead of
"dis_asm_read_memory", use "deprecated_tm_print_insn_info".
(s390_check_function_end, s390_is_sigreturn): Ditto.
* corefile.c (dis_asm_read_memory): Move to "disasm.c".
(dis_asm_memory_error, dis_asm_print_address): Ditto.
* disasm.c: Include "gdbcore.h".
(_initialize_disasm): New function, initialize
"deprecated_tm_print_insn_info".
(deprecated_tm_print_insn_info): New variable.
(dis_asm_read_memory): Moved from "corefile.c", made static.
(dis_asm_print_address, dis_asm_memory_error): Ditto.
* Makefile.in (disasm.o): Update dependencies.
2003-04-28 Andrew Cagney <cagney@redhat.com>
* gdbint.texinfo (Target Architecture Definition): Replace
read_fp, TARGET_READ_FP and FP_REGNUM, with deprecated_read_fp,
DEPRECATED_TARGET_READ_FP and DEPRECATED_REGNUM.
2003-04-30 22:01:38 +00:00
|
|
|
|
2003-05-03 19:13:04 +00:00
|
|
|
/* Print the instruction at address MEMADDR in debugged memory,
|
2007-06-21 15:18:51 +00:00
|
|
|
on STREAM. Returns the length of the instruction, in bytes,
|
|
|
|
and, if requested, the number of branch delay slot instructions. */
|
2003-05-03 19:13:04 +00:00
|
|
|
|
|
|
|
int
|
2009-07-02 17:17:42 +00:00
|
|
|
gdb_print_insn (struct gdbarch *gdbarch, CORE_ADDR memaddr,
|
|
|
|
struct ui_file *stream, int *branch_delay_insns)
|
2003-05-03 19:13:04 +00:00
|
|
|
{
|
2007-06-21 15:18:51 +00:00
|
|
|
struct disassemble_info di;
|
|
|
|
int length;
|
|
|
|
|
2009-07-02 17:17:42 +00:00
|
|
|
di = gdb_disassemble_info (gdbarch, stream);
|
|
|
|
length = gdbarch_print_insn (gdbarch, memaddr, &di);
|
2007-06-21 15:18:51 +00:00
|
|
|
if (branch_delay_insns)
|
|
|
|
{
|
|
|
|
if (di.insn_info_valid)
|
|
|
|
*branch_delay_insns = di.branch_delay_insns;
|
|
|
|
else
|
|
|
|
*branch_delay_insns = 0;
|
|
|
|
}
|
|
|
|
return length;
|
2003-05-03 19:13:04 +00:00
|
|
|
}
|
2010-05-06 00:21:53 +00:00
|
|
|
|
|
|
|
static void
|
|
|
|
do_ui_file_delete (void *arg)
|
|
|
|
{
|
|
|
|
ui_file_delete (arg);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Return the length in bytes of the instruction at address MEMADDR in
|
|
|
|
debugged memory. */
|
|
|
|
|
|
|
|
int
|
|
|
|
gdb_insn_length (struct gdbarch *gdbarch, CORE_ADDR addr)
|
|
|
|
{
|
|
|
|
static struct ui_file *null_stream = NULL;
|
|
|
|
|
|
|
|
/* Dummy file descriptor for the disassembler. */
|
|
|
|
if (!null_stream)
|
|
|
|
{
|
|
|
|
null_stream = ui_file_new ();
|
|
|
|
make_final_cleanup (do_ui_file_delete, null_stream);
|
|
|
|
}
|
|
|
|
|
|
|
|
return gdb_print_insn (gdbarch, addr, null_stream, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* fprintf-function for gdb_buffered_insn_length. This function is a
|
|
|
|
nop, we don't want to print anything, we just want to compute the
|
|
|
|
length of the insn. */
|
|
|
|
|
|
|
|
static int ATTRIBUTE_PRINTF (2, 3)
|
|
|
|
gdb_buffered_insn_length_fprintf (void *stream, const char *format, ...)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Initialize a struct disassemble_info for gdb_buffered_insn_length. */
|
|
|
|
|
|
|
|
static void
|
|
|
|
gdb_buffered_insn_length_init_dis (struct gdbarch *gdbarch,
|
|
|
|
struct disassemble_info *di,
|
|
|
|
const gdb_byte *insn, int max_len,
|
|
|
|
CORE_ADDR addr)
|
|
|
|
{
|
|
|
|
init_disassemble_info (di, NULL, gdb_buffered_insn_length_fprintf);
|
|
|
|
|
|
|
|
/* init_disassemble_info installs buffer_read_memory, etc.
|
|
|
|
so we don't need to do that here.
|
|
|
|
The cast is necessary until disassemble_info is const-ified. */
|
|
|
|
di->buffer = (gdb_byte *) insn;
|
|
|
|
di->buffer_length = max_len;
|
|
|
|
di->buffer_vma = addr;
|
|
|
|
|
|
|
|
di->arch = gdbarch_bfd_arch_info (gdbarch)->arch;
|
|
|
|
di->mach = gdbarch_bfd_arch_info (gdbarch)->mach;
|
|
|
|
di->endian = gdbarch_byte_order (gdbarch);
|
|
|
|
di->endian_code = gdbarch_byte_order_for_code (gdbarch);
|
|
|
|
|
|
|
|
disassemble_init_for_target (di);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Return the length in bytes of INSN. MAX_LEN is the size of the
|
|
|
|
buffer containing INSN. */
|
|
|
|
|
|
|
|
int
|
|
|
|
gdb_buffered_insn_length (struct gdbarch *gdbarch,
|
|
|
|
const gdb_byte *insn, int max_len, CORE_ADDR addr)
|
|
|
|
{
|
|
|
|
struct disassemble_info di;
|
|
|
|
|
|
|
|
gdb_buffered_insn_length_init_dis (gdbarch, &di, insn, max_len, addr);
|
|
|
|
|
|
|
|
return gdbarch_print_insn (gdbarch, addr, &di);
|
|
|
|
}
|