2011-01-08 Michael Snyder <msnyder@vmware.com>
* m2-exp.y: Comment cleanup, mostly periods and spaces. * m2-lang.c: Ditto. * m2-typeprint.c: Ditto. * m2-valprint.c: Ditto. * m32c-tdep.c: Ditto. * m32r-linux-nat.c: Ditto. * m32r-rom.c: Ditto. * m32r-tdep.c: Ditto. * m32r-tdep.h: Ditto. * m68hc11-tdep.c: Ditto. * m58klinux-nat.c: Ditto. * m68k-tdep.c: Ditto. * m88k-tdep.c: Ditto. * m88k-tdep.h: Ditto. * machoread.c: Ditto. * macrocmd.c: Ditto. * macroexp.c: Ditto. * macrotab.c: Ditto. * main.c: Ditto. * maint.c: Ditto. * mdebugread.c: Ditto. * mdebugread.h: Ditto. * memattr.c: Ditto. * memattr.h: Ditto. * memory-map.h: Ditto. * mep-tdep.c: Ditto. * microblaze-rom.c: Ditto. * microblaze-tdep.c: Ditto. * minsyms.c: Ditto. * mips-irix-tdep.c: Ditto. * mips-linux-nat.c: Ditto. * mips-linux-tdep.c: Ditto. * mips-linux-tdep.h: Ditto. * mipsnbsd-nat.c: Ditto. * mipsnbsd-tdep.c: Ditto. * mipsread.c: Ditto. * mips-tdep.c: Ditto. * mips-tdep.h: Ditto. * mn10300-linux-tdep.c: Ditto. * mn10300-tdep.c: Ditto. * mn10300-tdep.h: Ditto. * monitor.c: Ditto. * monitor.h: Ditto. * moxie-tdep.c: Ditto. * moxie-tdep.h: Ditto. * mt-tdep.c: Ditto.
This commit is contained in:
parent
1777feb0fe
commit
025bb325db
@ -51,6 +51,55 @@
|
||||
* linux-thread-db.c: Ditto.
|
||||
* lm32-tdep.c: Ditto.
|
||||
|
||||
2011-01-08 Michael Snyder <msnyder@vmware.com>
|
||||
|
||||
* m2-exp.y: Comment cleanup, mostly periods and spaces.
|
||||
* m2-lang.c: Ditto.
|
||||
* m2-typeprint.c: Ditto.
|
||||
* m2-valprint.c: Ditto.
|
||||
* m32c-tdep.c: Ditto.
|
||||
* m32r-linux-nat.c: Ditto.
|
||||
* m32r-rom.c: Ditto.
|
||||
* m32r-tdep.c: Ditto.
|
||||
* m32r-tdep.h: Ditto.
|
||||
* m68hc11-tdep.c: Ditto.
|
||||
* m58klinux-nat.c: Ditto.
|
||||
* m68k-tdep.c: Ditto.
|
||||
* m88k-tdep.c: Ditto.
|
||||
* m88k-tdep.h: Ditto.
|
||||
* machoread.c: Ditto.
|
||||
* macrocmd.c: Ditto.
|
||||
* macroexp.c: Ditto.
|
||||
* macrotab.c: Ditto.
|
||||
* main.c: Ditto.
|
||||
* maint.c: Ditto.
|
||||
* mdebugread.c: Ditto.
|
||||
* mdebugread.h: Ditto.
|
||||
* memattr.c: Ditto.
|
||||
* memattr.h: Ditto.
|
||||
* memory-map.h: Ditto.
|
||||
* mep-tdep.c: Ditto.
|
||||
* microblaze-rom.c: Ditto.
|
||||
* microblaze-tdep.c: Ditto.
|
||||
* minsyms.c: Ditto.
|
||||
* mips-irix-tdep.c: Ditto.
|
||||
* mips-linux-nat.c: Ditto.
|
||||
* mips-linux-tdep.c: Ditto.
|
||||
* mips-linux-tdep.h: Ditto.
|
||||
* mipsnbsd-nat.c: Ditto.
|
||||
* mipsnbsd-tdep.c: Ditto.
|
||||
* mipsread.c: Ditto.
|
||||
* mips-tdep.c: Ditto.
|
||||
* mips-tdep.h: Ditto.
|
||||
* mn10300-linux-tdep.c: Ditto.
|
||||
* mn10300-tdep.c: Ditto.
|
||||
* mn10300-tdep.h: Ditto.
|
||||
* monitor.c: Ditto.
|
||||
* monitor.h: Ditto.
|
||||
* moxie-tdep.c: Ditto.
|
||||
* moxie-tdep.h: Ditto.
|
||||
* mt-tdep.c: Ditto.
|
||||
|
||||
2011-01-08 Mike Frysinger <vapier@gentoo.org>
|
||||
|
||||
* bfin-tdep.h (BFIN_A0_DOT_W_REGNUM): Fix typo in name.
|
||||
|
16
gdb/m2-exp.y
16
gdb/m2-exp.y
@ -34,7 +34,7 @@
|
||||
generator. Doing this with #defines and trying to control the interaction
|
||||
with include files (<malloc.h> and <stdlib.h> for example) just became
|
||||
too messy, particularly when such includes can be inserted at random
|
||||
times by the parser generator. */
|
||||
times by the parser generator. */
|
||||
|
||||
%{
|
||||
|
||||
@ -58,7 +58,7 @@
|
||||
yacc generated parsers in gdb. Note that these are only the variables
|
||||
produced by yacc. If other parser generators (bison, byacc, etc) produce
|
||||
additional global names that conflict at link time, then those parser
|
||||
generators need to be fixed instead of adding those names to this list. */
|
||||
generators need to be fixed instead of adding those names to this list. */
|
||||
|
||||
#define yymaxdepth m2_maxdepth
|
||||
#define yyparse m2_parse
|
||||
@ -119,7 +119,7 @@ static char *make_qualname (char *, char *);
|
||||
|
||||
static int parse_number (int);
|
||||
|
||||
/* The sign of the number being parsed. */
|
||||
/* The sign of the number being parsed. */
|
||||
static int number_sign = 1;
|
||||
|
||||
/* The block that the module specified by the qualifer on an identifer is
|
||||
@ -543,7 +543,7 @@ exp : STRING
|
||||
write_exp_elt_opcode (OP_M2_STRING); }
|
||||
;
|
||||
|
||||
/* This will be used for extensions later. Like adding modules. */
|
||||
/* This will be used for extensions later. Like adding modules. */
|
||||
block : fblock
|
||||
{ $$ = SYMBOL_BLOCK_VALUE($1); }
|
||||
;
|
||||
@ -596,7 +596,7 @@ variable: block COLONCOLON NAME
|
||||
write_exp_elt_opcode (OP_VAR_VALUE); }
|
||||
;
|
||||
|
||||
/* Base case for variables. */
|
||||
/* Base case for variables. */
|
||||
variable: NAME
|
||||
{ struct symbol *sym;
|
||||
int is_a_field_of_this;
|
||||
@ -718,7 +718,7 @@ parse_number (olen)
|
||||
if(!unsigned_p && number_sign == 1 && (prevn >= n))
|
||||
unsigned_p=1; /* Try something unsigned */
|
||||
/* Don't do the range check if n==i and i==0, since that special
|
||||
case will give an overflow error. */
|
||||
case will give an overflow error. */
|
||||
if(RANGE_CHECK && n!=i && i)
|
||||
{
|
||||
if((unsigned_p && (unsigned)prevn >= (unsigned)n) ||
|
||||
@ -1051,7 +1051,7 @@ yylex ()
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Built-in BOOLEAN type. This is sort of a hack. */
|
||||
/* Built-in BOOLEAN type. This is sort of a hack. */
|
||||
if (strncmp (tokstart, "TRUE", 4) == 0)
|
||||
{
|
||||
yylval.ulval = 1;
|
||||
@ -1064,7 +1064,7 @@ yylex ()
|
||||
}
|
||||
}
|
||||
|
||||
/* Must be another type of name... */
|
||||
/* Must be another type of name... */
|
||||
return NAME;
|
||||
}
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ static void
|
||||
m2_emit_char (int c, struct type *type, struct ui_file *stream, int quoter)
|
||||
{
|
||||
|
||||
c &= 0xFF; /* Avoid sign bit follies */
|
||||
c &= 0xFF; /* Avoid sign bit follies. */
|
||||
|
||||
if (PRINT_LITERAL_FORM (c))
|
||||
{
|
||||
@ -243,7 +243,8 @@ evaluate_subexp_modula2 (struct type *expect_type, struct expression *exp,
|
||||
type = TYPE_FIELD_TYPE (type, 0);
|
||||
if (type == NULL || (TYPE_CODE (type) != TYPE_CODE_PTR))
|
||||
{
|
||||
warning (_("internal error: unbounded array structure is unknown"));
|
||||
warning (_("internal error: unbounded "
|
||||
"array structure is unknown"));
|
||||
return evaluate_subexp_standard (expect_type, exp, pos, noside);
|
||||
}
|
||||
/* i18n: Do not translate the "_m2_contents" part! */
|
||||
@ -389,7 +390,8 @@ const struct language_defn m2_language_defn =
|
||||
basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
|
||||
basic_lookup_transparent_type,/* lookup_transparent_type */
|
||||
NULL, /* Language specific symbol demangler */
|
||||
NULL, /* Language specific class_name_from_physname */
|
||||
NULL, /* Language specific
|
||||
class_name_from_physname */
|
||||
m2_op_print_tab, /* expression operators for printing */
|
||||
0, /* arrays are first-class (not c-style) */
|
||||
0, /* String lower bound */
|
||||
|
@ -67,7 +67,8 @@ int m2_is_unbounded_array (struct type *type);
|
||||
|
||||
|
||||
void
|
||||
m2_print_type (struct type *type, const char *varstring, struct ui_file *stream,
|
||||
m2_print_type (struct type *type, const char *varstring,
|
||||
struct ui_file *stream,
|
||||
int show, int level)
|
||||
{
|
||||
enum type_code code;
|
||||
@ -133,7 +134,7 @@ m2_print_type (struct type *type, const char *varstring, struct ui_file *stream,
|
||||
break;
|
||||
|
||||
case TYPE_CODE_UNDEF:
|
||||
/* i18n: Do not translate the "struct" part! */
|
||||
/* i18n: Do not translate the "struct" part! */
|
||||
m2_unknown (_("undef"), type, stream, show, level);
|
||||
break;
|
||||
|
||||
@ -328,8 +329,8 @@ m2_short_set (struct type *type, struct ui_file *stream, int show, int level)
|
||||
int
|
||||
m2_is_long_set (struct type *type)
|
||||
{
|
||||
LONGEST previous_high = 0; /* unnecessary initialization
|
||||
keeps gcc -Wall happy */
|
||||
LONGEST previous_high = 0; /* Unnecessary initialization
|
||||
keeps gcc -Wall happy. */
|
||||
int len, i;
|
||||
struct type *range;
|
||||
|
||||
@ -467,7 +468,7 @@ m2_long_set (struct type *type, struct ui_file *stream, int show, int level)
|
||||
}
|
||||
}
|
||||
else
|
||||
/* i18n: Do not translate the "SET OF" part! */
|
||||
/* i18n: Do not translate the "SET OF" part! */
|
||||
fprintf_filtered(stream, _("SET OF <unknown>"));
|
||||
|
||||
return 1;
|
||||
@ -554,7 +555,7 @@ m2_record_fields (struct type *type, struct ui_file *stream, int show,
|
||||
if (TYPE_CODE (type) == TYPE_CODE_STRUCT)
|
||||
fprintf_filtered (stream, "RECORD\n");
|
||||
else if (TYPE_CODE (type) == TYPE_CODE_UNION)
|
||||
/* i18n: Do not translate "CASE" and "OF" */
|
||||
/* i18n: Do not translate "CASE" and "OF". */
|
||||
fprintf_filtered (stream, _("CASE <variant> OF\n"));
|
||||
|
||||
for (i = TYPE_N_BASECLASSES (type); i < len; i++)
|
||||
|
@ -323,7 +323,7 @@ m2_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
|
||||
const struct value_print_options *options)
|
||||
{
|
||||
struct gdbarch *gdbarch = get_type_arch (type);
|
||||
unsigned int i = 0; /* Number of characters printed */
|
||||
unsigned int i = 0; /* Number of characters printed. */
|
||||
unsigned len;
|
||||
struct type *elttype;
|
||||
unsigned eltlen;
|
||||
@ -354,7 +354,7 @@ m2_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
|
||||
{
|
||||
unsigned int temp_len;
|
||||
|
||||
/* Look for a NULL char. */
|
||||
/* Look for a NULL char. */
|
||||
for (temp_len = 0;
|
||||
(valaddr + embedded_offset)[temp_len]
|
||||
&& temp_len < len && temp_len < options->print_max;
|
||||
@ -371,7 +371,8 @@ m2_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
|
||||
{
|
||||
fprintf_filtered (stream, "{");
|
||||
val_print_array_elements (type, valaddr + embedded_offset,
|
||||
address, stream, recurse, original_value,
|
||||
address, stream,
|
||||
recurse, original_value,
|
||||
options, 0);
|
||||
fprintf_filtered (stream, "}");
|
||||
}
|
||||
|
@ -2345,8 +2345,8 @@ m32c_skip_trampoline_code (struct frame_info *frame, CORE_ADDR stop_pc)
|
||||
|
||||
/* What we have now is the address of a jump instruction.
|
||||
What we need is the destination of that jump.
|
||||
The opcode is 1 byte, and the destination is the next 3 bytes.
|
||||
*/
|
||||
The opcode is 1 byte, and the destination is the next 3 bytes. */
|
||||
|
||||
target = read_memory_unsigned_integer (target + 1, 3, byte_order);
|
||||
return target;
|
||||
}
|
||||
@ -2566,7 +2566,8 @@ m32c_virtual_frame_pointer (struct gdbarch *gdbarch, CORE_ADDR pc,
|
||||
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
|
||||
|
||||
if (!find_pc_partial_function (pc, &name, &func_addr, &func_end))
|
||||
internal_error (__FILE__, __LINE__, _("No virtual frame pointer available"));
|
||||
internal_error (__FILE__, __LINE__,
|
||||
_("No virtual frame pointer available"));
|
||||
|
||||
m32c_analyze_prologue (gdbarch, func_addr, pc, &p);
|
||||
switch (p.kind)
|
||||
@ -2586,7 +2587,8 @@ m32c_virtual_frame_pointer (struct gdbarch *gdbarch, CORE_ADDR pc,
|
||||
}
|
||||
/* Sanity check */
|
||||
if (*frame_regnum > gdbarch_num_regs (gdbarch))
|
||||
internal_error (__FILE__, __LINE__, _("No virtual frame pointer available"));
|
||||
internal_error (__FILE__, __LINE__,
|
||||
_("No virtual frame pointer available"));
|
||||
}
|
||||
|
||||
|
||||
@ -2638,8 +2640,7 @@ m32c_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
|
||||
They may be in the dwarf2 cfi code in GDB, or they may be in
|
||||
the debug info emitted by the upstream toolchain. I don't
|
||||
know which, but I do know that the prologue analyzer works better.
|
||||
MVS 04/13/06
|
||||
*/
|
||||
MVS 04/13/06 */
|
||||
dwarf2_append_sniffers (arch);
|
||||
#endif
|
||||
frame_unwind_append_unwinder (arch, &m32c_unwind);
|
||||
@ -2657,7 +2658,7 @@ m32c_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
|
||||
/* m32c function boundary addresses are not necessarily even.
|
||||
Therefore, the `vbit', which indicates a pointer to a virtual
|
||||
member function, is stored in the delta field, rather than as
|
||||
the low bit of a function pointer address.
|
||||
the low bit of a function pointer address.
|
||||
|
||||
In order to verify this, see the definition of
|
||||
TARGET_PTRMEMFUNC_VBIT_LOCATION in gcc/defaults.h along with the
|
||||
|
@ -56,8 +56,9 @@ static int regmap[] = {
|
||||
#define SPU_REGMAP 23
|
||||
#define SPI_REGMAP 26
|
||||
|
||||
/* Doee apply to the corresponding SET requests as well. */
|
||||
#define GETREGS_SUPPLIES(regno) (0 <= (regno) && (regno) <= M32R_LINUX_NUM_REGS)
|
||||
/* Doee (??) apply to the corresponding SET requests as well. */
|
||||
#define GETREGS_SUPPLIES(regno) (0 <= (regno) \
|
||||
&& (regno) <= M32R_LINUX_NUM_REGS)
|
||||
|
||||
|
||||
|
||||
|
111
gdb/m32r-rom.c
111
gdb/m32r-rom.c
@ -21,7 +21,7 @@
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* This module defines communication with the Renesas m32r monitor */
|
||||
/* This module defines communication with the Renesas m32r monitor. */
|
||||
|
||||
#include "defs.h"
|
||||
#include "gdbcore.h"
|
||||
@ -36,7 +36,7 @@
|
||||
#include <sys/time.h>
|
||||
#include <time.h> /* for time_t */
|
||||
#include "gdb_string.h"
|
||||
#include "objfiles.h" /* for ALL_OBJFILES etc. */
|
||||
#include "objfiles.h" /* for ALL_OBJFILES etc. */
|
||||
#include "inferior.h"
|
||||
#include <ctype.h>
|
||||
#include "regcache.h"
|
||||
@ -174,19 +174,19 @@ m32r_load (char *filename, int from_tty)
|
||||
print_transfer_performance (gdb_stdout, data_count, 0, &start_time,
|
||||
&end_time);
|
||||
|
||||
/* Finally, make the PC point at the start address */
|
||||
/* Finally, make the PC point at the start address. */
|
||||
if (exec_bfd)
|
||||
regcache_write_pc (get_current_regcache (),
|
||||
bfd_get_start_address (exec_bfd));
|
||||
|
||||
inferior_ptid = null_ptid; /* No process now */
|
||||
inferior_ptid = null_ptid; /* No process now. */
|
||||
|
||||
/* This is necessary because many things were based on the PC at the
|
||||
time that we attached to the monitor, which is no longer valid
|
||||
now that we have loaded new code (and just changed the PC).
|
||||
Another way to do this might be to call normal_stop, except that
|
||||
the stack may not be valid, and things would get horribly
|
||||
confused... */
|
||||
confused... */
|
||||
|
||||
clear_symtab_users (0);
|
||||
}
|
||||
@ -200,10 +200,10 @@ m32r_load_gen (char *filename, int from_tty)
|
||||
static void m32r_open (char *args, int from_tty);
|
||||
static void mon2000_open (char *args, int from_tty);
|
||||
|
||||
/* This array of registers needs to match the indexes used by GDB. The
|
||||
/* This array of registers needs to match the indexes used by GDB. The
|
||||
whole reason this exists is because the various ROM monitors use
|
||||
different names than GDB does, and don't support all the registers
|
||||
either. So, typing "info reg sp" becomes an "A7". */
|
||||
either. So, typing "info reg sp" becomes an "A7". */
|
||||
|
||||
static char *m32r_regnames[] =
|
||||
{ "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
|
||||
@ -227,9 +227,9 @@ m32r_supply_register (struct regcache *regcache, char *regname,
|
||||
return; /* no match */
|
||||
|
||||
if (regno == ACCL_REGNUM)
|
||||
{ /* special handling for 64-bit acc reg */
|
||||
{ /* Special handling for 64-bit acc reg. */
|
||||
monitor_supply_register (regcache, ACCH_REGNUM, val);
|
||||
val = strchr (val, ':'); /* skip past ':' to get 2nd word */
|
||||
val = strchr (val, ':'); /* Skip past ':' to get 2nd word. */
|
||||
if (val != NULL)
|
||||
monitor_supply_register (regcache, ACCL_REGNUM, val + 1);
|
||||
}
|
||||
@ -243,37 +243,45 @@ m32r_supply_register (struct regcache *regcache, char *regname,
|
||||
|
||||
#ifdef SM_REGNUM
|
||||
/* Stack mode bit */
|
||||
monitor_supply_register (regcache, SM_REGNUM, (psw & 0x80) ? one : zero);
|
||||
monitor_supply_register (regcache, SM_REGNUM,
|
||||
(psw & 0x80) ? one : zero);
|
||||
#endif
|
||||
#ifdef BSM_REGNUM
|
||||
/* Backup stack mode bit */
|
||||
monitor_supply_register (regcache, BSM_REGNUM, (psw & 0x8000) ? one : zero);
|
||||
monitor_supply_register (regcache, BSM_REGNUM,
|
||||
(psw & 0x8000) ? one : zero);
|
||||
#endif
|
||||
#ifdef IE_REGNUM
|
||||
/* Interrupt enable bit */
|
||||
monitor_supply_register (regcache, IE_REGNUM, (psw & 0x40) ? one : zero);
|
||||
monitor_supply_register (regcache, IE_REGNUM,
|
||||
(psw & 0x40) ? one : zero);
|
||||
#endif
|
||||
#ifdef BIE_REGNUM
|
||||
/* Backup interrupt enable bit */
|
||||
monitor_supply_register (regcache, BIE_REGNUM, (psw & 0x4000) ? one : zero);
|
||||
monitor_supply_register (regcache, BIE_REGNUM,
|
||||
(psw & 0x4000) ? one : zero);
|
||||
#endif
|
||||
#ifdef COND_REGNUM
|
||||
/* Condition bit (carry etc.) */
|
||||
monitor_supply_register (regcache, COND_REGNUM, (psw & 0x1) ? one : zero);
|
||||
monitor_supply_register (regcache, COND_REGNUM,
|
||||
(psw & 0x1) ? one : zero);
|
||||
#endif
|
||||
#ifdef CBR_REGNUM
|
||||
monitor_supply_register (regcache, CBR_REGNUM, (psw & 0x1) ? one : zero);
|
||||
monitor_supply_register (regcache, CBR_REGNUM,
|
||||
(psw & 0x1) ? one : zero);
|
||||
#endif
|
||||
#ifdef BPC_REGNUM
|
||||
monitor_supply_register (regcache, BPC_REGNUM, zero); /* KLUDGE: (???????) */
|
||||
monitor_supply_register (regcache, BPC_REGNUM,
|
||||
zero); /* KLUDGE: (???????) */
|
||||
#endif
|
||||
#ifdef BCARRY_REGNUM
|
||||
monitor_supply_register (regcache, BCARRY_REGNUM, zero); /* KLUDGE: (??????) */
|
||||
monitor_supply_register (regcache, BCARRY_REGNUM,
|
||||
zero); /* KLUDGE: (??????) */
|
||||
#endif
|
||||
}
|
||||
|
||||
if (regno == SPI_REGNUM || regno == SPU_REGNUM)
|
||||
{ /* special handling for stack pointer (spu or spi) */
|
||||
{ /* special handling for stack pointer (spu or spi). */
|
||||
ULONGEST stackmode, psw;
|
||||
regcache_cooked_read_unsigned (regcache, PSW_REGNUM, &psw);
|
||||
stackmode = psw & 0x80;
|
||||
@ -331,7 +339,8 @@ init_m32r_cmds (void)
|
||||
m32r_cmds.getreg.term = NULL; /* getreg.term */
|
||||
m32r_cmds.getreg.term_cmd = NULL; /* getreg.term_cmd */
|
||||
m32r_cmds.dump_registers = ".reg\r"; /* dump_registers */
|
||||
m32r_cmds.register_pattern = "\\(\\w+\\) += \\([0-9a-fA-F]+\\b\\)"; /* register_pattern */
|
||||
/* register_pattern */
|
||||
m32r_cmds.register_pattern = "\\(\\w+\\) += \\([0-9a-fA-F]+\\b\\)";
|
||||
m32r_cmds.supply_register = m32r_supply_register;
|
||||
m32r_cmds.load_routine = NULL; /* load_routine (defaults to SRECs) */
|
||||
m32r_cmds.load = NULL; /* download command */
|
||||
@ -391,7 +400,8 @@ init_mon2000_cmds (void)
|
||||
mon2000_cmds.getreg.term = NULL; /* getreg.term */
|
||||
mon2000_cmds.getreg.term_cmd = NULL; /* getreg.term_cmd */
|
||||
mon2000_cmds.dump_registers = ".reg\r"; /* dump_registers */
|
||||
mon2000_cmds.register_pattern = "\\(\\w+\\) += \\([0-9a-fA-F]+\\b\\)"; /* register_pattern */
|
||||
/* register_pattern */
|
||||
mon2000_cmds.register_pattern = "\\(\\w+\\) += \\([0-9a-fA-F]+\\b\\)";
|
||||
mon2000_cmds.supply_register = m32r_supply_register;
|
||||
mon2000_cmds.load_routine = NULL; /* load_routine (defaults to SRECs) */
|
||||
mon2000_cmds.load = NULL; /* download command */
|
||||
@ -422,7 +432,7 @@ m32r_upload_command (char *args, int from_tty)
|
||||
struct hostent *hostent;
|
||||
struct in_addr inet_addr;
|
||||
|
||||
/* first check to see if there's an ethernet port! */
|
||||
/* First check to see if there's an ethernet port! */
|
||||
monitor_printf ("ust\r");
|
||||
resp_len = monitor_expect_prompt (buf, sizeof (buf));
|
||||
if (!strchr (buf, ':'))
|
||||
@ -430,15 +440,15 @@ m32r_upload_command (char *args, int from_tty)
|
||||
|
||||
if (board_addr == 0)
|
||||
{
|
||||
/* scan second colon in the output from the "ust" command */
|
||||
/* Scan second colon in the output from the "ust" command. */
|
||||
char *myIPaddress = strchr (strchr (buf, ':') + 1, ':') + 1;
|
||||
|
||||
while (isspace (*myIPaddress))
|
||||
myIPaddress++;
|
||||
|
||||
if (!strncmp (myIPaddress, "0.0.", 4)) /* empty */
|
||||
error
|
||||
("Please use 'set board-address' to set the M32R-EVA board's IP address.");
|
||||
error ("Please use 'set board-address' to "
|
||||
"set the M32R-EVA board's IP address.");
|
||||
if (strchr (myIPaddress, '('))
|
||||
*(strchr (myIPaddress, '(')) = '\0'; /* delete trailing junk */
|
||||
board_addr = xstrdup (myIPaddress);
|
||||
@ -447,7 +457,7 @@ m32r_upload_command (char *args, int from_tty)
|
||||
{
|
||||
#ifdef __MINGW32__
|
||||
WSADATA wd;
|
||||
/* Winsock initialization. */
|
||||
/* Winsock initialization. */
|
||||
if (WSAStartup (MAKEWORD (1, 1), &wd))
|
||||
error (_("Couldn't initialize WINSOCK."));
|
||||
#endif
|
||||
@ -468,12 +478,13 @@ m32r_upload_command (char *args, int from_tty)
|
||||
#endif
|
||||
}
|
||||
}
|
||||
if (server_addr == 0) /* failed? */
|
||||
error
|
||||
("Need to know gdb host computer's IP address (use 'set server-address')");
|
||||
if (server_addr == 0) /* failed? */
|
||||
error ("Need to know gdb host computer's "
|
||||
"IP address (use 'set server-address')");
|
||||
}
|
||||
|
||||
if (args == 0 || args[0] == 0) /* no args: upload the current file */
|
||||
if (args == 0 || args[0] == 0) /* No args: upload the current
|
||||
file. */
|
||||
args = get_exec_file (1);
|
||||
|
||||
if (args[0] != '/' && download_path == 0)
|
||||
@ -481,30 +492,30 @@ m32r_upload_command (char *args, int from_tty)
|
||||
if (current_directory)
|
||||
download_path = xstrdup (current_directory);
|
||||
else
|
||||
error
|
||||
("Need to know default download path (use 'set download-path')");
|
||||
error ("Need to know default download "
|
||||
"path (use 'set download-path')");
|
||||
}
|
||||
|
||||
gettimeofday (&start_time, NULL);
|
||||
monitor_printf ("uhip %s\r", server_addr);
|
||||
resp_len = monitor_expect_prompt (buf, sizeof (buf)); /* parse result? */
|
||||
resp_len = monitor_expect_prompt (buf, sizeof (buf)); /* parse result? */
|
||||
monitor_printf ("ulip %s\r", board_addr);
|
||||
resp_len = monitor_expect_prompt (buf, sizeof (buf)); /* parse result? */
|
||||
resp_len = monitor_expect_prompt (buf, sizeof (buf)); /* parse result? */
|
||||
if (args[0] != '/')
|
||||
monitor_printf ("up %s\r", download_path); /* use default path */
|
||||
else
|
||||
monitor_printf ("up\r"); /* rooted filename/path */
|
||||
resp_len = monitor_expect_prompt (buf, sizeof (buf)); /* parse result? */
|
||||
resp_len = monitor_expect_prompt (buf, sizeof (buf)); /* parse result? */
|
||||
|
||||
if (strrchr (args, '.') && !strcmp (strrchr (args, '.'), ".srec"))
|
||||
monitor_printf ("ul %s\r", args);
|
||||
else /* add ".srec" suffix */
|
||||
monitor_printf ("ul %s.srec\r", args);
|
||||
resp_len = monitor_expect_prompt (buf, sizeof (buf)); /* parse result? */
|
||||
resp_len = monitor_expect_prompt (buf, sizeof (buf)); /* parse result? */
|
||||
|
||||
if (buf[0] == 0 || strstr (buf, "complete") == 0)
|
||||
error
|
||||
("Upload file not found: %s.srec\nCheck IP addresses and download path.",
|
||||
error ("Upload file not found: %s.srec\n"
|
||||
"Check IP addresses and download path.",
|
||||
args);
|
||||
else
|
||||
printf_filtered (" -- Ethernet load complete.\n");
|
||||
@ -512,7 +523,7 @@ m32r_upload_command (char *args, int from_tty)
|
||||
gettimeofday (&end_time, NULL);
|
||||
abfd = bfd_openr (args, 0);
|
||||
if (abfd != NULL)
|
||||
{ /* Download is done -- print section statistics */
|
||||
{ /* Download is done -- print section statistics. */
|
||||
if (bfd_check_format (abfd, bfd_object) == 0)
|
||||
{
|
||||
printf_filtered ("File is not an object file\n");
|
||||
@ -534,7 +545,7 @@ m32r_upload_command (char *args, int from_tty)
|
||||
printf_filtered ("\n");
|
||||
gdb_flush (gdb_stdout);
|
||||
}
|
||||
/* Finally, make the PC point at the start address */
|
||||
/* Finally, make the PC point at the start address. */
|
||||
regcache_write_pc (get_current_regcache (),
|
||||
bfd_get_start_address (abfd));
|
||||
printf_filtered ("Start address 0x%lx\n",
|
||||
@ -542,14 +553,14 @@ m32r_upload_command (char *args, int from_tty)
|
||||
print_transfer_performance (gdb_stdout, data_count, 0, &start_time,
|
||||
&end_time);
|
||||
}
|
||||
inferior_ptid = null_ptid; /* No process now */
|
||||
inferior_ptid = null_ptid; /* No process now. */
|
||||
|
||||
/* This is necessary because many things were based on the PC at the
|
||||
time that we attached to the monitor, which is no longer valid
|
||||
now that we have loaded new code (and just changed the PC).
|
||||
Another way to do this might be to call normal_stop, except that
|
||||
the stack may not be valid, and things would get horribly
|
||||
confused... */
|
||||
confused... */
|
||||
|
||||
clear_symtab_users (0);
|
||||
}
|
||||
@ -560,13 +571,14 @@ extern initialize_file_ftype _initialize_m32r_rom;
|
||||
void
|
||||
_initialize_m32r_rom (void)
|
||||
{
|
||||
/* Initialize m32r RevC monitor target */
|
||||
/* Initialize m32r RevC monitor target. */
|
||||
init_m32r_cmds ();
|
||||
init_monitor_ops (&m32r_ops);
|
||||
|
||||
m32r_ops.to_shortname = "m32r";
|
||||
m32r_ops.to_longname = "m32r monitor";
|
||||
m32r_ops.to_load = m32r_load_gen; /* monitor lacks a download command */
|
||||
m32r_ops.to_load = m32r_load_gen; /* Monitor lacks a download
|
||||
command. */
|
||||
m32r_ops.to_doc = "Debug via the m32r monitor.\n\
|
||||
Specify the serial device it is connected to (e.g. /dev/ttya).";
|
||||
m32r_ops.to_open = m32r_open;
|
||||
@ -578,7 +590,8 @@ Specify the serial device it is connected to (e.g. /dev/ttya).";
|
||||
|
||||
mon2000_ops.to_shortname = "mon2000";
|
||||
mon2000_ops.to_longname = "Mon2000 monitor";
|
||||
mon2000_ops.to_load = m32r_load_gen; /* monitor lacks a download command */
|
||||
mon2000_ops.to_load = m32r_load_gen; /* Monitor lacks a download
|
||||
command. */
|
||||
mon2000_ops.to_doc = "Debug via the Mon2000 monitor.\n\
|
||||
Specify the serial device it is connected to (e.g. /dev/ttya).";
|
||||
mon2000_ops.to_open = mon2000_open;
|
||||
@ -589,7 +602,8 @@ Set the default path for downloadable SREC files."), _("\
|
||||
Show the default path for downloadable SREC files."), _("\
|
||||
Determines the default path for downloadable SREC files."),
|
||||
NULL,
|
||||
NULL, /* FIXME: i18n: The default path for downloadable SREC files is %s. */
|
||||
NULL, /* FIXME: i18n: The default path for
|
||||
downloadable SREC files is %s. */
|
||||
&setlist, &showlist);
|
||||
|
||||
add_setshow_string_cmd ("board-address", class_obscure, &board_addr, _("\
|
||||
@ -597,7 +611,8 @@ Set IP address for M32R-EVA target board."), _("\
|
||||
Show IP address for M32R-EVA target board."), _("\
|
||||
Determine the IP address for M32R-EVA target board."),
|
||||
NULL,
|
||||
NULL, /* FIXME: i18n: IP address for M32R-EVA target board is %s. */
|
||||
NULL, /* FIXME: i18n: IP address for
|
||||
M32R-EVA target board is %s. */
|
||||
&setlist, &showlist);
|
||||
|
||||
add_setshow_string_cmd ("server-address", class_obscure, &server_addr, _("\
|
||||
@ -605,7 +620,9 @@ Set IP address for download server (GDB's host computer)."), _("\
|
||||
Show IP address for download server (GDB's host computer)."), _("\
|
||||
Determine the IP address for download server (GDB's host computer)."),
|
||||
NULL,
|
||||
NULL, /* FIXME: i18n: IP address for download server (GDB's host computer) is %s. */
|
||||
NULL, /* FIXME: i18n: IP address for
|
||||
download server (GDB's host
|
||||
computer) is %s. */
|
||||
&setlist, &showlist);
|
||||
|
||||
add_com ("upload", class_obscure, m32r_upload_command, _("\
|
||||
|
@ -57,7 +57,7 @@ m32r_frame_align (struct gdbarch *gdbarch, CORE_ADDR sp)
|
||||
|
||||
/* Breakpoints
|
||||
|
||||
The little endian mode of M32R is unique. In most of architectures,
|
||||
The little endian mode of M32R is unique. In most of architectures,
|
||||
two 16-bit instructions, A and B, are placed as the following:
|
||||
|
||||
Big endian:
|
||||
@ -76,7 +76,7 @@ m32r_frame_align (struct gdbarch *gdbarch, CORE_ADDR sp)
|
||||
|
||||
This is because M32R always fetches instructions in 32-bit.
|
||||
|
||||
The following functions take care of this behavior. */
|
||||
The following functions take care of this behavior. */
|
||||
|
||||
static int
|
||||
m32r_memory_insert_breakpoint (struct gdbarch *gdbarch,
|
||||
@ -168,10 +168,15 @@ m32r_memory_remove_breakpoint (struct gdbarch *gdbarch,
|
||||
}
|
||||
|
||||
static const gdb_byte *
|
||||
m32r_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
|
||||
m32r_breakpoint_from_pc (struct gdbarch *gdbarch,
|
||||
CORE_ADDR *pcptr, int *lenptr)
|
||||
{
|
||||
static gdb_byte be_bp_entry[] = { 0x10, 0xf1, 0x70, 0x00 }; /* dpt -> nop */
|
||||
static gdb_byte le_bp_entry[] = { 0x00, 0x70, 0xf1, 0x10 }; /* dpt -> nop */
|
||||
static gdb_byte be_bp_entry[] = {
|
||||
0x10, 0xf1, 0x70, 0x00
|
||||
}; /* dpt -> nop */
|
||||
static gdb_byte le_bp_entry[] = {
|
||||
0x00, 0x70, 0xf1, 0x10
|
||||
}; /* dpt -> nop */
|
||||
gdb_byte *bp;
|
||||
|
||||
/* Determine appropriate breakpoint. */
|
||||
@ -240,9 +245,9 @@ m32r_register_type (struct gdbarch *gdbarch, int reg_nr)
|
||||
|
||||
|
||||
/* Write into appropriate registers a function return value
|
||||
of type TYPE, given in virtual format.
|
||||
of type TYPE, given in virtual format.
|
||||
|
||||
Things always get returned in RET1_REGNUM, RET2_REGNUM. */
|
||||
Things always get returned in RET1_REGNUM, RET2_REGNUM. */
|
||||
|
||||
static void
|
||||
m32r_store_return_value (struct type *type, struct regcache *regcache,
|
||||
@ -264,7 +269,7 @@ m32r_store_return_value (struct type *type, struct regcache *regcache,
|
||||
}
|
||||
}
|
||||
|
||||
/* This is required by skip_prologue. The results of decoding a prologue
|
||||
/* This is required by skip_prologue. The results of decoding a prologue
|
||||
should be cached because this thrashing is getting nuts. */
|
||||
|
||||
static int
|
||||
@ -287,7 +292,7 @@ decode_prologue (struct gdbarch *gdbarch,
|
||||
|
||||
for (current_pc = start_pc; current_pc < scan_limit; current_pc += 2)
|
||||
{
|
||||
/* Check if current pc's location is readable. */
|
||||
/* Check if current pc's location is readable. */
|
||||
if (!safe_read_memory_integer (current_pc, 2, byte_order, &return_value))
|
||||
return -1;
|
||||
|
||||
@ -297,10 +302,10 @@ decode_prologue (struct gdbarch *gdbarch,
|
||||
break;
|
||||
|
||||
/* If this is a 32 bit instruction, we dont want to examine its
|
||||
immediate data as though it were an instruction */
|
||||
immediate data as though it were an instruction. */
|
||||
if (current_pc & 0x02)
|
||||
{
|
||||
/* decode this instruction further */
|
||||
/* Decode this instruction further. */
|
||||
insn &= 0x7fff;
|
||||
}
|
||||
else
|
||||
@ -312,7 +317,7 @@ decode_prologue (struct gdbarch *gdbarch,
|
||||
|
||||
current_pc += 2; /* skip the immediate data */
|
||||
|
||||
/* Check if current pc's location is readable. */
|
||||
/* Check if current pc's location is readable. */
|
||||
if (!safe_read_memory_integer (current_pc, 2, byte_order,
|
||||
&return_value))
|
||||
return -1;
|
||||
@ -326,15 +331,15 @@ decode_prologue (struct gdbarch *gdbarch,
|
||||
}
|
||||
else
|
||||
{
|
||||
if (((insn >> 8) == 0xe4) /* ld24 r4, xxxxxx; sub sp, r4 */
|
||||
if (((insn >> 8) == 0xe4) /* ld24 r4, xxxxxx; sub sp, r4 */
|
||||
&& safe_read_memory_integer (current_pc + 2,
|
||||
2, byte_order,
|
||||
&return_value)
|
||||
&& read_memory_unsigned_integer (current_pc + 2,
|
||||
2, byte_order)
|
||||
== 0x0f24)
|
||||
/* subtract 24 bit sign-extended negative-offset */
|
||||
{
|
||||
/* Subtract 24 bit sign-extended negative-offset. */
|
||||
insn = read_memory_unsigned_integer (current_pc - 2,
|
||||
4, byte_order);
|
||||
if (insn & 0x00800000) /* sign extend */
|
||||
@ -348,7 +353,7 @@ decode_prologue (struct gdbarch *gdbarch,
|
||||
continue;
|
||||
}
|
||||
}
|
||||
op1 = insn & 0xf000; /* isolate just the first nibble */
|
||||
op1 = insn & 0xf000; /* Isolate just the first nibble. */
|
||||
|
||||
if ((insn & 0xf0ff) == 0x207f)
|
||||
{ /* st reg, @-sp */
|
||||
@ -359,7 +364,7 @@ decode_prologue (struct gdbarch *gdbarch,
|
||||
continue;
|
||||
}
|
||||
if ((insn >> 8) == 0x4f) /* addi sp, xx */
|
||||
/* add 8 bit sign-extended offset */
|
||||
/* Add 8 bit sign-extended offset. */
|
||||
{
|
||||
int stack_adjust = (signed char) (insn & 0xff);
|
||||
|
||||
@ -384,25 +389,25 @@ decode_prologue (struct gdbarch *gdbarch,
|
||||
break; /* end of stack adjustments */
|
||||
}
|
||||
|
||||
/* Nop looks like a branch, continue explicitly */
|
||||
/* Nop looks like a branch, continue explicitly. */
|
||||
if (insn == 0x7000)
|
||||
{
|
||||
after_prologue = current_pc + 2;
|
||||
continue; /* nop occurs between pushes */
|
||||
continue; /* nop occurs between pushes. */
|
||||
}
|
||||
/* End of prolog if any of these are trap instructions */
|
||||
/* End of prolog if any of these are trap instructions. */
|
||||
if ((insn & 0xfff0) == 0x10f0)
|
||||
{
|
||||
after_prologue = current_pc;
|
||||
break;
|
||||
}
|
||||
/* End of prolog if any of these are branch instructions */
|
||||
/* End of prolog if any of these are branch instructions. */
|
||||
if ((op1 == 0x7000) || (op1 == 0xb000) || (op1 == 0xf000))
|
||||
{
|
||||
after_prologue = current_pc;
|
||||
continue;
|
||||
}
|
||||
/* Some of the branch instructions are mixed with other types */
|
||||
/* Some of the branch instructions are mixed with other types. */
|
||||
if (op1 == 0x1000)
|
||||
{
|
||||
int subop = insn & 0x0ff0;
|
||||
@ -424,22 +429,23 @@ decode_prologue (struct gdbarch *gdbarch,
|
||||
if (after_stack_adjust != 0)
|
||||
/* We did not find a "mv fp,sp", but we DID find
|
||||
a stack_adjust. Is it safe to use that as the
|
||||
end of the prologue? I just don't know. */
|
||||
end of the prologue? I just don't know. */
|
||||
{
|
||||
*pl_endptr = after_stack_adjust;
|
||||
}
|
||||
else if (after_push != 0)
|
||||
/* We did not find a "mv fp,sp", but we DID find
|
||||
a push. Is it safe to use that as the
|
||||
end of the prologue? I just don't know. */
|
||||
end of the prologue? I just don't know. */
|
||||
{
|
||||
*pl_endptr = after_push;
|
||||
}
|
||||
else
|
||||
/* We reached the end of the loop without finding the end
|
||||
of the prologue. No way to win -- we should report failure.
|
||||
The way we do that is to return the original start_pc.
|
||||
GDB will set a breakpoint at the start of the function (etc.) */
|
||||
of the prologue. No way to win -- we should report
|
||||
failure. The way we do that is to return the original
|
||||
start_pc. GDB will set a breakpoint at the start of
|
||||
the function (etc.) */
|
||||
*pl_endptr = start_pc;
|
||||
}
|
||||
return 0;
|
||||
@ -455,7 +461,7 @@ decode_prologue (struct gdbarch *gdbarch,
|
||||
} /* decode_prologue */
|
||||
|
||||
/* Function: skip_prologue
|
||||
Find end of function prologue */
|
||||
Find end of function prologue. */
|
||||
|
||||
#define DEFAULT_SEARCH_LIMIT 128
|
||||
|
||||
@ -467,7 +473,7 @@ m32r_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
|
||||
struct symtab_and_line sal;
|
||||
LONGEST return_value;
|
||||
|
||||
/* See what the symbol table says */
|
||||
/* See what the symbol table says. */
|
||||
|
||||
if (find_pc_partial_function (pc, NULL, &func_addr, &func_end))
|
||||
{
|
||||
@ -488,7 +494,7 @@ m32r_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
|
||||
else
|
||||
func_end = pc + DEFAULT_SEARCH_LIMIT;
|
||||
|
||||
/* If pc's location is not readable, just quit. */
|
||||
/* If pc's location is not readable, just quit. */
|
||||
if (!safe_read_memory_integer (pc, 4, byte_order, &return_value))
|
||||
return pc;
|
||||
|
||||
@ -521,7 +527,7 @@ struct m32r_unwind_cache
|
||||
the saved registers of frame described by FRAME_INFO. This
|
||||
includes special registers such as pc and fp saved in special ways
|
||||
in the stack frame. sp is even more special: the address we return
|
||||
for it IS the sp for the next frame. */
|
||||
for it IS the sp for the next frame. */
|
||||
|
||||
static struct m32r_unwind_cache *
|
||||
m32r_frame_unwind_cache (struct frame_info *this_frame,
|
||||
@ -603,8 +609,8 @@ m32r_frame_unwind_cache (struct frame_info *this_frame,
|
||||
}
|
||||
else if ((op & 0xfff0) == 0x10f0)
|
||||
{
|
||||
/* end of prologue if this is a trap instruction */
|
||||
break; /* end of stack adjustments */
|
||||
/* End of prologue if this is a trap instruction. */
|
||||
break; /* End of stack adjustments. */
|
||||
}
|
||||
}
|
||||
|
||||
@ -692,7 +698,7 @@ m32r_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||
int len;
|
||||
int odd_sized_struct;
|
||||
|
||||
/* first force sp to a 4-byte alignment */
|
||||
/* First force sp to a 4-byte alignment. */
|
||||
sp = sp & ~3;
|
||||
|
||||
/* Set the return address. For the m32r, the return breakpoint is
|
||||
@ -708,10 +714,10 @@ m32r_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||
argreg++;
|
||||
}
|
||||
|
||||
/* Now make sure there's space on the stack */
|
||||
/* Now make sure there's space on the stack. */
|
||||
for (argnum = 0, stack_alloc = 0; argnum < nargs; argnum++)
|
||||
stack_alloc += ((TYPE_LENGTH (value_type (args[argnum])) + 3) & ~3);
|
||||
sp -= stack_alloc; /* make room on stack for args */
|
||||
sp -= stack_alloc; /* Make room on stack for args. */
|
||||
|
||||
for (argnum = 0, stack_offset = 0; argnum < nargs; argnum++)
|
||||
{
|
||||
@ -733,7 +739,7 @@ m32r_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||
}
|
||||
else if (len < 4)
|
||||
{
|
||||
/* value gets right-justified in the register or stack word */
|
||||
/* Value gets right-justified in the register or stack word. */
|
||||
memcpy (valbuf + (register_size (gdbarch, argreg) - len),
|
||||
(gdb_byte *) value_contents (args[argnum]), len);
|
||||
val = valbuf;
|
||||
@ -745,13 +751,13 @@ m32r_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||
{
|
||||
if (argreg > ARGN_REGNUM)
|
||||
{
|
||||
/* must go on the stack */
|
||||
/* Must go on the stack. */
|
||||
write_memory (sp + stack_offset, val, 4);
|
||||
stack_offset += 4;
|
||||
}
|
||||
else if (argreg <= ARGN_REGNUM)
|
||||
{
|
||||
/* there's room in a register */
|
||||
/* There's room in a register. */
|
||||
regval =
|
||||
extract_unsigned_integer (val,
|
||||
register_size (gdbarch, argreg),
|
||||
@ -793,7 +799,7 @@ m32r_extract_return_value (struct type *type, struct regcache *regcache,
|
||||
store_unsigned_integer (valbuf, (len > 4 ? len - 4 : len), byte_order, tmp);
|
||||
|
||||
/* Ignore return values more than 8 bytes in size because the m32r
|
||||
returns anything more than 8 bytes in the stack. */
|
||||
returns anything more than 8 bytes in the stack. */
|
||||
if (len > 4)
|
||||
{
|
||||
regcache_cooked_read_unsigned (regcache, RET1_REGNUM + 1, &tmp);
|
||||
@ -924,7 +930,7 @@ m32r_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
|
||||
set_gdbarch_write_pc (gdbarch, m32r_write_pc);
|
||||
set_gdbarch_unwind_sp (gdbarch, m32r_unwind_sp);
|
||||
|
||||
set_gdbarch_num_regs (gdbarch, M32R_NUM_REGS);
|
||||
|
||||
set_gdbarch_sp_regnum (gdbarch, M32R_SP_REGNUM);
|
||||
set_gdbarch_register_name (gdbarch, m32r_register_name);
|
||||
set_gdbarch_register_type (gdbarch, m32r_register_type);
|
||||
|
@ -23,10 +23,10 @@
|
||||
|
||||
struct gdbarch_tdep
|
||||
{
|
||||
/* gdbarch target dependent data here. Currently unused for M32R. */
|
||||
/* gdbarch target dependent data here. Currently unused for M32R. */
|
||||
};
|
||||
|
||||
/* m32r register names. */
|
||||
/* m32r register names. */
|
||||
|
||||
enum m32r_regnum
|
||||
{
|
||||
@ -40,7 +40,7 @@ enum m32r_regnum
|
||||
SPU_REGNUM = 18,
|
||||
SPI_REGNUM = 19,
|
||||
M32R_PC_REGNUM = 21,
|
||||
/* m32r calling convention. */
|
||||
/* m32r calling convention. */
|
||||
ARG1_REGNUM = R0_REGNUM,
|
||||
ARGN_REGNUM = R3_REGNUM,
|
||||
RET1_REGNUM = R0_REGNUM,
|
||||
|
@ -58,10 +58,10 @@
|
||||
MSYMBOL_IS_RTC Tests the "RTC" bit in a minimal symbol.
|
||||
MSYMBOL_IS_RTI Tests the "RTC" bit in a minimal symbol. */
|
||||
|
||||
#define MSYMBOL_SET_RTC(msym) \
|
||||
#define MSYMBOL_SET_RTC(msym) \
|
||||
MSYMBOL_TARGET_FLAG_1 (msym) = 1
|
||||
|
||||
#define MSYMBOL_SET_RTI(msym) \
|
||||
#define MSYMBOL_SET_RTI(msym) \
|
||||
MSYMBOL_TARGET_FLAG_2 (msym) = 1
|
||||
|
||||
#define MSYMBOL_IS_RTC(msym) \
|
||||
@ -398,9 +398,8 @@ m68hc11_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr,
|
||||
}
|
||||
|
||||
|
||||
/* 68HC11 & 68HC12 prologue analysis.
|
||||
/* 68HC11 & 68HC12 prologue analysis. */
|
||||
|
||||
*/
|
||||
#define MAX_CODES 12
|
||||
|
||||
/* 68HC11 opcodes. */
|
||||
@ -673,8 +672,8 @@ m68hc11_scan_prologue (struct gdbarch *gdbarch, CORE_ADDR pc,
|
||||
We limit the search to 128 bytes so that the algorithm is bounded
|
||||
in case of random and wrong code. We also stop and abort if
|
||||
we find an instruction which is not supposed to appear in the
|
||||
prologue (as generated by gcc 2.95, 2.96).
|
||||
*/
|
||||
prologue (as generated by gcc 2.95, 2.96). */
|
||||
|
||||
func_end = pc + 128;
|
||||
found_frame_point = 0;
|
||||
info->size = 0;
|
||||
@ -767,7 +766,8 @@ m68hc11_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
|
||||
{
|
||||
ULONGEST pc;
|
||||
|
||||
pc = frame_unwind_register_unsigned (next_frame, gdbarch_pc_regnum (gdbarch));
|
||||
pc = frame_unwind_register_unsigned (next_frame,
|
||||
gdbarch_pc_regnum (gdbarch));
|
||||
return pc;
|
||||
}
|
||||
|
||||
@ -775,7 +775,7 @@ m68hc11_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
|
||||
the saved registers of frame described by FRAME_INFO. This
|
||||
includes special registers such as pc and fp saved in special ways
|
||||
in the stack frame. sp is even more special: the address we return
|
||||
for it IS the sp for the next frame. */
|
||||
for it IS the sp for the next frame. */
|
||||
|
||||
static struct m68hc11_unwind_cache *
|
||||
m68hc11_frame_unwind_cache (struct frame_info *this_frame,
|
||||
@ -851,7 +851,7 @@ m68hc11_frame_unwind_cache (struct frame_info *this_frame,
|
||||
}
|
||||
|
||||
/* Add 1 here to adjust for the post-decrement nature of the push
|
||||
instruction.*/
|
||||
instruction. */
|
||||
info->prev_sp = prev_sp;
|
||||
|
||||
info->base = this_base;
|
||||
@ -1065,7 +1065,7 @@ m68hc11_print_register (struct gdbarch *gdbarch, struct ui_file *file,
|
||||
V = (l & M6811_V_BIT) != 0;
|
||||
C = (l & M6811_C_BIT) != 0;
|
||||
|
||||
/* Print flags following the h8300 */
|
||||
/* Print flags following the h8300. */
|
||||
if ((C | Z) == 0)
|
||||
fprintf_filtered (file, "u> ");
|
||||
else if ((C | Z) == 1)
|
||||
@ -1439,7 +1439,7 @@ m68hc11_gdbarch_init (struct gdbarch_info info,
|
||||
else
|
||||
elf_flags = 0;
|
||||
|
||||
/* try to find a pre-existing architecture */
|
||||
/* Try to find a pre-existing architecture. */
|
||||
for (arches = gdbarch_list_lookup_by_info (arches, &info);
|
||||
arches != NULL;
|
||||
arches = gdbarch_list_lookup_by_info (arches->next, &info))
|
||||
@ -1450,7 +1450,7 @@ m68hc11_gdbarch_init (struct gdbarch_info info,
|
||||
return arches->gdbarch;
|
||||
}
|
||||
|
||||
/* Need a new architecture. Fill in a target specific vector. */
|
||||
/* Need a new architecture. Fill in a target specific vector. */
|
||||
tdep = (struct gdbarch_tdep *) xmalloc (sizeof (struct gdbarch_tdep));
|
||||
gdbarch = gdbarch_alloc (&info, tdep);
|
||||
tdep->elf_flags = elf_flags;
|
||||
@ -1549,7 +1549,8 @@ m68hc11_gdbarch_init (struct gdbarch_info info,
|
||||
return gdbarch;
|
||||
}
|
||||
|
||||
extern initialize_file_ftype _initialize_m68hc11_tdep; /* -Wmissing-prototypes */
|
||||
/* -Wmissing-prototypes */
|
||||
extern initialize_file_ftype _initialize_m68hc11_tdep;
|
||||
|
||||
void
|
||||
_initialize_m68hc11_tdep (void)
|
||||
|
@ -54,7 +54,7 @@
|
||||
#define P_MOVEL_SP 0x2f00
|
||||
#define P_MOVEML_SP 0x48e7
|
||||
|
||||
/* Offset from SP to first arg on stack at first instruction of a function */
|
||||
/* Offset from SP to first arg on stack at first instruction of a function. */
|
||||
#define SP_ARG0 (1 * 4)
|
||||
|
||||
#if !defined (BPT_VECTOR)
|
||||
@ -171,14 +171,15 @@ static const char *m68k_register_names[] = {
|
||||
};
|
||||
|
||||
/* Function: m68k_register_name
|
||||
Returns the name of the standard m68k register regnum. */
|
||||
Returns the name of the standard m68k register regnum. */
|
||||
|
||||
static const char *
|
||||
m68k_register_name (struct gdbarch *gdbarch, int regnum)
|
||||
{
|
||||
if (regnum < 0 || regnum >= ARRAY_SIZE (m68k_register_names))
|
||||
internal_error (__FILE__, __LINE__,
|
||||
_("m68k_register_name: illegal register number %d"), regnum);
|
||||
_("m68k_register_name: illegal register number %d"),
|
||||
regnum);
|
||||
else if (regnum >= M68K_FP0_REGNUM && regnum <= M68K_FPI_REGNUM
|
||||
&& gdbarch_tdep (gdbarch)->fpregs_present == 0)
|
||||
return "";
|
||||
@ -190,7 +191,8 @@ m68k_register_name (struct gdbarch *gdbarch, int regnum)
|
||||
needs any special handling. */
|
||||
|
||||
static int
|
||||
m68k_convert_register_p (struct gdbarch *gdbarch, int regnum, struct type *type)
|
||||
m68k_convert_register_p (struct gdbarch *gdbarch,
|
||||
int regnum, struct type *type)
|
||||
{
|
||||
if (!gdbarch_tdep (gdbarch)->fpregs_present)
|
||||
return 0;
|
||||
@ -1002,7 +1004,7 @@ m68k_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame)
|
||||
/* Figure out where the longjmp will land. Slurp the args out of the stack.
|
||||
We expect the first arg to be a pointer to the jmp_buf structure from which
|
||||
we extract the pc (JB_PC) that we will land at. The pc is copied into PC.
|
||||
This routine returns true on success. */
|
||||
This routine returns true on success. */
|
||||
|
||||
static int
|
||||
m68k_get_longjmp_target (struct frame_info *frame, CORE_ADDR *pc)
|
||||
@ -1023,7 +1025,7 @@ m68k_get_longjmp_target (struct frame_info *frame, CORE_ADDR *pc)
|
||||
buf = alloca (gdbarch_ptr_bit (gdbarch) / TARGET_CHAR_BIT);
|
||||
sp = get_frame_register_unsigned (frame, gdbarch_sp_regnum (gdbarch));
|
||||
|
||||
if (target_read_memory (sp + SP_ARG0, /* Offset of first arg on stack */
|
||||
if (target_read_memory (sp + SP_ARG0, /* Offset of first arg on stack. */
|
||||
buf, gdbarch_ptr_bit (gdbarch) / TARGET_CHAR_BIT))
|
||||
return 0;
|
||||
|
||||
@ -1058,7 +1060,7 @@ m68k_svr4_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
|
||||
|
||||
/* Function: m68k_gdbarch_init
|
||||
Initializer function for the m68k gdbarch vector.
|
||||
Called by gdbarch. Sets up the gdbarch vector(s) for this target. */
|
||||
Called by gdbarch. Sets up the gdbarch vector(s) for this target. */
|
||||
|
||||
static struct gdbarch *
|
||||
m68k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
|
||||
@ -1136,7 +1138,7 @@ m68k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
|
||||
|
||||
/* The mechanism for returning floating values from function
|
||||
and the type of long double depend on whether we're
|
||||
on ColdFire or standard m68k. */
|
||||
on ColdFire or standard m68k. */
|
||||
|
||||
if (info.bfd_arch_info && info.bfd_arch_info->mach != 0)
|
||||
{
|
||||
@ -1183,7 +1185,7 @@ m68k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
|
||||
set_gdbarch_skip_prologue (gdbarch, m68k_skip_prologue);
|
||||
set_gdbarch_breakpoint_from_pc (gdbarch, m68k_local_breakpoint_from_pc);
|
||||
|
||||
/* Stack grows down. */
|
||||
/* Stack grows down. */
|
||||
set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
|
||||
set_gdbarch_frame_align (gdbarch, m68k_frame_align);
|
||||
|
||||
@ -1223,7 +1225,7 @@ m68k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
|
||||
tdep->float_return = 0;
|
||||
}
|
||||
|
||||
/* Function call & return */
|
||||
/* Function call & return. */
|
||||
set_gdbarch_push_dummy_call (gdbarch, m68k_push_dummy_call);
|
||||
set_gdbarch_return_value (gdbarch, m68k_return_value);
|
||||
|
||||
|
@ -50,7 +50,7 @@
|
||||
|
||||
#include "target.h"
|
||||
|
||||
/* Prototypes for supply_gregset etc. */
|
||||
/* Prototypes for supply_gregset etc. */
|
||||
#include "gregset.h"
|
||||
|
||||
/* This table must line up with gdbarch_register_name in "m68k-tdep.c". */
|
||||
@ -106,10 +106,11 @@ fetch_register (struct regcache *regcache, int regno)
|
||||
char buf[MAX_REGISTER_SIZE];
|
||||
int tid;
|
||||
|
||||
/* Overload thread id onto process id */
|
||||
/* Overload thread id onto process id. */
|
||||
tid = TIDGET (inferior_ptid);
|
||||
if (tid == 0)
|
||||
tid = PIDGET (inferior_ptid); /* no thread id, just use process id */
|
||||
tid = PIDGET (inferior_ptid); /* no thread id, just use
|
||||
process id. */
|
||||
|
||||
regaddr = 4 * regmap[regno];
|
||||
for (i = 0; i < register_size (gdbarch, regno); i += sizeof (long))
|
||||
@ -127,7 +128,7 @@ fetch_register (struct regcache *regcache, int regno)
|
||||
|
||||
/* Fetch register values from the inferior.
|
||||
If REGNO is negative, do this for all registers.
|
||||
Otherwise, REGNO specifies which register (so we can save time). */
|
||||
Otherwise, REGNO specifies which register (so we can save time). */
|
||||
|
||||
static void
|
||||
old_fetch_inferior_registers (struct regcache *regcache, int regno)
|
||||
@ -147,7 +148,7 @@ old_fetch_inferior_registers (struct regcache *regcache, int regno)
|
||||
}
|
||||
}
|
||||
|
||||
/* Store one register. */
|
||||
/* Store one register. */
|
||||
|
||||
static void
|
||||
store_register (const struct regcache *regcache, int regno)
|
||||
@ -158,17 +159,18 @@ store_register (const struct regcache *regcache, int regno)
|
||||
int tid;
|
||||
char buf[MAX_REGISTER_SIZE];
|
||||
|
||||
/* Overload thread id onto process id */
|
||||
/* Overload thread id onto process id. */
|
||||
tid = TIDGET (inferior_ptid);
|
||||
if (tid == 0)
|
||||
tid = PIDGET (inferior_ptid); /* no thread id, just use process id */
|
||||
tid = PIDGET (inferior_ptid); /* no thread id, just use
|
||||
process id. */
|
||||
|
||||
regaddr = 4 * regmap[regno];
|
||||
|
||||
/* Put the contents of regno into a local buffer */
|
||||
/* Put the contents of regno into a local buffer. */
|
||||
regcache_raw_collect (regcache, regno, buf);
|
||||
|
||||
/* Store the local buffer into the inferior a chunk at the time. */
|
||||
/* Store the local buffer into the inferior a chunk at the time. */
|
||||
for (i = 0; i < register_size (gdbarch, regno); i += sizeof (long))
|
||||
{
|
||||
errno = 0;
|
||||
@ -205,7 +207,7 @@ old_store_inferior_registers (const struct regcache *regcache, int regno)
|
||||
|
||||
/* Given a pointer to a general register set in /proc format
|
||||
(elf_gregset_t *), unpack the register contents and supply
|
||||
them as gdb's idea of the current register values. */
|
||||
them as gdb's idea of the current register values. */
|
||||
|
||||
void
|
||||
supply_gregset (struct regcache *regcache, const elf_gregset_t *gregsetp)
|
||||
@ -284,8 +286,13 @@ store_regs (const struct regcache *regcache, int tid, int regno)
|
||||
|
||||
#else
|
||||
|
||||
static void fetch_regs (struct regcache *regcache, int tid) {}
|
||||
static void store_regs (const struct regcache *regcache, int tid, int regno) {}
|
||||
static void fetch_regs (struct regcache *regcache, int tid)
|
||||
{
|
||||
}
|
||||
|
||||
static void store_regs (const struct regcache *regcache, int tid, int regno)
|
||||
{
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@ -375,8 +382,13 @@ store_fpregs (const struct regcache *regcache, int tid, int regno)
|
||||
|
||||
#else
|
||||
|
||||
static void fetch_fpregs (struct regcache *regcache, int tid) {}
|
||||
static void store_fpregs (const struct regcache *regcache, int tid, int regno) {}
|
||||
static void fetch_fpregs (struct regcache *regcache, int tid)
|
||||
{
|
||||
}
|
||||
|
||||
static void store_fpregs (const struct regcache *regcache, int tid, int regno)
|
||||
{
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@ -403,7 +415,7 @@ m68k_linux_fetch_inferior_registers (struct target_ops *ops,
|
||||
/* GNU/Linux LWP ID's are process ID's. */
|
||||
tid = TIDGET (inferior_ptid);
|
||||
if (tid == 0)
|
||||
tid = PIDGET (inferior_ptid); /* Not a threaded program. */
|
||||
tid = PIDGET (inferior_ptid); /* Not a threaded program. */
|
||||
|
||||
/* Use the PTRACE_GETFPXREGS request whenever possible, since it
|
||||
transfers more registers in one system call, and we'll cache the
|
||||
|
@ -68,7 +68,7 @@ m88k_register_name (struct gdbarch *gdbarch, int regnum)
|
||||
}
|
||||
|
||||
/* Return the GDB type object for the "standard" data type of data in
|
||||
register REGNUM. */
|
||||
register REGNUM. */
|
||||
|
||||
static struct type *
|
||||
m88k_register_type (struct gdbarch *gdbarch, int regnum)
|
||||
@ -859,7 +859,7 @@ m88k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
|
||||
set_gdbarch_push_dummy_call (gdbarch, m88k_push_dummy_call);
|
||||
set_gdbarch_dummy_id (gdbarch, m88k_dummy_id);
|
||||
|
||||
/* Return value info */
|
||||
/* Return value info. */
|
||||
set_gdbarch_return_value (gdbarch, m88k_return_value);
|
||||
|
||||
set_gdbarch_addr_bits_remove (gdbarch, m88k_addr_bits_remove);
|
||||
|
@ -31,7 +31,7 @@ enum m88k_regnum
|
||||
M88K_R3_REGNUM,
|
||||
M88K_R12_REGNUM = 12,
|
||||
M88K_R30_REGNUM = 30, /* Frame pointer. */
|
||||
M88K_R31_REGNUM, /* Stack pointer. */
|
||||
M88K_R31_REGNUM, /* Stack pointer. */
|
||||
M88K_EPSR_REGNUM,
|
||||
M88K_FPSR_REGNUM,
|
||||
M88K_FPCR_REGNUM,
|
||||
|
@ -44,8 +44,8 @@ static int mach_o_debug_level = 0;
|
||||
during the link.
|
||||
Each time an oso (other source) is found in the executable, the reader
|
||||
creates such a structure. They are read after the processing of the
|
||||
executable.
|
||||
*/
|
||||
executable. */
|
||||
|
||||
typedef struct oso_el
|
||||
{
|
||||
/* Object file name. */
|
||||
@ -206,7 +206,7 @@ macho_symtab_read (struct objfile *objfile,
|
||||
if (sym->name == NULL || *sym->name == '\0')
|
||||
{
|
||||
/* Skip names that don't exist (shouldn't happen), or names
|
||||
that are null strings (may happen). */
|
||||
that are null strings (may happen). */
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -215,12 +215,12 @@ macho_symtab_read (struct objfile *objfile,
|
||||
struct minimal_symbol *msym;
|
||||
CORE_ADDR symaddr;
|
||||
|
||||
/* Bfd symbols are section relative. */
|
||||
/* Bfd symbols are section relative. */
|
||||
symaddr = sym->value + sym->section->vma;
|
||||
|
||||
/* Select global/local/weak symbols. Note that bfd puts abs
|
||||
symbols in their own section, so all symbols we are
|
||||
interested in will have a section. */
|
||||
interested in will have a section. */
|
||||
/* Relocate all non-absolute and non-TLS symbols by the
|
||||
section offset. */
|
||||
if (sym->section != &bfd_abs_section
|
||||
@ -258,7 +258,7 @@ macho_symtab_read (struct objfile *objfile,
|
||||
ms_type = mst_unknown;
|
||||
}
|
||||
else
|
||||
continue; /* Skip this symbol. */
|
||||
continue; /* Skip this symbol. */
|
||||
|
||||
gdb_assert (sym->section->index < nbr_sections);
|
||||
if (oso_file != NULL
|
||||
|
@ -299,7 +299,7 @@ macro_define_command (char *exp, int from_tty)
|
||||
{
|
||||
alloced *= 2;
|
||||
argv = (char **) xrealloc (argv, alloced * sizeof (char *));
|
||||
/* Must update new_macro as well... */
|
||||
/* Must update new_macro as well... */
|
||||
new_macro.argv = (const char * const *) argv;
|
||||
}
|
||||
argv[new_macro.argc] = extract_identifier (&exp, 1);
|
||||
|
@ -206,7 +206,7 @@ set_token (struct macro_buffer *tok, char *start, char *end)
|
||||
init_shared_buffer (tok, start, end - start);
|
||||
tok->last_token = 0;
|
||||
|
||||
/* Presumed; get_identifier may overwrite this. */
|
||||
/* Presumed; get_identifier may overwrite this. */
|
||||
tok->is_identifier = 0;
|
||||
}
|
||||
|
||||
@ -704,7 +704,7 @@ struct macro_name_list {
|
||||
particular macro, and otherwise delegates the decision to another
|
||||
function/baton pair. But that makes the linked list of excluded
|
||||
macros chained through untyped baton pointers, which will make it
|
||||
harder to debug. :( */
|
||||
harder to debug. :( */
|
||||
static int
|
||||
currently_rescanning (struct macro_name_list *list, const char *name)
|
||||
{
|
||||
@ -1141,7 +1141,7 @@ substitute_args (struct macro_buffer *dest,
|
||||
its expansion to DEST. SRC is the input text following the ID
|
||||
token. We are currently rescanning the expansions of the macros
|
||||
named in NO_LOOP; don't re-expand them. Use LOOKUP_FUNC and
|
||||
LOOKUP_BATON to find definitions for any nested macro references.
|
||||
LOOKUP_BATON to find definitions for any nested macro references.
|
||||
|
||||
Return 1 if we decided to expand it, zero otherwise. (If it's a
|
||||
function-like macro name that isn't followed by an argument list,
|
||||
|
@ -160,7 +160,7 @@ struct macro_key
|
||||
struct macro_table *table;
|
||||
|
||||
/* The name of the macro. This is in the table's bcache, if it has
|
||||
one. */
|
||||
one. */
|
||||
const char *name;
|
||||
|
||||
/* The source file and line number where the definition's scope
|
||||
|
@ -186,7 +186,7 @@ get_init_files (char **system_gdbinit,
|
||||
|
||||
/* If the .gdbinit file in the current directory is the same as
|
||||
the $HOME/.gdbinit file, it should not be sourced. homebuf
|
||||
and cwdbuf are used in that purpose. Make sure that the stats
|
||||
and cwdbuf are used in that purpose. Make sure that the stats
|
||||
are zero in case one of them fails (this guarantees that they
|
||||
won't match if either exists). */
|
||||
|
||||
@ -235,7 +235,7 @@ captured_command_loop (void *data)
|
||||
check to detect bad FUNCs code. */
|
||||
do_cleanups (ALL_CLEANUPS);
|
||||
/* If the command_loop returned, normally (rather than threw an
|
||||
error) we try to quit. If the quit is aborted, catch_errors()
|
||||
error) we try to quit. If the quit is aborted, catch_errors()
|
||||
which called this catch the signal and restart the command
|
||||
loop. */
|
||||
quit_command (NULL, instream == stdin);
|
||||
@ -515,7 +515,8 @@ captured_main (void *data)
|
||||
break;
|
||||
case 'f':
|
||||
annotation_level = 1;
|
||||
/* We have probably been invoked from emacs. Disable window interface. */
|
||||
/* We have probably been invoked from emacs. Disable
|
||||
window interface. */
|
||||
use_windows = 0;
|
||||
break;
|
||||
case 's':
|
||||
@ -714,7 +715,7 @@ captured_main (void *data)
|
||||
(optind == argc - 1) ? "" : " ...");
|
||||
}
|
||||
|
||||
/* Lookup gdbinit files. Note that the gdbinit file name may be
|
||||
/* Lookup gdbinit files. Note that the gdbinit file name may be
|
||||
overriden during file initialization, so get_init_files should be
|
||||
called after gdb_init. */
|
||||
get_init_files (&system_gdbinit, &home_gdbinit, &local_gdbinit);
|
||||
|
29
gdb/maint.c
29
gdb/maint.c
@ -117,7 +117,7 @@ maintenance_dump_me (char *args, int from_tty)
|
||||
/* Stimulate the internal error mechanism that GDB uses when an
|
||||
internal problem is detected. Allows testing of the mechanism.
|
||||
Also useful when the user wants to drop a core file but not exit
|
||||
GDB. */
|
||||
GDB. */
|
||||
|
||||
static void
|
||||
maintenance_internal_error (char *args, int from_tty)
|
||||
@ -128,7 +128,7 @@ maintenance_internal_error (char *args, int from_tty)
|
||||
/* Stimulate the internal error mechanism that GDB uses when an
|
||||
internal problem is detected. Allows testing of the mechanism.
|
||||
Also useful when the user wants to drop a core file but not exit
|
||||
GDB. */
|
||||
GDB. */
|
||||
|
||||
static void
|
||||
maintenance_internal_warning (char *args, int from_tty)
|
||||
@ -142,7 +142,7 @@ maintenance_internal_warning (char *args, int from_tty)
|
||||
debuggee's process space, and have gdb fetch and demangle that
|
||||
string. If we have a char* pointer "ptr" that points to a string,
|
||||
we might want to be able to given just the name and have GDB
|
||||
demangle and print what it points to, etc. (FIXME) */
|
||||
demangle and print what it points to, etc. (FIXME) */
|
||||
|
||||
static void
|
||||
maintenance_demangle (char *args, int from_tty)
|
||||
@ -210,12 +210,12 @@ match_substring (const char *string, const char *substr)
|
||||
|
||||
while ((tok = strstr (string, substr)) != NULL)
|
||||
{
|
||||
/* Got a partial match. Is it a whole word? */
|
||||
/* Got a partial match. Is it a whole word? */
|
||||
if (tok == string
|
||||
|| tok[-1] == ' '
|
||||
|| tok[-1] == '\t')
|
||||
{
|
||||
/* Token is delimited at the front... */
|
||||
/* Token is delimited at the front... */
|
||||
if (tok[substr_len] == ' '
|
||||
|| tok[substr_len] == '\t'
|
||||
|| tok[substr_len] == '\0')
|
||||
@ -449,8 +449,7 @@ maintenance_print_command (char *arg, int from_tty)
|
||||
/* The "maintenance translate-address" command converts a section and address
|
||||
to a symbol. This can be called in two ways:
|
||||
maintenance translate-address <secname> <addr>
|
||||
or maintenance translate-address <addr>
|
||||
*/
|
||||
or maintenance translate-address <addr>. */
|
||||
|
||||
static void
|
||||
maintenance_translate_address (char *arg, int from_tty)
|
||||
@ -468,14 +467,14 @@ maintenance_translate_address (char *arg, int from_tty)
|
||||
p = arg;
|
||||
|
||||
if (!isdigit (*p))
|
||||
{ /* See if we have a valid section name */
|
||||
while (*p && !isspace (*p)) /* Find end of section name */
|
||||
{ /* See if we have a valid section name. */
|
||||
while (*p && !isspace (*p)) /* Find end of section name. */
|
||||
p++;
|
||||
if (*p == '\000') /* End of command? */
|
||||
if (*p == '\000') /* End of command? */
|
||||
error (_("Need to specify <section-name> and <address>"));
|
||||
*p++ = '\000';
|
||||
while (isspace (*p))
|
||||
p++; /* Skip whitespace */
|
||||
p++; /* Skip whitespace. */
|
||||
|
||||
ALL_OBJSECTIONS (objfile, sect)
|
||||
{
|
||||
@ -535,7 +534,7 @@ maintenance_translate_address (char *arg, int from_tty)
|
||||
|
||||
/* When a command is deprecated the user will be warned the first time
|
||||
the command is used. If possible, a replacement will be
|
||||
offered. */
|
||||
offered. */
|
||||
|
||||
static void
|
||||
maintenance_deprecate (char *args, int from_tty)
|
||||
@ -565,7 +564,7 @@ the command you want to undeprecate.\n"));
|
||||
|
||||
}
|
||||
|
||||
/* You really shouldn't be using this. It is just for the testsuite.
|
||||
/* You really shouldn't be using this. It is just for the testsuite.
|
||||
Rather, you should use deprecate_cmd() when the command is created
|
||||
in _initialize_blah().
|
||||
|
||||
@ -595,7 +594,7 @@ maintenance_do_deprecate (char *text, int deprecate)
|
||||
|
||||
if (deprecate)
|
||||
{
|
||||
/* look for a replacement command */
|
||||
/* Look for a replacement command. */
|
||||
start_ptr = strchr (text, '\"');
|
||||
if (start_ptr != NULL)
|
||||
{
|
||||
@ -618,7 +617,7 @@ maintenance_do_deprecate (char *text, int deprecate)
|
||||
|
||||
Note the MALLOCED_REPLACEMENT test. If the command's replacement
|
||||
string was allocated at compile time we don't want to free the
|
||||
memory. */
|
||||
memory. */
|
||||
if (alias)
|
||||
{
|
||||
if (alias->flags & MALLOCED_REPLACEMENT)
|
||||
|
443
gdb/mdebugread.c
443
gdb/mdebugread.c
File diff suppressed because it is too large
Load Diff
@ -29,8 +29,8 @@
|
||||
|
||||
struct mdebug_extra_func_info
|
||||
{
|
||||
long numargs; /* number of args to procedure (was iopt) */
|
||||
PDR pdr; /* Procedure descriptor record */
|
||||
long numargs; /* Number of args to procedure (was iopt). */
|
||||
PDR pdr; /* Procedure descriptor record. */
|
||||
};
|
||||
|
||||
/* Special symbol found in blocks associated with routines. We can
|
||||
|
@ -176,7 +176,7 @@ create_mem_region (CORE_ADDR lo, CORE_ADDR hi,
|
||||
struct mem_region new;
|
||||
int i, ix;
|
||||
|
||||
/* lo == hi is a useless empty region */
|
||||
/* lo == hi is a useless empty region. */
|
||||
if (lo >= hi && hi != 0)
|
||||
{
|
||||
printf_unfiltered (_("invalid memory region: low >= high\n"));
|
||||
@ -302,7 +302,7 @@ invalidate_target_mem_regions (void)
|
||||
mem_region_list = NULL;
|
||||
}
|
||||
|
||||
/* Clear memory region list */
|
||||
/* Clear memory region list. */
|
||||
|
||||
static void
|
||||
mem_clear (void)
|
||||
@ -542,7 +542,7 @@ mem_info_command (char *args, int from_tty)
|
||||
}
|
||||
|
||||
|
||||
/* Enable the memory region number NUM. */
|
||||
/* Enable the memory region number NUM. */
|
||||
|
||||
static void
|
||||
mem_enable (int num)
|
||||
@ -596,7 +596,7 @@ mem_enable_command (char *args, int from_tty)
|
||||
}
|
||||
|
||||
|
||||
/* Disable the memory region number NUM. */
|
||||
/* Disable the memory region number NUM. */
|
||||
|
||||
static void
|
||||
mem_disable (int num)
|
||||
@ -649,7 +649,7 @@ mem_disable_command (char *args, int from_tty)
|
||||
}
|
||||
}
|
||||
|
||||
/* Delete the memory region number NUM. */
|
||||
/* Delete the memory region number NUM. */
|
||||
|
||||
static void
|
||||
mem_delete (int num)
|
||||
|
@ -25,7 +25,7 @@
|
||||
|
||||
enum mem_access_mode
|
||||
{
|
||||
MEM_NONE, /* Memory that is not physically present. */
|
||||
MEM_NONE, /* Memory that is not physically present. */
|
||||
MEM_RW, /* read/write */
|
||||
MEM_RO, /* read only */
|
||||
MEM_WO, /* write only */
|
||||
@ -51,7 +51,7 @@ enum mem_access_width
|
||||
the mem_region structure.
|
||||
|
||||
FIXME: It would be useful if there was a mechanism for targets to
|
||||
add their own attributes. For example, the number of wait states. */
|
||||
add their own attributes. For example, the number of wait states. */
|
||||
|
||||
struct mem_attrib
|
||||
{
|
||||
@ -66,9 +66,9 @@ struct mem_attrib
|
||||
/* enables host-side caching of memory region data */
|
||||
int cache;
|
||||
|
||||
/* enables memory verification. after a write, memory is re-read
|
||||
to verify that the write was successful. */
|
||||
int verify;
|
||||
/* Enables memory verification. After a write, memory is re-read
|
||||
to verify that the write was successful. */
|
||||
int verify;
|
||||
|
||||
/* Block size. Only valid if mode == MEM_FLASH. */
|
||||
int blocksize;
|
||||
@ -82,13 +82,14 @@ struct mem_region
|
||||
If 0, upper bound is "infinity". */
|
||||
CORE_ADDR hi;
|
||||
|
||||
/* Item number of this memory region. */
|
||||
/* Item number of this memory region. */
|
||||
int number;
|
||||
|
||||
/* Status of this memory region (enabled if non-zero, otherwise disabled) */
|
||||
/* Status of this memory region (enabled if non-zero, otherwise
|
||||
disabled). */
|
||||
int enabled_p;
|
||||
|
||||
/* Attributes for this region */
|
||||
/* Attributes for this region. */
|
||||
struct mem_attrib attrib;
|
||||
};
|
||||
|
||||
|
@ -26,7 +26,8 @@
|
||||
|
||||
/* Parses XML memory map passed as argument and returns the memory
|
||||
regions it describes. On any error, emits error message and
|
||||
returns 0. Does not throw. Ownership of result is passed to the caller. */
|
||||
returns 0. Does not throw. Ownership of result is passed to the
|
||||
caller. */
|
||||
VEC(mem_region_s) *parse_memory_map (const char *memory_map);
|
||||
|
||||
#endif
|
||||
|
@ -1271,7 +1271,7 @@ mep_pseudo_register_write (struct gdbarch *gdbarch,
|
||||
/* Disassembly. */
|
||||
|
||||
/* The mep disassembler needs to know about the section in order to
|
||||
work correctly. */
|
||||
work correctly. */
|
||||
static int
|
||||
mep_gdb_print_insn (bfd_vma pc, disassemble_info * info)
|
||||
{
|
||||
@ -1325,7 +1325,7 @@ mep_gdb_print_insn (bfd_vma pc, disassemble_info * info)
|
||||
Every bundle is four bytes long, and naturally aligned, and can hold
|
||||
one or two instructions:
|
||||
- 16-bit core instruction; 16-bit coprocessor instruction
|
||||
These execute in parallel.
|
||||
These execute in parallel.
|
||||
- 32-bit core instruction
|
||||
- 32-bit coprocessor instruction
|
||||
|
||||
@ -1333,9 +1333,9 @@ mep_gdb_print_insn (bfd_vma pc, disassemble_info * info)
|
||||
Every bundle is eight bytes long, and naturally aligned, and can hold
|
||||
one or two instructions:
|
||||
- 16-bit core instruction; 48-bit (!) coprocessor instruction
|
||||
These execute in parallel.
|
||||
These execute in parallel.
|
||||
- 32-bit core instruction; 32-bit coprocessor instruction
|
||||
These execute in parallel.
|
||||
These execute in parallel.
|
||||
- 64-bit coprocessor instruction
|
||||
|
||||
Now, the MeP manual doesn't define any 48- or 64-bit coprocessor
|
||||
@ -1825,7 +1825,7 @@ mep_analyze_prologue (struct gdbarch *gdbarch,
|
||||
body, gcc 4.x will use a BRA instruction to branch to the
|
||||
loop condition checking code. This BRA instruction is
|
||||
marked as part of the prologue. We therefore set next_pc
|
||||
to this branch target and also stop the prologue scan.
|
||||
to this branch target and also stop the prologue scan.
|
||||
The instructions at and beyond the branch target should
|
||||
no longer be associated with the prologue.
|
||||
|
||||
@ -2145,7 +2145,7 @@ mep_extract_return_value (struct gdbarch *arch,
|
||||
else
|
||||
offset = 0;
|
||||
|
||||
/* Return values that do fit in a single register are returned in R0. */
|
||||
/* Return values that do fit in a single register are returned in R0. */
|
||||
regcache_cooked_read_part (regcache, MEP_R0_REGNUM,
|
||||
offset, TYPE_LENGTH (type),
|
||||
valbuf);
|
||||
@ -2180,7 +2180,7 @@ mep_store_return_value (struct gdbarch *arch,
|
||||
|
||||
/* Return values larger than a single register are returned in
|
||||
memory, pointed to by R0. Unfortunately, we can't count on R0
|
||||
pointing to the return buffer, so we raise an error here. */
|
||||
pointing to the return buffer, so we raise an error here. */
|
||||
else
|
||||
error ("GDB cannot set return values larger than four bytes; "
|
||||
"the Media Processor's\n"
|
||||
@ -2209,7 +2209,7 @@ mep_return_value (struct gdbarch *gdbarch, struct type *func_type,
|
||||
{
|
||||
/* Return values larger than a single register are returned in
|
||||
memory, pointed to by R0. Unfortunately, we can't count on R0
|
||||
pointing to the return buffer, so we raise an error here. */
|
||||
pointing to the return buffer, so we raise an error here. */
|
||||
error ("GDB cannot set return values larger than four bytes; "
|
||||
"the Media Processor's\n"
|
||||
"calling conventions do not provide enough information "
|
||||
@ -2246,15 +2246,15 @@ mep_frame_align (struct gdbarch *gdbarch, CORE_ADDR sp)
|
||||
4.2.1 Core register conventions
|
||||
|
||||
- Parameters should be evaluated from left to right, and they
|
||||
should be held in $1,$2,$3,$4 in order. The fifth parameter or
|
||||
after should be held in the stack. If the size is larger than 4
|
||||
should be held in $1,$2,$3,$4 in order. The fifth parameter or
|
||||
after should be held in the stack. If the size is larger than 4
|
||||
bytes in the first four parameters, the pointer should be held in
|
||||
the registers instead. If the size is larger than 4 bytes in the
|
||||
the registers instead. If the size is larger than 4 bytes in the
|
||||
fifth parameter or after, the pointer should be held in the stack.
|
||||
|
||||
- Return value of a function should be held in register $0. If the
|
||||
- Return value of a function should be held in register $0. If the
|
||||
size of return value is larger than 4 bytes, $1 should hold the
|
||||
pointer pointing memory that would hold the return value. In this
|
||||
pointer pointing memory that would hold the return value. In this
|
||||
case, the first parameter should be held in $2, the second one in
|
||||
$3, and the third one in $4, and the forth parameter or after
|
||||
should be held in the stack.
|
||||
|
@ -31,7 +31,7 @@ static char *picobug_inits[] =
|
||||
static struct target_ops picobug_ops;
|
||||
static struct monitor_ops picobug_cmds;
|
||||
|
||||
/* Picobug only supports a subset of registers from MCore. In reality,
|
||||
/* Picobug only supports a subset of registers from MCore. In reality,
|
||||
it doesn't support ss1, either. */
|
||||
static char *picobug_regnames[] = {
|
||||
"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
|
||||
@ -81,7 +81,7 @@ picobug_dumpregs (struct regcache *regcache)
|
||||
{
|
||||
if (strchr (p, '-'))
|
||||
{
|
||||
/* got a range. either r0-r7, r8-r15 or ss0-ss4. */
|
||||
/* Got a range. Either r0-r7, r8-r15 or ss0-ss4. */
|
||||
if (strncmp (p, "r0", 2) == 0 || strncmp (p, "r8", 2) == 0)
|
||||
{
|
||||
int rn = (p[1] == '0' ? 0 : 8);
|
||||
@ -98,7 +98,7 @@ picobug_dumpregs (struct regcache *regcache)
|
||||
}
|
||||
else if (strncmp (p, "ss", 2) == 0)
|
||||
{
|
||||
/* get the next five values, ignoring the first. */
|
||||
/* Get the next five values, ignoring the first. */
|
||||
int rn;
|
||||
p = strtok (NULL, " \t\r\n");
|
||||
for (rn = 39; rn < 43; rn++)
|
||||
|
@ -49,19 +49,19 @@
|
||||
This set also needs to be verified if it is complete. */
|
||||
#define IS_RETURN(op) (op == rtsd || op == rtid)
|
||||
#define IS_UPDATE_SP(op, rd, ra) \
|
||||
((op == addik || op == addi) && rd == REG_SP && ra == REG_SP)
|
||||
((op == addik || op == addi) && rd == REG_SP && ra == REG_SP)
|
||||
#define IS_SPILL_SP(op, rd, ra) \
|
||||
((op == swi || op == sw) && rd == REG_SP && ra == REG_SP)
|
||||
((op == swi || op == sw) && rd == REG_SP && ra == REG_SP)
|
||||
#define IS_SPILL_REG(op, rd, ra) \
|
||||
((op == swi || op == sw) && rd != REG_SP && ra == REG_SP)
|
||||
((op == swi || op == sw) && rd != REG_SP && ra == REG_SP)
|
||||
#define IS_ALSO_SPILL_REG(op, rd, ra, rb) \
|
||||
((op == swi || op == sw) && rd != REG_SP && ra == 0 && rb == REG_SP)
|
||||
((op == swi || op == sw) && rd != REG_SP && ra == 0 && rb == REG_SP)
|
||||
#define IS_SETUP_FP(op, ra, rb) \
|
||||
((op == add || op == addik || op == addk) && ra == REG_SP && rb == 0)
|
||||
((op == add || op == addik || op == addk) && ra == REG_SP && rb == 0)
|
||||
#define IS_SPILL_REG_FP(op, rd, ra, fpregnum) \
|
||||
((op == swi || op == sw) && rd != REG_SP && ra == fpregnum && ra != 0)
|
||||
((op == swi || op == sw) && rd != REG_SP && ra == fpregnum && ra != 0)
|
||||
#define IS_SAVE_HIDDEN_PTR(op, rd, ra, rb) \
|
||||
((op == add || op == addik) && ra == MICROBLAZE_FIRST_ARGREG && rb == 0)
|
||||
((op == add || op == addik) && ra == MICROBLAZE_FIRST_ARGREG && rb == 0)
|
||||
|
||||
/* The registers of the Xilinx microblaze processor. */
|
||||
|
||||
@ -221,7 +221,7 @@ microblaze_alloc_frame_cache (void)
|
||||
|
||||
/* Analyze the prologue to determine where registers are saved,
|
||||
the end of the prologue, etc. Return the address of the first line
|
||||
of "real" code (i.e., the end of the prologue). */
|
||||
of "real" code (i.e., the end of the prologue). */
|
||||
|
||||
static CORE_ADDR
|
||||
microblaze_analyze_prologue (struct gdbarch *gdbarch, CORE_ADDR pc,
|
||||
@ -237,7 +237,7 @@ microblaze_analyze_prologue (struct gdbarch *gdbarch, CORE_ADDR pc,
|
||||
int save_hidden_pointer_found = 0;
|
||||
int non_stack_instruction_found = 0;
|
||||
|
||||
/* Find the start of this function. */
|
||||
/* Find the start of this function. */
|
||||
find_pc_partial_function (pc, &name, &func_addr, &func_end);
|
||||
if (func_addr < pc)
|
||||
pc = func_addr;
|
||||
@ -257,7 +257,7 @@ microblaze_analyze_prologue (struct gdbarch *gdbarch, CORE_ADDR pc,
|
||||
|
||||
If we're about to return, our frame has already been deallocated.
|
||||
If we are stopped at the first instruction of a prologue,
|
||||
then our frame has not yet been set up. */
|
||||
then our frame has not yet been set up. */
|
||||
|
||||
/* Get the first insn from memory. */
|
||||
|
||||
@ -331,7 +331,7 @@ microblaze_analyze_prologue (struct gdbarch *gdbarch, CORE_ADDR pc,
|
||||
else if (IS_SETUP_FP(op, ra, rb))
|
||||
{
|
||||
/* We have a frame pointer. Note the register which is
|
||||
acting as the frame pointer. */
|
||||
acting as the frame pointer. */
|
||||
flags |= MICROBLAZE_MY_FRAME_IN_FP;
|
||||
flags &= ~MICROBLAZE_MY_FRAME_IN_SP;
|
||||
cache->fp_regnum = rd;
|
||||
@ -376,7 +376,7 @@ microblaze_analyze_prologue (struct gdbarch *gdbarch, CORE_ADDR pc,
|
||||
|
||||
/* When optimizations are enabled, it is not guaranteed that prologue
|
||||
instructions are not mixed in with other instructions from the
|
||||
program. Some programs show this behavior at -O2. This can be
|
||||
program. Some programs show this behavior at -O2. This can be
|
||||
avoided by adding -fno-schedule-insns2 switch as of now (edk 8.1)
|
||||
In such cases, we scan the function until we see the first control
|
||||
instruction. */
|
||||
@ -391,7 +391,7 @@ microblaze_analyze_prologue (struct gdbarch *gdbarch, CORE_ADDR pc,
|
||||
continue; /* continue if imm. */
|
||||
}
|
||||
|
||||
/* This is not a prologue insn, so stop here. */
|
||||
/* This is not a prologue insn, so stop here. */
|
||||
microblaze_debug ("insn is not a prologue insn -- ending scan\n");
|
||||
break;
|
||||
}
|
||||
@ -509,7 +509,8 @@ microblaze_frame_prev_register (struct frame_info *this_frame,
|
||||
regnum = 15;
|
||||
if (regnum == MICROBLAZE_SP_REGNUM)
|
||||
regnum = 1;
|
||||
return trad_frame_get_prev_register (this_frame, cache->saved_regs, regnum);
|
||||
return trad_frame_get_prev_register (this_frame,
|
||||
cache->saved_regs, regnum);
|
||||
}
|
||||
else
|
||||
return trad_frame_get_prev_register (this_frame, cache->saved_regs,
|
||||
@ -527,7 +528,8 @@ static const struct frame_unwind microblaze_frame_unwind =
|
||||
};
|
||||
|
||||
static CORE_ADDR
|
||||
microblaze_frame_base_address (struct frame_info *next_frame, void **this_cache)
|
||||
microblaze_frame_base_address (struct frame_info *next_frame,
|
||||
void **this_cache)
|
||||
{
|
||||
struct microblaze_frame_cache *cache =
|
||||
microblaze_frame_cache (next_frame, this_cache);
|
||||
@ -581,8 +583,7 @@ microblaze_extract_return_value (struct type *type, struct regcache *regcache,
|
||||
Longs are stored in r3 (most significant word) and r4 (least
|
||||
significant word).
|
||||
|
||||
Small structures are always returned on stack.
|
||||
*/
|
||||
Small structures are always returned on stack. */
|
||||
|
||||
static void
|
||||
microblaze_store_return_value (struct type *type, struct regcache *regcache,
|
||||
@ -720,7 +721,7 @@ microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
|
||||
/* Hook in ABI-specific overrides, if they have been registered. */
|
||||
gdbarch_init_osabi (info, gdbarch);
|
||||
|
||||
/* Unwind the frame. */
|
||||
/* Unwind the frame. */
|
||||
dwarf2_append_unwinders (gdbarch);
|
||||
frame_unwind_append_unwinder (gdbarch, µblaze_frame_unwind);
|
||||
frame_base_append_sniffer (gdbarch, dwarf2_frame_base_sniffer);
|
||||
|
@ -35,7 +35,7 @@
|
||||
Even when a file contains enough debugging information to build a full
|
||||
symbol table, these minimal symbols are still useful for quickly mapping
|
||||
between names and addresses, and vice versa. They are also sometimes used
|
||||
to figure out what full symbol table entries need to be read in. */
|
||||
to figure out what full symbol table entries need to be read in. */
|
||||
|
||||
|
||||
#include "defs.h"
|
||||
@ -205,7 +205,7 @@ lookup_minimal_symbol (const char *name, const char *sfile,
|
||||
sfile = p + 1;
|
||||
}
|
||||
|
||||
/* For C++, canonicalize the input name. */
|
||||
/* For C++, canonicalize the input name. */
|
||||
modified_name = name;
|
||||
if (current_language->la_language == language_cplus)
|
||||
{
|
||||
@ -267,9 +267,9 @@ lookup_minimal_symbol (const char *name, const char *sfile,
|
||||
case mst_solib_trampoline:
|
||||
|
||||
/* If a trampoline symbol is found, we prefer to
|
||||
keep looking for the *real* symbol. If the
|
||||
keep looking for the *real* symbol. If the
|
||||
actual symbol is not found, then we'll use the
|
||||
trampoline entry. */
|
||||
trampoline entry. */
|
||||
if (trampoline_symbol == NULL)
|
||||
trampoline_symbol = msymbol;
|
||||
break;
|
||||
@ -489,7 +489,7 @@ lookup_minimal_symbol_by_pc_section_1 (CORE_ADDR pc,
|
||||
a binary search. Note that a minimal symbol table always consists
|
||||
of at least two symbols, a "real" symbol and the terminating
|
||||
"null symbol". If there are no real symbols, then there is no
|
||||
minimal symbol table at all. */
|
||||
minimal symbol table at all. */
|
||||
|
||||
if (objfile->minimal_symbol_count > 0)
|
||||
{
|
||||
@ -515,15 +515,15 @@ lookup_minimal_symbol_by_pc_section_1 (CORE_ADDR pc,
|
||||
terminates. In essence, we are iterating the test interval
|
||||
down until the pc value is pushed out of it from the high end.
|
||||
|
||||
Warning: this code is trickier than it would appear at first. */
|
||||
Warning: this code is trickier than it would appear at first. */
|
||||
|
||||
/* Should also require that pc is <= end of objfile. FIXME! */
|
||||
/* Should also require that pc is <= end of objfile. FIXME! */
|
||||
if (pc >= SYMBOL_VALUE_ADDRESS (&msymbol[lo]))
|
||||
{
|
||||
while (SYMBOL_VALUE_ADDRESS (&msymbol[hi]) > pc)
|
||||
{
|
||||
/* pc is still strictly less than highest address */
|
||||
/* Note "new" will always be >= lo */
|
||||
/* pc is still strictly less than highest address. */
|
||||
/* Note "new" will always be >= lo. */
|
||||
new = (lo + hi) / 2;
|
||||
if ((SYMBOL_VALUE_ADDRESS (&msymbol[new]) >= pc) ||
|
||||
(lo == new))
|
||||
@ -662,7 +662,7 @@ lookup_minimal_symbol_by_pc_section_1 (CORE_ADDR pc,
|
||||
|
||||
/* The minimal symbol indexed by hi now is the best one in this
|
||||
objfile's minimal symbol table. See if it is the best one
|
||||
overall. */
|
||||
overall. */
|
||||
|
||||
if (hi >= 0
|
||||
&& ((best_symbol == NULL) ||
|
||||
@ -693,7 +693,7 @@ lookup_minimal_symbol_by_pc_section (CORE_ADDR pc, struct obj_section *section)
|
||||
}
|
||||
|
||||
/* Backward compatibility: search through the minimal symbol table
|
||||
for a matching PC (no section given) */
|
||||
for a matching PC (no section given). */
|
||||
|
||||
struct minimal_symbol *
|
||||
lookup_minimal_symbol_by_pc (CORE_ADDR pc)
|
||||
@ -733,7 +733,7 @@ lookup_minimal_symbol_and_objfile (const char *name,
|
||||
}
|
||||
|
||||
|
||||
/* Return leading symbol character for a BFD. If BFD is NULL,
|
||||
/* Return leading symbol character for a BFD. If BFD is NULL,
|
||||
return the leading symbol character from the main objfile. */
|
||||
|
||||
static int get_symbol_leading_char (bfd *);
|
||||
@ -750,7 +750,7 @@ get_symbol_leading_char (bfd *abfd)
|
||||
|
||||
/* Prepare to start collecting minimal symbols. Note that presetting
|
||||
msym_bunch_index to BUNCH_SIZE causes the first call to save a minimal
|
||||
symbol to allocate the memory for the first bunch. */
|
||||
symbol to allocate the memory for the first bunch. */
|
||||
|
||||
void
|
||||
init_minimal_symbol_collection (void)
|
||||
@ -816,7 +816,7 @@ prim_record_minimal_symbol_full (const char *name, int name_len, int copy_name,
|
||||
return (NULL);
|
||||
|
||||
/* It's safe to strip the leading char here once, since the name
|
||||
is also stored stripped in the minimal symbol table. */
|
||||
is also stored stripped in the minimal symbol table. */
|
||||
if (name[0] == get_symbol_leading_char (objfile->obfd))
|
||||
{
|
||||
++name;
|
||||
@ -858,7 +858,7 @@ prim_record_minimal_symbol_full (const char *name, int name_len, int copy_name,
|
||||
MSYMBOL_SIZE (msymbol) = 0;
|
||||
|
||||
/* The hash pointers must be cleared! If they're not,
|
||||
add_minsym_to_hash_table will NOT add this msymbol to the hash table. */
|
||||
add_minsym_to_hash_table will NOT add this msymbol to the hash table. */
|
||||
msymbol->hash_next = NULL;
|
||||
msymbol->demangled_hash_next = NULL;
|
||||
|
||||
@ -884,7 +884,7 @@ prim_record_minimal_symbol_and_info (const char *name, CORE_ADDR address,
|
||||
}
|
||||
|
||||
/* Compare two minimal symbols by address and return a signed result based
|
||||
on unsigned comparisons, so that we sort into unsigned numeric order.
|
||||
on unsigned comparisons, so that we sort into unsigned numeric order.
|
||||
Within groups with the same address, sort by name. */
|
||||
|
||||
static int
|
||||
@ -898,11 +898,11 @@ compare_minimal_symbols (const void *fn1p, const void *fn2p)
|
||||
|
||||
if (SYMBOL_VALUE_ADDRESS (fn1) < SYMBOL_VALUE_ADDRESS (fn2))
|
||||
{
|
||||
return (-1); /* addr 1 is less than addr 2 */
|
||||
return (-1); /* addr 1 is less than addr 2. */
|
||||
}
|
||||
else if (SYMBOL_VALUE_ADDRESS (fn1) > SYMBOL_VALUE_ADDRESS (fn2))
|
||||
{
|
||||
return (1); /* addr 1 is greater than addr 2 */
|
||||
return (1); /* addr 1 is greater than addr 2. */
|
||||
}
|
||||
else
|
||||
/* addrs are equal: sort by name */
|
||||
@ -913,11 +913,11 @@ compare_minimal_symbols (const void *fn1p, const void *fn2p)
|
||||
if (name1 && name2) /* both have names */
|
||||
return strcmp (name1, name2);
|
||||
else if (name2)
|
||||
return 1; /* fn1 has no name, so it is "less" */
|
||||
else if (name1) /* fn2 has no name, so it is "less" */
|
||||
return 1; /* fn1 has no name, so it is "less". */
|
||||
else if (name1) /* fn2 has no name, so it is "less". */
|
||||
return -1;
|
||||
else
|
||||
return (0); /* neither has a name, so they're equal. */
|
||||
return (0); /* Neither has a name, so they're equal. */
|
||||
}
|
||||
}
|
||||
|
||||
@ -927,7 +927,7 @@ compare_minimal_symbols (const void *fn1p, const void *fn2p)
|
||||
|
||||
FIXME: We could allocate the minimal symbol bunches on their own
|
||||
obstack and then simply blow the obstack away when we are done with
|
||||
it. Is it worth the extra trouble though? */
|
||||
it. Is it worth the extra trouble though? */
|
||||
|
||||
static void
|
||||
do_discard_minimal_symbols_cleanup (void *arg)
|
||||
@ -1020,7 +1020,7 @@ compact_minimal_symbols (struct minimal_symbol *msymbol, int mcount,
|
||||
|
||||
/* Build (or rebuild) the minimal symbol hash tables. This is necessary
|
||||
after compacting or sorting the table since the entries move around
|
||||
thus causing the internal minimal_symbol pointers to become jumbled. */
|
||||
thus causing the internal minimal_symbol pointers to become jumbled. */
|
||||
|
||||
static void
|
||||
build_minimal_symbol_hash_tables (struct objfile *objfile)
|
||||
@ -1028,14 +1028,14 @@ build_minimal_symbol_hash_tables (struct objfile *objfile)
|
||||
int i;
|
||||
struct minimal_symbol *msym;
|
||||
|
||||
/* Clear the hash tables. */
|
||||
/* Clear the hash tables. */
|
||||
for (i = 0; i < MINIMAL_SYMBOL_HASH_SIZE; i++)
|
||||
{
|
||||
objfile->msymbol_hash[i] = 0;
|
||||
objfile->msymbol_demangled_hash[i] = 0;
|
||||
}
|
||||
|
||||
/* Now, (re)insert the actual entries. */
|
||||
/* Now, (re)insert the actual entries. */
|
||||
for (i = objfile->minimal_symbol_count, msym = objfile->msymbols;
|
||||
i > 0;
|
||||
i--, msym++)
|
||||
@ -1071,7 +1071,7 @@ build_minimal_symbol_hash_tables (struct objfile *objfile)
|
||||
to demangle it, and if successful, record it as a language_cplus symbol
|
||||
and cache the demangled form on the symbol obstack. Symbols which don't
|
||||
demangle are marked as language_unknown symbols, which inhibits future
|
||||
attempts to demangle them if we later add more minimal symbols. */
|
||||
attempts to demangle them if we later add more minimal symbols. */
|
||||
|
||||
void
|
||||
install_minimal_symbols (struct objfile *objfile)
|
||||
@ -1105,7 +1105,7 @@ install_minimal_symbols (struct objfile *objfile)
|
||||
to the new contiguous array of symbols. Note that we start with the
|
||||
current, possibly partially filled bunch (thus we use the current
|
||||
msym_bunch_index for the first bunch we copy over), and thereafter
|
||||
each bunch is full. */
|
||||
each bunch is full. */
|
||||
|
||||
mcount = objfile->minimal_symbol_count;
|
||||
|
||||
@ -1137,7 +1137,7 @@ install_minimal_symbols (struct objfile *objfile)
|
||||
to some symbol in the middle of it. Zero out the fields in the
|
||||
"null symbol" allocated at the end of the array. Note that the
|
||||
symbol count does *not* include this null symbol, which is why it
|
||||
is indexed by mcount and not mcount-1. */
|
||||
is indexed by mcount and not mcount-1. */
|
||||
|
||||
SYMBOL_LINKAGE_NAME (&msymbols[mcount]) = NULL;
|
||||
SYMBOL_VALUE_ADDRESS (&msymbols[mcount]) = 0;
|
||||
@ -1180,7 +1180,7 @@ install_minimal_symbols (struct objfile *objfile)
|
||||
/* Now build the hash tables; we can't do this incrementally
|
||||
at an earlier point since we weren't finished with the obstack
|
||||
yet. (And if the msymbol obstack gets moved, all the internal
|
||||
pointers to other msymbols need to be adjusted.) */
|
||||
pointers to other msymbols need to be adjusted.) */
|
||||
build_minimal_symbol_hash_tables (objfile);
|
||||
}
|
||||
}
|
||||
@ -1221,7 +1221,7 @@ lookup_solib_trampoline_symbol_by_pc (CORE_ADDR pc)
|
||||
|
||||
We may fail to find the right function if a function with the
|
||||
same name is defined in more than one shared library, but this
|
||||
is considered bad programming style. We could return 0 if we find
|
||||
is considered bad programming style. We could return 0 if we find
|
||||
a duplicate function in case this matters someday. */
|
||||
|
||||
CORE_ADDR
|
||||
|
@ -69,7 +69,7 @@ mips_irix_elf_osabi_sniffer (bfd *abfd)
|
||||
/* When elfosabi is ELFOSABI_NONE (0), then the ELF structures in the
|
||||
file are conforming to the base specification for that machine
|
||||
(there are no OS-specific extensions). In order to determine the
|
||||
real OS in use we must look for OS notes that have been added.
|
||||
real OS in use we must look for OS notes that have been added.
|
||||
|
||||
For IRIX, we simply look for sections named with .MIPS. as
|
||||
prefixes. */
|
||||
|
@ -182,7 +182,8 @@ supply_fpregset (struct regcache *regcache, const gdb_fpregset_t *fpregsetp)
|
||||
if (mips_isa_regsize (get_regcache_arch (regcache)) == 4)
|
||||
mips_supply_fpregset (regcache, (const mips_elf_fpregset_t *) fpregsetp);
|
||||
else
|
||||
mips64_supply_fpregset (regcache, (const mips64_elf_fpregset_t *) fpregsetp);
|
||||
mips64_supply_fpregset (regcache,
|
||||
(const mips64_elf_fpregset_t *) fpregsetp);
|
||||
}
|
||||
|
||||
void
|
||||
@ -192,7 +193,8 @@ fill_fpregset (const struct regcache *regcache,
|
||||
if (mips_isa_regsize (get_regcache_arch (regcache)) == 4)
|
||||
mips_fill_fpregset (regcache, (mips_elf_fpregset_t *) fpregsetp, regno);
|
||||
else
|
||||
mips64_fill_fpregset (regcache, (mips64_elf_fpregset_t *) fpregsetp, regno);
|
||||
mips64_fill_fpregset (regcache,
|
||||
(mips64_elf_fpregset_t *) fpregsetp, regno);
|
||||
}
|
||||
|
||||
|
||||
@ -262,7 +264,8 @@ mips64_linux_regsets_fetch_registers (struct regcache *regcache, int regno)
|
||||
using PTRACE_SETREGS et al. */
|
||||
|
||||
static void
|
||||
mips64_linux_regsets_store_registers (const struct regcache *regcache, int regno)
|
||||
mips64_linux_regsets_store_registers (const struct regcache *regcache,
|
||||
int regno)
|
||||
{
|
||||
struct gdbarch *gdbarch = get_regcache_arch (regcache);
|
||||
int is_fp;
|
||||
@ -393,12 +396,12 @@ enum pt_watch_style {
|
||||
|
||||
#define MAX_DEBUG_REGISTER 8
|
||||
|
||||
/* A value of zero in a watchlo indicates that it is available. */
|
||||
/* A value of zero in a watchlo indicates that it is available. */
|
||||
|
||||
struct mips32_watch_regs
|
||||
{
|
||||
uint32_t watchlo[MAX_DEBUG_REGISTER];
|
||||
/* Lower 16 bits of watchhi. */
|
||||
/* Lower 16 bits of watchhi. */
|
||||
uint16_t watchhi[MAX_DEBUG_REGISTER];
|
||||
/* Valid mask and I R W bits.
|
||||
* bit 0 -- 1 if W bit is usable.
|
||||
@ -710,7 +713,7 @@ mips_linux_can_use_hw_breakpoint (int type, int cnt, int ot)
|
||||
|
||||
/* Target to_stopped_by_watchpoint implementation. Return 1 if
|
||||
stopped by watchpoint. The watchhi R and W bits indicate the watch
|
||||
register triggered. */
|
||||
register triggered. */
|
||||
|
||||
static int
|
||||
mips_linux_stopped_by_watchpoint (void)
|
||||
|
@ -413,7 +413,8 @@ mips64_fill_gregset (const struct regcache *regcache,
|
||||
mips64_fill_gregset (regcache, gregsetp, mips_regnum (gdbarch)->lo);
|
||||
mips64_fill_gregset (regcache, gregsetp, mips_regnum (gdbarch)->hi);
|
||||
mips64_fill_gregset (regcache, gregsetp, mips_regnum (gdbarch)->pc);
|
||||
mips64_fill_gregset (regcache, gregsetp, mips_regnum (gdbarch)->badvaddr);
|
||||
mips64_fill_gregset (regcache, gregsetp,
|
||||
mips_regnum (gdbarch)->badvaddr);
|
||||
mips64_fill_gregset (regcache, gregsetp, MIPS_PS_REGNUM);
|
||||
mips64_fill_gregset (regcache, gregsetp, mips_regnum (gdbarch)->cause);
|
||||
mips64_fill_gregset (regcache, gregsetp, MIPS_RESTART_REGNUM);
|
||||
@ -538,7 +539,8 @@ mips64_fill_fpregset (const struct regcache *regcache,
|
||||
}
|
||||
else
|
||||
{
|
||||
to = (gdb_byte *) (*fpregsetp + regno - gdbarch_fp0_regnum (gdbarch));
|
||||
to = (gdb_byte *) (*fpregsetp + regno
|
||||
- gdbarch_fp0_regnum (gdbarch));
|
||||
regcache_raw_collect (regcache, regno, to);
|
||||
}
|
||||
}
|
||||
|
@ -87,9 +87,12 @@ typedef mips64_elf_fpreg_t mips64_elf_fpregset_t[MIPS64_ELF_NFPREG];
|
||||
#define MIPS64_EF_SIZE 304
|
||||
|
||||
void mips64_supply_gregset (struct regcache *, const mips64_elf_gregset_t *);
|
||||
void mips64_fill_gregset (const struct regcache *, mips64_elf_gregset_t *, int);
|
||||
void mips64_supply_fpregset (struct regcache *, const mips64_elf_fpregset_t *);
|
||||
void mips64_fill_fpregset (const struct regcache *, mips64_elf_fpregset_t *, int);
|
||||
void mips64_fill_gregset (const struct regcache *,
|
||||
mips64_elf_gregset_t *, int);
|
||||
void mips64_supply_fpregset (struct regcache *,
|
||||
const mips64_elf_fpregset_t *);
|
||||
void mips64_fill_fpregset (const struct regcache *,
|
||||
mips64_elf_fpregset_t *, int);
|
||||
|
||||
enum {
|
||||
/* The Linux kernel stores an error code from any interrupted
|
||||
|
303
gdb/mips-tdep.c
303
gdb/mips-tdep.c
@ -185,9 +185,11 @@ mips_fpa0_regnum (struct gdbarch *gdbarch)
|
||||
== MIPS_ABI_EABI32 \
|
||||
|| gdbarch_tdep (gdbarch)->mips_abi == MIPS_ABI_EABI64)
|
||||
|
||||
#define MIPS_LAST_FP_ARG_REGNUM(gdbarch) (gdbarch_tdep (gdbarch)->mips_last_fp_arg_regnum)
|
||||
#define MIPS_LAST_FP_ARG_REGNUM(gdbarch) \
|
||||
(gdbarch_tdep (gdbarch)->mips_last_fp_arg_regnum)
|
||||
|
||||
#define MIPS_LAST_ARG_REGNUM(gdbarch) (gdbarch_tdep (gdbarch)->mips_last_arg_regnum)
|
||||
#define MIPS_LAST_ARG_REGNUM(gdbarch) \
|
||||
(gdbarch_tdep (gdbarch)->mips_last_arg_regnum)
|
||||
|
||||
#define MIPS_FPU_TYPE(gdbarch) (gdbarch_tdep (gdbarch)->mips_fpu_type)
|
||||
|
||||
@ -233,7 +235,7 @@ mips_isa_regsize (struct gdbarch *gdbarch)
|
||||
/ gdbarch_bfd_arch_info (gdbarch)->bits_per_byte);
|
||||
}
|
||||
|
||||
/* Return the currently configured (or set) saved register size. */
|
||||
/* Return the currently configured (or set) saved register size. */
|
||||
|
||||
unsigned int
|
||||
mips_abi_regsize (struct gdbarch *gdbarch)
|
||||
@ -370,7 +372,7 @@ static CORE_ADDR heuristic_proc_start (struct gdbarch *, CORE_ADDR);
|
||||
|
||||
static void reinit_frame_cache_sfunc (char *, int, struct cmd_list_element *);
|
||||
|
||||
/* The list of available "set mips " and "show mips " commands */
|
||||
/* The list of available "set mips " and "show mips " commands. */
|
||||
|
||||
static struct cmd_list_element *setmipscmdlist = NULL;
|
||||
static struct cmd_list_element *showmipscmdlist = NULL;
|
||||
@ -724,7 +726,8 @@ mips_convert_register_gpreg_case_p (struct gdbarch *gdbarch, int regnum,
|
||||
}
|
||||
|
||||
static int
|
||||
mips_convert_register_p (struct gdbarch *gdbarch, int regnum, struct type *type)
|
||||
mips_convert_register_p (struct gdbarch *gdbarch,
|
||||
int regnum, struct type *type)
|
||||
{
|
||||
return mips_convert_register_float_case_p (gdbarch, regnum, type)
|
||||
|| mips_convert_register_gpreg_case_p (gdbarch, regnum, type);
|
||||
@ -911,7 +914,7 @@ mips_pseudo_register_type (struct gdbarch *gdbarch, int regnum)
|
||||
return rawtype;
|
||||
}
|
||||
|
||||
/* Should the upper word of 64-bit addresses be zeroed? */
|
||||
/* Should the upper word of 64-bit addresses be zeroed? */
|
||||
enum auto_boolean mask_address_var = AUTO_BOOLEAN_AUTO;
|
||||
|
||||
static int
|
||||
@ -927,7 +930,8 @@ mips_mask_address_p (struct gdbarch_tdep *tdep)
|
||||
case AUTO_BOOLEAN_AUTO:
|
||||
return tdep->default_mask_address_p;
|
||||
default:
|
||||
internal_error (__FILE__, __LINE__, _("mips_mask_address_p: bad switch"));
|
||||
internal_error (__FILE__, __LINE__,
|
||||
_("mips_mask_address_p: bad switch"));
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@ -965,7 +969,7 @@ mips_pc_is_mips16 (CORE_ADDR memaddr)
|
||||
{
|
||||
struct minimal_symbol *sym;
|
||||
|
||||
/* If bit 0 of the address is set, assume this is a MIPS16 address. */
|
||||
/* If bit 0 of the address is set, assume this is a MIPS16 address. */
|
||||
if (is_mips16_addr (memaddr))
|
||||
return 1;
|
||||
|
||||
@ -980,7 +984,7 @@ mips_pc_is_mips16 (CORE_ADDR memaddr)
|
||||
}
|
||||
|
||||
/* MIPS believes that the PC has a sign extended value. Perhaps the
|
||||
all registers should be sign extended for simplicity? */
|
||||
all registers should be sign extended for simplicity? */
|
||||
|
||||
static CORE_ADDR
|
||||
mips_read_pc (struct regcache *regcache)
|
||||
@ -1061,7 +1065,7 @@ mips_fetch_instruction (struct gdbarch *gdbarch, CORE_ADDR addr)
|
||||
return extract_unsigned_integer (buf, instlen, byte_order);
|
||||
}
|
||||
|
||||
/* These the fields of 32 bit mips instructions */
|
||||
/* These are the fields of 32 bit mips instructions. */
|
||||
#define mips32_op(x) (x >> 26)
|
||||
#define itype_op(x) (x >> 26)
|
||||
#define itype_rs(x) ((x >> 21) & 0x1f)
|
||||
@ -1093,7 +1097,8 @@ mips32_next_pc (struct frame_info *frame, CORE_ADDR pc)
|
||||
unsigned long inst;
|
||||
int op;
|
||||
inst = mips_fetch_instruction (gdbarch, pc);
|
||||
if ((inst & 0xe0000000) != 0) /* Not a special, jump or branch instruction */
|
||||
if ((inst & 0xe0000000) != 0) /* Not a special, jump or branch
|
||||
instruction. */
|
||||
{
|
||||
if (itype_op (inst) >> 2 == 5)
|
||||
/* BEQL, BNEL, BLEZL, BGTZL: bits 0101xx */
|
||||
@ -1130,13 +1135,13 @@ mips32_next_pc (struct frame_info *frame, CORE_ADDR pc)
|
||||
pc += 8;
|
||||
}
|
||||
else
|
||||
pc += 4; /* Not a branch, next instruction is easy */
|
||||
pc += 4; /* Not a branch, next instruction is easy. */
|
||||
}
|
||||
else
|
||||
{ /* This gets way messy */
|
||||
{ /* This gets way messy. */
|
||||
|
||||
/* Further subdivide into SPECIAL, REGIMM and other */
|
||||
switch (op = itype_op (inst) & 0x07) /* extract bits 28,27,26 */
|
||||
/* Further subdivide into SPECIAL, REGIMM and other. */
|
||||
switch (op = itype_op (inst) & 0x07) /* Extract bits 28,27,26. */
|
||||
{
|
||||
case 0: /* SPECIAL */
|
||||
op = rtype_funct (inst);
|
||||
@ -1144,7 +1149,7 @@ mips32_next_pc (struct frame_info *frame, CORE_ADDR pc)
|
||||
{
|
||||
case 8: /* JR */
|
||||
case 9: /* JALR */
|
||||
/* Set PC to that address */
|
||||
/* Set PC to that address. */
|
||||
pc = get_frame_register_signed (frame, rtype_rs (inst));
|
||||
break;
|
||||
case 12: /* SYSCALL */
|
||||
@ -1163,7 +1168,7 @@ mips32_next_pc (struct frame_info *frame, CORE_ADDR pc)
|
||||
}
|
||||
|
||||
break; /* end SPECIAL */
|
||||
case 1: /* REGIMM */
|
||||
case 1: /* REGIMM */
|
||||
{
|
||||
op = itype_rt (inst); /* branch condition */
|
||||
switch (op)
|
||||
@ -1198,7 +1203,7 @@ mips32_next_pc (struct frame_info *frame, CORE_ADDR pc)
|
||||
{
|
||||
unsigned long reg;
|
||||
reg = jtype_target (inst) << 2;
|
||||
/* Upper four bits get never changed... */
|
||||
/* Upper four bits get never changed... */
|
||||
pc = reg + ((pc + 4) & ~(CORE_ADDR) 0x0fffffff);
|
||||
}
|
||||
break;
|
||||
@ -1206,7 +1211,7 @@ mips32_next_pc (struct frame_info *frame, CORE_ADDR pc)
|
||||
{
|
||||
unsigned long reg;
|
||||
reg = jtype_target (inst) << 2;
|
||||
pc = reg + ((pc + 4) & ~(CORE_ADDR) 0x0fffffff) + 1; /* yes, +1 */
|
||||
pc = reg + ((pc + 4) & ~(CORE_ADDR) 0x0fffffff) + 1; /* yes, +1 */
|
||||
/* Add 1 to indicate 16 bit mode - Invert ISA mode */
|
||||
}
|
||||
break; /* The new PC will be alternate mode */
|
||||
@ -1246,16 +1251,14 @@ mips32_next_pc (struct frame_info *frame, CORE_ADDR pc)
|
||||
} /* mips32_next_pc */
|
||||
|
||||
/* Decoding the next place to set a breakpoint is irregular for the
|
||||
mips 16 variant, but fortunately, there fewer instructions. We have to cope
|
||||
ith extensions for 16 bit instructions and a pair of actual 32 bit instructions.
|
||||
We dont want to set a single step instruction on the extend instruction
|
||||
either.
|
||||
*/
|
||||
mips 16 variant, but fortunately, there fewer instructions. We have
|
||||
to cope ith extensions for 16 bit instructions and a pair of actual
|
||||
32 bit instructions. We dont want to set a single step instruction
|
||||
on the extend instruction either. */
|
||||
|
||||
/* Lots of mips16 instruction formats */
|
||||
/* Predicting jumps requires itype,ritype,i8type
|
||||
and their extensions extItype,extritype,extI8type
|
||||
*/
|
||||
and their extensions extItype,extritype,extI8type. */
|
||||
enum mips16_inst_fmts
|
||||
{
|
||||
itype, /* 0 immediate 5,10 */
|
||||
@ -1282,11 +1285,11 @@ enum mips16_inst_fmts
|
||||
extshift64type /* 21 5,5,1,1,1,1,1,1,5,1,1,1,3,5 */
|
||||
};
|
||||
/* I am heaping all the fields of the formats into one structure and
|
||||
then, only the fields which are involved in instruction extension */
|
||||
then, only the fields which are involved in instruction extension. */
|
||||
struct upk_mips16
|
||||
{
|
||||
CORE_ADDR offset;
|
||||
unsigned int regx; /* Function in i8 type */
|
||||
unsigned int regx; /* Function in i8 type. */
|
||||
unsigned int regy;
|
||||
};
|
||||
|
||||
@ -1300,7 +1303,7 @@ extended_offset (unsigned int extension)
|
||||
CORE_ADDR value;
|
||||
value = (extension >> 21) & 0x3f; /* * extract 15:11 */
|
||||
value = value << 6;
|
||||
value |= (extension >> 16) & 0x1f; /* extrace 10:5 */
|
||||
value |= (extension >> 16) & 0x1f; /* extract 10:5 */
|
||||
value = value << 5;
|
||||
value |= extension & 0x01f; /* extract 4:0 */
|
||||
return value;
|
||||
@ -1318,7 +1321,7 @@ fetch_mips_16 (struct gdbarch *gdbarch, CORE_ADDR pc)
|
||||
{
|
||||
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
|
||||
gdb_byte buf[8];
|
||||
pc &= 0xfffffffe; /* clear the low order bit */
|
||||
pc &= 0xfffffffe; /* Clear the low order bit. */
|
||||
target_read_memory (pc, buf, 2);
|
||||
return extract_unsigned_integer (buf, 2, byte_order);
|
||||
}
|
||||
@ -1346,7 +1349,7 @@ unpack_mips16 (struct gdbarch *gdbarch, CORE_ADDR pc,
|
||||
else
|
||||
{
|
||||
value = inst & 0x7ff;
|
||||
/* FIXME : Consider sign extension */
|
||||
/* FIXME : Consider sign extension. */
|
||||
}
|
||||
offset = value;
|
||||
regx = -1;
|
||||
@ -1355,19 +1358,19 @@ unpack_mips16 (struct gdbarch *gdbarch, CORE_ADDR pc,
|
||||
break;
|
||||
case ritype:
|
||||
case i8type:
|
||||
{ /* A register identifier and an offset */
|
||||
{ /* A register identifier and an offset. */
|
||||
/* Most of the fields are the same as I type but the
|
||||
immediate value is of a different length */
|
||||
immediate value is of a different length. */
|
||||
CORE_ADDR value;
|
||||
if (extension)
|
||||
{
|
||||
value = extended_offset (extension);
|
||||
value = value << 8; /* from the original instruction */
|
||||
value = value << 8; /* from the original instruction */
|
||||
value |= inst & 0xff; /* eleven bits from instruction */
|
||||
regx = (extension >> 8) & 0x07; /* or i8 funct */
|
||||
if (value & 0x4000) /* test the sign bit , bit 26 */
|
||||
if (value & 0x4000) /* Test the sign bit, bit 26. */
|
||||
{
|
||||
value &= ~0x3fff; /* remove the sign bit */
|
||||
value &= ~0x3fff; /* Remove the sign bit. */
|
||||
value = -value;
|
||||
}
|
||||
}
|
||||
@ -1375,10 +1378,10 @@ unpack_mips16 (struct gdbarch *gdbarch, CORE_ADDR pc,
|
||||
{
|
||||
value = inst & 0xff; /* 8 bits */
|
||||
regx = (inst >> 8) & 0x07; /* or i8 funct */
|
||||
/* FIXME: Do sign extension , this format needs it */
|
||||
if (value & 0x80) /* THIS CONFUSES ME */
|
||||
/* FIXME: Do sign extension, this format needs it. */
|
||||
if (value & 0x80) /* THIS CONFUSES ME. */
|
||||
{
|
||||
value &= 0xef; /* remove the sign bit */
|
||||
value &= 0xef; /* Remove the sign bit. */
|
||||
value = -value;
|
||||
}
|
||||
}
|
||||
@ -1392,7 +1395,8 @@ unpack_mips16 (struct gdbarch *gdbarch, CORE_ADDR pc,
|
||||
unsigned int nexthalf;
|
||||
value = ((inst & 0x1f) << 5) | ((inst >> 5) & 0x1f);
|
||||
value = value << 16;
|
||||
nexthalf = mips_fetch_instruction (gdbarch, pc + 2); /* low bit still set */
|
||||
nexthalf = mips_fetch_instruction (gdbarch, pc + 2); /* low bit
|
||||
still set. */
|
||||
value |= nexthalf;
|
||||
offset = value;
|
||||
regx = -1;
|
||||
@ -1436,13 +1440,14 @@ extended_mips16_next_pc (struct frame_info *frame, CORE_ADDR pc,
|
||||
pc += (offset << 1) + 2;
|
||||
break;
|
||||
}
|
||||
case 3: /* JAL , JALX - Watch out, these are 32 bit instruction */
|
||||
case 3: /* JAL , JALX - Watch out, these are 32 bit
|
||||
instructions. */
|
||||
{
|
||||
struct upk_mips16 upk;
|
||||
unpack_mips16 (gdbarch, pc, extension, insn, jalxtype, &upk);
|
||||
pc = add_offset_16 (pc, upk.offset);
|
||||
if ((insn >> 10) & 0x01) /* Exchange mode */
|
||||
pc = pc & ~0x01; /* Clear low bit, indicate 32 bit mode */
|
||||
pc = pc & ~0x01; /* Clear low bit, indicate 32 bit mode. */
|
||||
else
|
||||
pc |= 0x01;
|
||||
break;
|
||||
@ -1503,7 +1508,7 @@ extended_mips16_next_pc (struct frame_info *frame, CORE_ADDR pc,
|
||||
break;
|
||||
case 1:
|
||||
reg = 31;
|
||||
break; /* Function return instruction */
|
||||
break; /* Function return instruction. */
|
||||
case 2:
|
||||
reg = upk.regx;
|
||||
break;
|
||||
@ -1520,7 +1525,7 @@ extended_mips16_next_pc (struct frame_info *frame, CORE_ADDR pc,
|
||||
case 30:
|
||||
/* This is an instruction extension. Fetch the real instruction
|
||||
(which follows the extension) and decode things based on
|
||||
that. */
|
||||
that. */
|
||||
{
|
||||
pc += 2;
|
||||
pc = extended_mips16_next_pc (frame, pc, insn,
|
||||
@ -1547,7 +1552,7 @@ mips16_next_pc (struct frame_info *frame, CORE_ADDR pc)
|
||||
/* The mips_next_pc function supports single_step when the remote
|
||||
target monitor or stub is not developed enough to do a single_step.
|
||||
It works by decoding the current instruction and predicting where a
|
||||
branch will go. This isnt hard because all the data is available.
|
||||
branch will go. This isnt hard because all the data is available.
|
||||
The MIPS32 and MIPS16 variants are quite different. */
|
||||
static CORE_ADDR
|
||||
mips_next_pc (struct frame_info *frame, CORE_ADDR pc)
|
||||
@ -1600,7 +1605,7 @@ mips16_get_imm (unsigned short prev_inst, /* previous instruction */
|
||||
unsigned short inst, /* current instruction */
|
||||
int nbits, /* number of bits in imm field */
|
||||
int scale, /* scale factor to be applied to imm */
|
||||
int is_signed) /* is the imm field signed? */
|
||||
int is_signed) /* is the imm field signed? */
|
||||
{
|
||||
int offset;
|
||||
|
||||
@ -1636,12 +1641,12 @@ mips16_scan_prologue (struct gdbarch *gdbarch,
|
||||
struct mips_frame_cache *this_cache)
|
||||
{
|
||||
CORE_ADDR cur_pc;
|
||||
CORE_ADDR frame_addr = 0; /* Value of $r17, used as frame pointer */
|
||||
CORE_ADDR frame_addr = 0; /* Value of $r17, used as frame pointer. */
|
||||
CORE_ADDR sp;
|
||||
long frame_offset = 0; /* Size of stack frame. */
|
||||
long frame_adjust = 0; /* Offset of FP from SP. */
|
||||
int frame_reg = MIPS_SP_REGNUM;
|
||||
unsigned short prev_inst = 0; /* saved copy of previous instruction */
|
||||
unsigned short prev_inst = 0; /* saved copy of previous instruction. */
|
||||
unsigned inst = 0; /* current instruction */
|
||||
unsigned entry_inst = 0; /* the entry instruction */
|
||||
unsigned save_inst = 0; /* the save instruction */
|
||||
@ -1669,7 +1674,7 @@ mips16_scan_prologue (struct gdbarch *gdbarch,
|
||||
the immediate offset extension from it in mips16_get_imm. */
|
||||
prev_inst = inst;
|
||||
|
||||
/* Fetch and decode the instruction. */
|
||||
/* Fetch and decode the instruction. */
|
||||
inst = (unsigned short) mips_fetch_instruction (gdbarch, cur_pc);
|
||||
|
||||
/* Normally we ignore extend instructions. However, if it is
|
||||
@ -1690,7 +1695,7 @@ mips16_scan_prologue (struct gdbarch *gdbarch,
|
||||
|| (inst & 0xff00) == 0xfb00) /* daddiu sp */
|
||||
{
|
||||
offset = mips16_get_imm (prev_inst, inst, 8, 8, 1);
|
||||
if (offset < 0) /* negative stack adjustment? */
|
||||
if (offset < 0) /* Negative stack adjustment? */
|
||||
frame_offset -= offset;
|
||||
else
|
||||
/* Exit loop if a positive stack adjustment is found, which
|
||||
@ -1746,10 +1751,10 @@ mips16_scan_prologue (struct gdbarch *gdbarch,
|
||||
}
|
||||
else if ((inst & 0xf81f) == 0xe809
|
||||
&& (inst & 0x700) != 0x700) /* entry */
|
||||
entry_inst = inst; /* save for later processing */
|
||||
entry_inst = inst; /* Save for later processing. */
|
||||
else if ((inst & 0xff80) == 0x6480) /* save */
|
||||
{
|
||||
save_inst = inst; /* save for later processing */
|
||||
save_inst = inst; /* Save for later processing. */
|
||||
if (prev_extend_bytes) /* extend */
|
||||
save_inst |= prev_inst << 16;
|
||||
}
|
||||
@ -1775,7 +1780,7 @@ mips16_scan_prologue (struct gdbarch *gdbarch,
|
||||
(before the prologue). But the value of the sp parameter to this
|
||||
function is the new SP (after the prologue has been executed). So we
|
||||
can't calculate those offsets until we've seen the entire prologue,
|
||||
and can calculate what the old SP must have been. */
|
||||
and can calculate what the old SP must have been. */
|
||||
if (entry_inst != 0)
|
||||
{
|
||||
int areg_count = (entry_inst >> 8) & 7;
|
||||
@ -1913,7 +1918,7 @@ mips16_scan_prologue (struct gdbarch *gdbarch,
|
||||
gdbarch_num_regs (gdbarch) + frame_reg)
|
||||
+ frame_offset - frame_adjust);
|
||||
/* FIXME: brobecker/2004-10-10: Just as in the mips32 case, we should
|
||||
be able to get rid of the assignment below, evetually. But it's
|
||||
be able to get rid of the assignment below, evetually. But it's
|
||||
still needed for now. */
|
||||
this_cache->saved_regs[gdbarch_num_regs (gdbarch)
|
||||
+ mips_regnum (gdbarch)->pc]
|
||||
@ -2056,7 +2061,7 @@ reset_saved_regs (struct gdbarch *gdbarch, struct mips_frame_cache *this_cache)
|
||||
}
|
||||
}
|
||||
|
||||
/* Analyze the function prologue from START_PC to LIMIT_PC. Builds
|
||||
/* Analyze the function prologue from START_PC to LIMIT_PC. Builds
|
||||
the associated FRAME_CACHE if not null.
|
||||
Return the address of the first instruction past the prologue. */
|
||||
|
||||
@ -2067,7 +2072,8 @@ mips32_scan_prologue (struct gdbarch *gdbarch,
|
||||
struct mips_frame_cache *this_cache)
|
||||
{
|
||||
CORE_ADDR cur_pc;
|
||||
CORE_ADDR frame_addr = 0; /* Value of $r30. Used by gcc for frame-pointer */
|
||||
CORE_ADDR frame_addr = 0; /* Value of $r30. Used by gcc for
|
||||
frame-pointer. */
|
||||
CORE_ADDR sp;
|
||||
long frame_offset;
|
||||
int frame_reg = MIPS_SP_REGNUM;
|
||||
@ -2098,7 +2104,7 @@ restart:
|
||||
unsigned long inst, high_word, low_word;
|
||||
int reg;
|
||||
|
||||
/* Fetch the instruction. */
|
||||
/* Fetch the instruction. */
|
||||
inst = (unsigned long) mips_fetch_instruction (gdbarch, cur_pc);
|
||||
|
||||
/* Save some code by pre-extracting some useful fields. */
|
||||
@ -2106,11 +2112,11 @@ restart:
|
||||
low_word = inst & 0xffff;
|
||||
reg = high_word & 0x1f;
|
||||
|
||||
if (high_word == 0x27bd /* addiu $sp,$sp,-i */
|
||||
if (high_word == 0x27bd /* addiu $sp,$sp,-i */
|
||||
|| high_word == 0x23bd /* addi $sp,$sp,-i */
|
||||
|| high_word == 0x67bd) /* daddiu $sp,$sp,-i */
|
||||
{
|
||||
if (low_word & 0x8000) /* negative stack adjustment? */
|
||||
if (low_word & 0x8000) /* Negative stack adjustment? */
|
||||
frame_offset += 0x10000 - low_word;
|
||||
else
|
||||
/* Exit loop if a positive stack adjustment is found, which
|
||||
@ -2146,7 +2152,7 @@ restart:
|
||||
alloca_adjust = (unsigned) (frame_addr - (sp + low_word));
|
||||
if (alloca_adjust > 0)
|
||||
{
|
||||
/* FP > SP + frame_size. This may be because of
|
||||
/* FP > SP + frame_size. This may be because of
|
||||
an alloca or somethings similar. Fix sp to
|
||||
"pre-alloca" value, and try again. */
|
||||
sp += alloca_adjust;
|
||||
@ -2176,7 +2182,7 @@ restart:
|
||||
alloca_adjust = (unsigned) (frame_addr - sp);
|
||||
if (alloca_adjust > 0)
|
||||
{
|
||||
/* FP > SP + frame_size. This may be because of
|
||||
/* FP > SP + frame_size. This may be because of
|
||||
an alloca or somethings similar. Fix sp to
|
||||
"pre-alloca" value, and try again. */
|
||||
sp = frame_addr;
|
||||
@ -2208,7 +2214,7 @@ restart:
|
||||
}
|
||||
/* The instructions below load $at or $t0 with an immediate
|
||||
value in preparation for a stack adjustment via
|
||||
subu $sp,$sp,[$at,$t0]. These instructions could also
|
||||
subu $sp,$sp,[$at,$t0]. These instructions could also
|
||||
initialize a local variable, so we accept them only before
|
||||
a stack adjustment instruction was seen. */
|
||||
else if (!seen_sp_adjust
|
||||
@ -2271,7 +2277,7 @@ restart:
|
||||
end_prologue_addr = cur_pc;
|
||||
|
||||
/* In a frameless function, we might have incorrectly
|
||||
skipped some load immediate instructions. Undo the skipping
|
||||
skipped some load immediate instructions. Undo the skipping
|
||||
if the load immediate was not followed by a stack adjustment. */
|
||||
if (load_immediate_bytes && !seen_sp_adjust)
|
||||
end_prologue_addr -= load_immediate_bytes;
|
||||
@ -2589,14 +2595,14 @@ deal_with_atomic_sequence (struct gdbarch *gdbarch,
|
||||
{
|
||||
case 0: /* SPECIAL */
|
||||
if (rtype_funct (insn) >> 1 == 4) /* JR, JALR */
|
||||
return 0; /* fallback to the standard single-step code. */
|
||||
return 0; /* fallback to the standard single-step code. */
|
||||
break;
|
||||
case 1: /* REGIMM */
|
||||
is_branch = ((itype_rt (insn) & 0xc0) == 0); /* B{LT,GE}Z* */
|
||||
break;
|
||||
case 2: /* J */
|
||||
case 3: /* JAL */
|
||||
return 0; /* fallback to the standard single-step code. */
|
||||
return 0; /* fallback to the standard single-step code. */
|
||||
case 4: /* BEQ */
|
||||
case 5: /* BNE */
|
||||
case 6: /* BLEZ */
|
||||
@ -2637,7 +2643,7 @@ deal_with_atomic_sequence (struct gdbarch *gdbarch,
|
||||
breaks[0] = loc;
|
||||
|
||||
/* Check for duplicated breakpoints. Check also for a breakpoint
|
||||
placed (branch instruction's destination) in the atomic sequence */
|
||||
placed (branch instruction's destination) in the atomic sequence. */
|
||||
if (last_breakpoint && pc <= breaks[1] && breaks[1] <= breaks[0])
|
||||
last_breakpoint = 0;
|
||||
|
||||
@ -2671,7 +2677,7 @@ mips_software_single_step (struct frame_info *frame)
|
||||
}
|
||||
|
||||
/* Test whether the PC points to the return instruction at the
|
||||
end of a function. */
|
||||
end of a function. */
|
||||
|
||||
static int
|
||||
mips_about_to_return (struct gdbarch *gdbarch, CORE_ADDR pc)
|
||||
@ -2715,7 +2721,7 @@ heuristic_proc_start (struct gdbarch *gdbarch, CORE_ADDR pc)
|
||||
|
||||
inf = current_inferior ();
|
||||
|
||||
/* search back for previous return */
|
||||
/* Search back for previous return. */
|
||||
for (start_pc -= instlen;; start_pc -= instlen)
|
||||
if (start_pc < fence)
|
||||
{
|
||||
@ -2767,7 +2773,7 @@ heuristic-fence-post' command.\n",
|
||||
entry
|
||||
addiu sp,-n
|
||||
daddiu sp,-n
|
||||
extend -n followed by 'addiu sp,+n' or 'daddiu sp,+n' */
|
||||
extend -n followed by 'addiu sp,+n' or 'daddiu sp,+n'. */
|
||||
inst = mips_fetch_instruction (gdbarch, start_pc);
|
||||
if ((inst & 0xff80) == 0x6480) /* save */
|
||||
{
|
||||
@ -2811,7 +2817,7 @@ struct mips_objfile_private
|
||||
floating-point register (assuming that there is space)? When there
|
||||
is no FPU, FP are not even considered as possible candidates for
|
||||
FP registers and, consequently this returns false - forces FP
|
||||
arguments into integer registers. */
|
||||
arguments into integer registers. */
|
||||
|
||||
static int
|
||||
fp_register_arg_p (struct gdbarch *gdbarch, enum type_code typecode,
|
||||
@ -2828,7 +2834,7 @@ fp_register_arg_p (struct gdbarch *gdbarch, enum type_code typecode,
|
||||
}
|
||||
|
||||
/* On o32, argument passing in GPRs depends on the alignment of the type being
|
||||
passed. Return 1 if this type must be aligned to a doubleword boundary. */
|
||||
passed. Return 1 if this type must be aligned to a doubleword boundary. */
|
||||
|
||||
static int
|
||||
mips_type_needs_double_align (struct type *type)
|
||||
@ -2918,7 +2924,8 @@ mips_eabi_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||
{
|
||||
if (mips_debug)
|
||||
fprintf_unfiltered (gdb_stdlog,
|
||||
"mips_eabi_push_dummy_call: struct_return reg=%d %s\n",
|
||||
"mips_eabi_push_dummy_call: "
|
||||
"struct_return reg=%d %s\n",
|
||||
argreg, paddress (gdbarch, struct_addr));
|
||||
regcache_cooked_write_unsigned (regcache, argreg++, struct_addr);
|
||||
}
|
||||
@ -3068,7 +3075,7 @@ mips_eabi_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||
|| fp_register_arg_p (gdbarch, typecode, arg_type))
|
||||
{
|
||||
/* Should shorter than int integer values be
|
||||
promoted to int before being stored? */
|
||||
promoted to int before being stored? */
|
||||
int longword_offset = 0;
|
||||
CORE_ADDR addr;
|
||||
stack_used_p = 1;
|
||||
@ -3322,7 +3329,8 @@ mips_n32n64_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||
{
|
||||
if (mips_debug)
|
||||
fprintf_unfiltered (gdb_stdlog,
|
||||
"mips_n32n64_push_dummy_call: struct_return reg=%d %s\n",
|
||||
"mips_n32n64_push_dummy_call: "
|
||||
"struct_return reg=%d %s\n",
|
||||
argreg, paddress (gdbarch, struct_addr));
|
||||
regcache_cooked_write_unsigned (regcache, argreg++, struct_addr);
|
||||
}
|
||||
@ -3422,7 +3430,7 @@ mips_n32n64_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||
if (argreg > MIPS_LAST_ARG_REGNUM (gdbarch))
|
||||
{
|
||||
/* Should shorter than int integer values be
|
||||
promoted to int before being stored? */
|
||||
promoted to int before being stored? */
|
||||
int longword_offset = 0;
|
||||
CORE_ADDR addr;
|
||||
stack_used_p = 1;
|
||||
@ -3773,7 +3781,8 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||
{
|
||||
if (mips_debug)
|
||||
fprintf_unfiltered (gdb_stdlog,
|
||||
"mips_o32_push_dummy_call: struct_return reg=%d %s\n",
|
||||
"mips_o32_push_dummy_call: "
|
||||
"struct_return reg=%d %s\n",
|
||||
argreg, paddress (gdbarch, struct_addr));
|
||||
regcache_cooked_write_unsigned (regcache, argreg++, struct_addr);
|
||||
stack_offset += MIPS32_REGSIZE;
|
||||
@ -3833,7 +3842,8 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||
if (mips_debug)
|
||||
fprintf_unfiltered (gdb_stdlog, " - fpreg=%d val=%s",
|
||||
float_argreg, phex (regval, 4));
|
||||
regcache_cooked_write_unsigned (regcache, float_argreg++, regval);
|
||||
regcache_cooked_write_unsigned (regcache,
|
||||
float_argreg++, regval);
|
||||
if (mips_debug)
|
||||
fprintf_unfiltered (gdb_stdlog, " - reg=%d val=%s",
|
||||
argreg, phex (regval, 4));
|
||||
@ -3845,7 +3855,8 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||
if (mips_debug)
|
||||
fprintf_unfiltered (gdb_stdlog, " - fpreg=%d val=%s",
|
||||
float_argreg, phex (regval, 4));
|
||||
regcache_cooked_write_unsigned (regcache, float_argreg++, regval);
|
||||
regcache_cooked_write_unsigned (regcache,
|
||||
float_argreg++, regval);
|
||||
|
||||
if (mips_debug)
|
||||
fprintf_unfiltered (gdb_stdlog, " - reg=%d val=%s",
|
||||
@ -3862,7 +3873,8 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||
if (mips_debug)
|
||||
fprintf_unfiltered (gdb_stdlog, " - fpreg=%d val=%s",
|
||||
float_argreg, phex (regval, len));
|
||||
regcache_cooked_write_unsigned (regcache, float_argreg++, regval);
|
||||
regcache_cooked_write_unsigned (regcache,
|
||||
float_argreg++, regval);
|
||||
/* Although two FP registers are reserved for each
|
||||
argument, only one corresponding integer register is
|
||||
reserved. */
|
||||
@ -3911,7 +3923,7 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||
|| odd_sized_struct)
|
||||
{
|
||||
/* Should shorter than int integer values be
|
||||
promoted to int before being stored? */
|
||||
promoted to int before being stored? */
|
||||
int longword_offset = 0;
|
||||
CORE_ADDR addr;
|
||||
stack_used_p = 1;
|
||||
@ -4234,7 +4246,8 @@ mips_o64_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||
{
|
||||
if (mips_debug)
|
||||
fprintf_unfiltered (gdb_stdlog,
|
||||
"mips_o64_push_dummy_call: struct_return reg=%d %s\n",
|
||||
"mips_o64_push_dummy_call: "
|
||||
"struct_return reg=%d %s\n",
|
||||
argreg, paddress (gdbarch, struct_addr));
|
||||
regcache_cooked_write_unsigned (regcache, argreg++, struct_addr);
|
||||
stack_offset += MIPS64_REGSIZE;
|
||||
@ -4326,7 +4339,7 @@ mips_o64_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||
|| odd_sized_struct)
|
||||
{
|
||||
/* Should shorter than int integer values be
|
||||
promoted to int before being stored? */
|
||||
promoted to int before being stored? */
|
||||
int longword_offset = 0;
|
||||
CORE_ADDR addr;
|
||||
stack_used_p = 1;
|
||||
@ -4381,7 +4394,7 @@ mips_o64_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||
big endian targets.
|
||||
|
||||
It does not seem to be necessary to do the
|
||||
same for integral types. */
|
||||
same for integral types. */
|
||||
|
||||
if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG
|
||||
&& partial_len < MIPS64_REGSIZE
|
||||
@ -4454,7 +4467,7 @@ mips_o64_return_value (struct gdbarch *gdbarch, struct type *func_type,
|
||||
else
|
||||
{
|
||||
/* A scalar extract each part but least-significant-byte
|
||||
justified. */
|
||||
justified. */
|
||||
int offset;
|
||||
int regnum;
|
||||
for (offset = 0, regnum = MIPS_V0_REGNUM;
|
||||
@ -4501,7 +4514,7 @@ mips_o64_return_value (struct gdbarch *gdbarch, struct type *func_type,
|
||||
|
||||
Note that this code only deals with "live" registers at the top of the
|
||||
stack. We will attempt to deal with saved registers later, when
|
||||
the raw/cooked register interface is in place. (We need a general
|
||||
the raw/cooked register interface is in place. (We need a general
|
||||
interface that can deal with dynamic saved register sizes -- fp
|
||||
regs could be 32 bits wide in one frame and 64 on the frame above
|
||||
and below). */
|
||||
@ -4585,13 +4598,14 @@ mips_read_fp_register_double (struct frame_info *frame, int regno,
|
||||
static void
|
||||
mips_print_fp_register (struct ui_file *file, struct frame_info *frame,
|
||||
int regnum)
|
||||
{ /* do values for FP (float) regs */
|
||||
{ /* Do values for FP (float) regs. */
|
||||
struct gdbarch *gdbarch = get_frame_arch (frame);
|
||||
gdb_byte *raw_buffer;
|
||||
double doub, flt1; /* doubles extracted from raw hex data */
|
||||
double doub, flt1; /* Doubles extracted from raw hex data. */
|
||||
int inv1, inv2;
|
||||
|
||||
raw_buffer = alloca (2 * register_size (gdbarch, mips_regnum (gdbarch)->fp0));
|
||||
raw_buffer = alloca (2 * register_size (gdbarch,
|
||||
mips_regnum (gdbarch)->fp0));
|
||||
|
||||
fprintf_filtered (file, "%s:", gdbarch_register_name (gdbarch, regnum));
|
||||
fprintf_filtered (file, "%*s",
|
||||
@ -4605,7 +4619,8 @@ mips_print_fp_register (struct ui_file *file, struct frame_info *frame,
|
||||
/* 4-byte registers: Print hex and floating. Also print even
|
||||
numbered registers as doubles. */
|
||||
mips_read_fp_register_single (frame, regnum, raw_buffer);
|
||||
flt1 = unpack_double (builtin_type (gdbarch)->builtin_float, raw_buffer, &inv1);
|
||||
flt1 = unpack_double (builtin_type (gdbarch)->builtin_float,
|
||||
raw_buffer, &inv1);
|
||||
|
||||
get_formatted_print_options (&opts, 'x');
|
||||
print_scalar_formatted (raw_buffer,
|
||||
@ -4723,20 +4738,21 @@ print_fp_register_row (struct ui_file *file, struct frame_info *frame,
|
||||
}
|
||||
|
||||
|
||||
/* Print a row's worth of GP (int) registers, with name labels above */
|
||||
/* Print a row's worth of GP (int) registers, with name labels above. */
|
||||
|
||||
static int
|
||||
print_gp_register_row (struct ui_file *file, struct frame_info *frame,
|
||||
int start_regnum)
|
||||
{
|
||||
struct gdbarch *gdbarch = get_frame_arch (frame);
|
||||
/* do values for GP (int) regs */
|
||||
/* Do values for GP (int) regs. */
|
||||
gdb_byte raw_buffer[MAX_REGISTER_SIZE];
|
||||
int ncols = (mips_abi_regsize (gdbarch) == 8 ? 4 : 8); /* display cols per row */
|
||||
int ncols = (mips_abi_regsize (gdbarch) == 8 ? 4 : 8); /* display cols
|
||||
per row. */
|
||||
int col, byte;
|
||||
int regnum;
|
||||
|
||||
/* For GP registers, we print a separate row of names above the vals */
|
||||
/* For GP registers, we print a separate row of names above the vals. */
|
||||
for (col = 0, regnum = start_regnum;
|
||||
col < ncols && regnum < gdbarch_num_regs (gdbarch)
|
||||
+ gdbarch_num_pseudo_regs (gdbarch);
|
||||
@ -4746,7 +4762,7 @@ print_gp_register_row (struct ui_file *file, struct frame_info *frame,
|
||||
continue; /* unused register */
|
||||
if (TYPE_CODE (register_type (gdbarch, regnum)) ==
|
||||
TYPE_CODE_FLT)
|
||||
break; /* end the row: reached FP register */
|
||||
break; /* End the row: reached FP register. */
|
||||
/* Large registers are handled separately. */
|
||||
if (register_size (gdbarch, regnum) > mips_abi_regsize (gdbarch))
|
||||
{
|
||||
@ -4769,14 +4785,14 @@ print_gp_register_row (struct ui_file *file, struct frame_info *frame,
|
||||
if (col == 0)
|
||||
return regnum;
|
||||
|
||||
/* print the R0 to R31 names */
|
||||
/* Print the R0 to R31 names. */
|
||||
if ((start_regnum % gdbarch_num_regs (gdbarch)) < MIPS_NUMREGS)
|
||||
fprintf_filtered (file, "\n R%-4d",
|
||||
start_regnum % gdbarch_num_regs (gdbarch));
|
||||
else
|
||||
fprintf_filtered (file, "\n ");
|
||||
|
||||
/* now print the values in hex, 4 or 8 to the row */
|
||||
/* Now print the values in hex, 4 or 8 to the row. */
|
||||
for (col = 0, regnum = start_regnum;
|
||||
col < ncols && regnum < gdbarch_num_regs (gdbarch)
|
||||
+ gdbarch_num_pseudo_regs (gdbarch);
|
||||
@ -4786,7 +4802,7 @@ print_gp_register_row (struct ui_file *file, struct frame_info *frame,
|
||||
continue; /* unused register */
|
||||
if (TYPE_CODE (register_type (gdbarch, regnum)) ==
|
||||
TYPE_CODE_FLT)
|
||||
break; /* end row: reached FP register */
|
||||
break; /* End row: reached FP register. */
|
||||
if (register_size (gdbarch, regnum) > mips_abi_regsize (gdbarch))
|
||||
break; /* End row: large register. */
|
||||
|
||||
@ -4799,7 +4815,7 @@ print_gp_register_row (struct ui_file *file, struct frame_info *frame,
|
||||
byte < (mips_abi_regsize (gdbarch)
|
||||
- register_size (gdbarch, regnum)); byte++)
|
||||
printf_filtered (" ");
|
||||
/* Now print the register value in hex, endian order. */
|
||||
/* Now print the register value in hex, endian order. */
|
||||
if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG)
|
||||
for (byte =
|
||||
register_size (gdbarch, regnum) - register_size (gdbarch, regnum);
|
||||
@ -4812,19 +4828,19 @@ print_gp_register_row (struct ui_file *file, struct frame_info *frame,
|
||||
fprintf_filtered (file, " ");
|
||||
col++;
|
||||
}
|
||||
if (col > 0) /* ie. if we actually printed anything... */
|
||||
if (col > 0) /* ie. if we actually printed anything... */
|
||||
fprintf_filtered (file, "\n");
|
||||
|
||||
return regnum;
|
||||
}
|
||||
|
||||
/* MIPS_DO_REGISTERS_INFO(): called by "info register" command */
|
||||
/* MIPS_DO_REGISTERS_INFO(): called by "info register" command. */
|
||||
|
||||
static void
|
||||
mips_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file,
|
||||
struct frame_info *frame, int regnum, int all)
|
||||
{
|
||||
if (regnum != -1) /* do one specified register */
|
||||
if (regnum != -1) /* Do one specified register. */
|
||||
{
|
||||
gdb_assert (regnum >= gdbarch_num_regs (gdbarch));
|
||||
if (*(gdbarch_register_name (gdbarch, regnum)) == '\0')
|
||||
@ -4834,7 +4850,7 @@ mips_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file,
|
||||
fprintf_filtered (file, "\n");
|
||||
}
|
||||
else
|
||||
/* do all (or most) registers */
|
||||
/* Do all (or most) registers. */
|
||||
{
|
||||
regnum = gdbarch_num_regs (gdbarch);
|
||||
while (regnum < gdbarch_num_regs (gdbarch)
|
||||
@ -4843,10 +4859,10 @@ mips_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file,
|
||||
if (TYPE_CODE (register_type (gdbarch, regnum)) ==
|
||||
TYPE_CODE_FLT)
|
||||
{
|
||||
if (all) /* true for "INFO ALL-REGISTERS" command */
|
||||
if (all) /* True for "INFO ALL-REGISTERS" command. */
|
||||
regnum = print_fp_register_row (file, frame, regnum);
|
||||
else
|
||||
regnum += MIPS_NUMREGS; /* skip floating point regs */
|
||||
regnum += MIPS_NUMREGS; /* Skip floating point regs. */
|
||||
}
|
||||
else
|
||||
regnum = print_gp_register_row (file, frame, regnum);
|
||||
@ -5023,7 +5039,7 @@ mips_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR pc)
|
||||
return mips32_in_function_epilogue_p (gdbarch, pc);
|
||||
}
|
||||
|
||||
/* Root of all "set mips "/"show mips " commands. This will eventually be
|
||||
/* Root of all "set mips "/"show mips " commands. This will eventually be
|
||||
used for all MIPS-specific commands. */
|
||||
|
||||
static void
|
||||
@ -5070,9 +5086,9 @@ show_mipsfpu_command (char *args, int from_tty)
|
||||
internal_error (__FILE__, __LINE__, _("bad switch"));
|
||||
}
|
||||
if (mips_fpu_type_auto)
|
||||
printf_unfiltered
|
||||
("The MIPS floating-point coprocessor is set automatically (currently %s)\n",
|
||||
fpu);
|
||||
printf_unfiltered ("The MIPS floating-point coprocessor "
|
||||
"is set automatically (currently %s)\n",
|
||||
fpu);
|
||||
else
|
||||
printf_unfiltered
|
||||
("The MIPS floating-point coprocessor is assumed to be %s\n", fpu);
|
||||
@ -5082,8 +5098,8 @@ show_mipsfpu_command (char *args, int from_tty)
|
||||
static void
|
||||
set_mipsfpu_command (char *args, int from_tty)
|
||||
{
|
||||
printf_unfiltered
|
||||
("\"set mipsfpu\" must be followed by \"double\", \"single\",\"none\" or \"auto\".\n");
|
||||
printf_unfiltered ("\"set mipsfpu\" must be followed by \"double\", "
|
||||
"\"single\",\"none\" or \"auto\".\n");
|
||||
show_mipsfpu_command (args, from_tty);
|
||||
}
|
||||
|
||||
@ -5215,15 +5231,16 @@ gdb_print_insn_mips_n64 (bfd_vma memaddr, struct disassemble_info *info)
|
||||
return gdb_print_insn_mips (memaddr, info);
|
||||
}
|
||||
|
||||
/* This function implements gdbarch_breakpoint_from_pc. It uses the program
|
||||
counter value to determine whether a 16- or 32-bit breakpoint should be used.
|
||||
It returns a pointer to a string of bytes that encode a breakpoint
|
||||
instruction, stores the length of the string to *lenptr, and adjusts pc (if
|
||||
necessary) to point to the actual memory location where the breakpoint
|
||||
should be inserted. */
|
||||
/* This function implements gdbarch_breakpoint_from_pc. It uses the
|
||||
program counter value to determine whether a 16- or 32-bit breakpoint
|
||||
should be used. It returns a pointer to a string of bytes that encode a
|
||||
breakpoint instruction, stores the length of the string to *lenptr, and
|
||||
adjusts pc (if necessary) to point to the actual memory location where
|
||||
the breakpoint should be inserted. */
|
||||
|
||||
static const gdb_byte *
|
||||
mips_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
|
||||
mips_breakpoint_from_pc (struct gdbarch *gdbarch,
|
||||
CORE_ADDR *pcptr, int *lenptr)
|
||||
{
|
||||
if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG)
|
||||
{
|
||||
@ -5243,7 +5260,7 @@ mips_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
|
||||
static gdb_byte pmon_big_breakpoint[] = { 0, 0, 0, 0xd };
|
||||
static gdb_byte idt_big_breakpoint[] = { 0, 0, 0x0a, 0xd };
|
||||
/* Likewise, IRIX appears to expect a different breakpoint,
|
||||
although this is not apparent until you try to use pthreads. */
|
||||
although this is not apparent until you try to use pthreads. */
|
||||
static gdb_byte irix_big_breakpoint[] = { 0, 0, 0, 0xd };
|
||||
|
||||
*lenptr = sizeof (big_breakpoint);
|
||||
@ -5369,9 +5386,9 @@ mips_skip_mips16_trampoline_code (struct frame_info *frame, CORE_ADDR pc)
|
||||
{
|
||||
inst = mips_fetch_instruction (gdbarch, target_pc);
|
||||
if ((inst & 0xffff0000) == 0x3c010000) /* lui $at */
|
||||
pc = (inst << 16) & 0xffff0000; /* high word */
|
||||
pc = (inst << 16) & 0xffff0000; /* high word */
|
||||
else if ((inst & 0xffff0000) == 0x24210000) /* addiu $at */
|
||||
return pc | (inst & 0xffff); /* low word */
|
||||
return pc | (inst & 0xffff); /* low word */
|
||||
}
|
||||
|
||||
/* Couldn't find the lui/addui pair, so return stub address. */
|
||||
@ -5519,7 +5536,8 @@ mips_register_sim_regno (struct gdbarch *gdbarch, int regnum)
|
||||
if (gdbarch_register_name (gdbarch,
|
||||
gdbarch_num_regs (gdbarch) + regnum) != NULL
|
||||
&& gdbarch_register_name (gdbarch,
|
||||
gdbarch_num_regs (gdbarch) + regnum)[0] != '\0')
|
||||
gdbarch_num_regs (gdbarch)
|
||||
+ regnum)[0] != '\0')
|
||||
return regnum;
|
||||
else
|
||||
return LEGACY_SIM_REGNO_IGNORE;
|
||||
@ -5842,7 +5860,8 @@ mips_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
|
||||
/* Also used when doing an architecture lookup. */
|
||||
if (gdbarch_debug)
|
||||
fprintf_unfiltered (gdb_stdlog,
|
||||
"mips_gdbarch_init: mips64_transfers_32bit_regs_p = %d\n",
|
||||
"mips_gdbarch_init: "
|
||||
"mips64_transfers_32bit_regs_p = %d\n",
|
||||
mips64_transfers_32bit_regs_p);
|
||||
|
||||
/* Determine the MIPS FPU type. */
|
||||
@ -5911,7 +5930,7 @@ mips_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* try to find a pre-existing architecture */
|
||||
/* Try to find a pre-existing architecture. */
|
||||
for (arches = gdbarch_list_lookup_by_info (arches, &info);
|
||||
arches != NULL;
|
||||
arches = gdbarch_list_lookup_by_info (arches->next, &info))
|
||||
@ -6139,8 +6158,7 @@ mips_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
|
||||
|
||||
Note that for o32 and eabi32, pointers are always 32 bits
|
||||
regardless of any -mlongXX option. For all others, pointers and
|
||||
longs are the same, as set by -mlongXX or set by defaults.
|
||||
*/
|
||||
longs are the same, as set by -mlongXX or set by defaults. */
|
||||
|
||||
if (info.abfd != NULL)
|
||||
{
|
||||
@ -6208,7 +6226,7 @@ mips_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
|
||||
mips_dwarf_dwarf2_ecoff_reg_to_regnum);
|
||||
set_gdbarch_register_sim_regno (gdbarch, mips_register_sim_regno);
|
||||
|
||||
/* MIPS version of CALL_DUMMY */
|
||||
/* MIPS version of CALL_DUMMY. */
|
||||
|
||||
/* NOTE: cagney/2003-08-05: Eventually call dummy location will be
|
||||
replaced by a command, and all targets will default to on stack
|
||||
@ -6252,7 +6270,8 @@ mips_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
|
||||
|
||||
set_gdbarch_skip_trampoline_code (gdbarch, mips_skip_trampoline_code);
|
||||
|
||||
set_gdbarch_single_step_through_delay (gdbarch, mips_single_step_through_delay);
|
||||
set_gdbarch_single_step_through_delay (gdbarch,
|
||||
mips_single_step_through_delay);
|
||||
|
||||
/* Virtual tables. */
|
||||
set_gdbarch_vbit_in_delta (gdbarch, 1);
|
||||
@ -6281,7 +6300,8 @@ mips_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
|
||||
/* Override the normal target description methods to handle our
|
||||
dual real and pseudo registers. */
|
||||
set_gdbarch_register_name (gdbarch, mips_register_name);
|
||||
set_gdbarch_register_reggroup_p (gdbarch, mips_tdesc_register_reggroup_p);
|
||||
set_gdbarch_register_reggroup_p (gdbarch,
|
||||
mips_tdesc_register_reggroup_p);
|
||||
|
||||
num_regs = gdbarch_num_regs (gdbarch);
|
||||
set_gdbarch_num_pseudo_regs (gdbarch, num_regs);
|
||||
@ -6355,9 +6375,9 @@ show_mips_abi (struct ui_file *file,
|
||||
else
|
||||
{
|
||||
/* Probably shouldn't happen... */
|
||||
fprintf_filtered
|
||||
(file,
|
||||
"The (auto detected) MIPS ABI \"%s\" is in use even though the user setting was \"%s\".\n",
|
||||
fprintf_filtered (file,
|
||||
"The (auto detected) MIPS ABI \"%s\" is in use "
|
||||
"even though the user setting was \"%s\".\n",
|
||||
actual_abi_str, mips_abi_strings[global_abi]);
|
||||
}
|
||||
}
|
||||
@ -6405,7 +6425,8 @@ mips_dump_tdep (struct gdbarch *gdbarch, struct ui_file *file)
|
||||
"mips_dump_tdep: tdep->mips_abi = %d (%s)\n",
|
||||
tdep->mips_abi, mips_abi_strings[tdep->mips_abi]);
|
||||
fprintf_unfiltered (file,
|
||||
"mips_dump_tdep: mips_mask_address_p() %d (default %d)\n",
|
||||
"mips_dump_tdep: "
|
||||
"mips_mask_address_p() %d (default %d)\n",
|
||||
mips_mask_address_p (tdep),
|
||||
tdep->default_mask_address_p);
|
||||
}
|
||||
@ -6427,7 +6448,7 @@ mips_dump_tdep (struct gdbarch *gdbarch, struct ui_file *file)
|
||||
: "???"));
|
||||
}
|
||||
|
||||
extern initialize_file_ftype _initialize_mips_tdep; /* -Wmissing-prototypes */
|
||||
extern initialize_file_ftype _initialize_mips_tdep; /* -Wmissing-prototypes */
|
||||
|
||||
void
|
||||
_initialize_mips_tdep (void)
|
||||
@ -6452,7 +6473,7 @@ _initialize_mips_tdep (void)
|
||||
mips_tdesc_gp64 = allocate_target_description ();
|
||||
set_tdesc_property (mips_tdesc_gp64, PROPERTY_GP64, "");
|
||||
|
||||
/* Add root prefix command for all "set mips"/"show mips" commands */
|
||||
/* Add root prefix command for all "set mips"/"show mips" commands. */
|
||||
add_prefix_cmd ("mips", no_class, set_mips_command,
|
||||
_("Various MIPS specific commands."),
|
||||
&setmipscmdlist, "set mips ", 0, &setlist);
|
||||
@ -6461,7 +6482,7 @@ _initialize_mips_tdep (void)
|
||||
_("Various MIPS specific commands."),
|
||||
&showmipscmdlist, "show mips ", 0, &showlist);
|
||||
|
||||
/* Allow the user to override the ABI. */
|
||||
/* Allow the user to override the ABI. */
|
||||
add_setshow_enum_cmd ("abi", class_obscure, mips_abi_strings,
|
||||
&mips_abi_string, _("\
|
||||
Set the MIPS ABI used by this program."), _("\
|
||||
@ -6516,7 +6537,8 @@ If you are debugging a stripped executable, GDB needs to search through the\n\
|
||||
program for the start of a function. This command sets the distance of the\n\
|
||||
search. The only need to set it is when debugging a stripped executable."),
|
||||
reinit_frame_cache_sfunc,
|
||||
NULL, /* FIXME: i18n: The distance searched for the start of a function is %s. */
|
||||
NULL, /* FIXME: i18n: The distance searched for
|
||||
the start of a function is %s. */
|
||||
&setlist, &showlist);
|
||||
|
||||
/* Allow the user to control whether the upper bits of 64-bit
|
||||
@ -6542,16 +6564,19 @@ Use \"on\" to enable backward compatibility with older MIPS 64 GDB+target\n\
|
||||
that would transfer 32 bits for some registers (e.g. SR, FSR) and\n\
|
||||
64 bits for others. Use \"off\" to disable compatibility mode"),
|
||||
set_mips64_transfers_32bit_regs,
|
||||
NULL, /* FIXME: i18n: Compatibility with 64-bit MIPS target that transfers 32-bit quantities is %s. */
|
||||
NULL, /* FIXME: i18n: Compatibility with 64-bit
|
||||
MIPS target that transfers 32-bit
|
||||
quantities is %s. */
|
||||
&setlist, &showlist);
|
||||
|
||||
/* Debug this files internals. */
|
||||
/* Debug this files internals. */
|
||||
add_setshow_zinteger_cmd ("mips", class_maintenance,
|
||||
&mips_debug, _("\
|
||||
Set mips debugging."), _("\
|
||||
Show mips debugging."), _("\
|
||||
When non-zero, mips specific debugging is enabled."),
|
||||
NULL,
|
||||
NULL, /* FIXME: i18n: Mips debugging is currently %s. */
|
||||
NULL, /* FIXME: i18n: Mips debugging is
|
||||
currently %s. */
|
||||
&setdebuglist, &showdebuglist);
|
||||
}
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
struct gdbarch;
|
||||
|
||||
/* All the possible MIPS ABIs. */
|
||||
/* All the possible MIPS ABIs. */
|
||||
enum mips_abi
|
||||
{
|
||||
MIPS_ABI_UNKNOWN = 0,
|
||||
@ -67,7 +67,7 @@ enum mips_fpu_type
|
||||
MIPS_FPU_NONE /* No floating point. */
|
||||
};
|
||||
|
||||
/* MIPS specific per-architecture information */
|
||||
/* MIPS specific per-architecture information. */
|
||||
struct gdbarch_tdep
|
||||
{
|
||||
/* from the elf header */
|
||||
@ -117,7 +117,7 @@ enum
|
||||
MIPS_ZERO_REGNUM = 0, /* Read-only register, always 0. */
|
||||
MIPS_AT_REGNUM = 1,
|
||||
MIPS_V0_REGNUM = 2, /* Function integer return value. */
|
||||
MIPS_A0_REGNUM = 4, /* Loc of first arg during a subr call */
|
||||
MIPS_A0_REGNUM = 4, /* Loc of first arg during a subr call. */
|
||||
MIPS_T9_REGNUM = 25, /* Contains address of callee in PIC. */
|
||||
MIPS_SP_REGNUM = 29,
|
||||
MIPS_RA_REGNUM = 31,
|
||||
@ -128,13 +128,13 @@ enum
|
||||
MIPS_EMBED_CAUSE_REGNUM = 36,
|
||||
MIPS_EMBED_PC_REGNUM = 37,
|
||||
MIPS_EMBED_FP0_REGNUM = 38,
|
||||
MIPS_UNUSED_REGNUM = 73, /* Never used, FIXME */
|
||||
MIPS_UNUSED_REGNUM = 73, /* Never used, FIXME. */
|
||||
MIPS_FIRST_EMBED_REGNUM = 74, /* First CP0 register for embedded use. */
|
||||
MIPS_PRID_REGNUM = 89, /* Processor ID. */
|
||||
MIPS_LAST_EMBED_REGNUM = 89 /* Last one. */
|
||||
};
|
||||
|
||||
/* Defined in mips-tdep.c and used in remote-mips.c */
|
||||
/* Defined in mips-tdep.c and used in remote-mips.c. */
|
||||
extern void deprecated_mips_set_processor_regs_hack (void);
|
||||
|
||||
/* Instruction sizes and other useful constants. */
|
||||
@ -153,7 +153,7 @@ extern int mips_software_single_step (struct frame_info *frame);
|
||||
function. */
|
||||
extern int mips_pc_is_mips16 (bfd_vma memaddr);
|
||||
|
||||
/* Return the currently configured (or set) saved register size. */
|
||||
/* Return the currently configured (or set) saved register size. */
|
||||
extern unsigned int mips_abi_regsize (struct gdbarch *gdbarch);
|
||||
|
||||
/* Target descriptions which only indicate the size of general
|
||||
|
@ -57,7 +57,8 @@ mipsnbsd_fetch_inferior_registers (struct target_ops *ops,
|
||||
return;
|
||||
}
|
||||
|
||||
if (regno == -1 || regno >= gdbarch_fp0_regnum (get_regcache_arch (regcache)))
|
||||
if (regno == -1
|
||||
|| regno >= gdbarch_fp0_regnum (get_regcache_arch (regcache)))
|
||||
{
|
||||
struct fpreg fpregs;
|
||||
|
||||
@ -92,7 +93,8 @@ mipsnbsd_store_inferior_registers (struct target_ops *ops,
|
||||
return;
|
||||
}
|
||||
|
||||
if (regno == -1 || regno >= gdbarch_fp0_regnum (get_regcache_arch (regcache)))
|
||||
if (regno == -1
|
||||
|| regno >= gdbarch_fp0_regnum (get_regcache_arch (regcache)))
|
||||
{
|
||||
struct fpreg fpregs;
|
||||
|
||||
|
@ -173,7 +173,8 @@ mipsnbsd_fill_reg (const struct regcache *regcache, char *regs, int regno)
|
||||
}
|
||||
|
||||
void
|
||||
mipsnbsd_supply_fpreg (struct regcache *regcache, const char *fpregs, int regno)
|
||||
mipsnbsd_supply_fpreg (struct regcache *regcache,
|
||||
const char *fpregs, int regno)
|
||||
{
|
||||
struct gdbarch *gdbarch = get_regcache_arch (regcache);
|
||||
int i;
|
||||
|
@ -92,7 +92,7 @@ mipscoff_symfile_read (struct objfile *objfile, int symfile_flags)
|
||||
read_alphacoff_dynamic_symtab (objfile->section_offsets, objfile);
|
||||
|
||||
/* Install any minimal symbols that have been collected as the current
|
||||
minimal symbols for this objfile. */
|
||||
minimal symbols for this objfile. */
|
||||
|
||||
install_minimal_symbols (objfile);
|
||||
do_cleanups (back_to);
|
||||
@ -110,7 +110,7 @@ mipscoff_symfile_finish (struct objfile *objfile)
|
||||
standard COFF section. The ELF format for the symbols differs from
|
||||
the format defined in elf/external.h. It seems that a normal ELF
|
||||
32-bit format is used, and the representation only changes because
|
||||
longs are 64-bit on the alpha. In addition, the handling of
|
||||
longs are 64-bit on the alpha. In addition, the handling of
|
||||
text/data section indices for symbols is different from the ELF
|
||||
ABI. As the BFD linker currently does not support dynamic linking
|
||||
on the alpha, there seems to be no reason to pollute BFD with
|
||||
@ -341,7 +341,7 @@ read_alphacoff_dynamic_symtab (struct section_offsets *section_offsets,
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Symbols defined in the executable itself. We only care
|
||||
/* Symbols defined in the executable itself. We only care
|
||||
about them if this is a stripped executable, otherwise
|
||||
they have been retrieved from the normal symbol table
|
||||
already. */
|
||||
@ -393,15 +393,14 @@ read_alphacoff_dynamic_symtab (struct section_offsets *section_offsets,
|
||||
static const struct sym_fns ecoff_sym_fns =
|
||||
{
|
||||
bfd_target_ecoff_flavour,
|
||||
mipscoff_new_init, /* sym_new_init: init anything gbl to entire symtab */
|
||||
mipscoff_symfile_init, /* sym_init: read initial info, setup for sym_read() */
|
||||
mipscoff_symfile_read, /* sym_read: read a symbol file into symtab */
|
||||
mipscoff_symfile_finish, /* sym_finish: finished with file, cleanup */
|
||||
default_symfile_offsets, /* sym_offsets: dummy FIXME til implem sym reloc */
|
||||
default_symfile_segments, /* sym_segments: Get segment information from
|
||||
a file. */
|
||||
NULL, /* sym_read_linetable */
|
||||
default_symfile_relocate, /* sym_relocate: Relocate a debug section. */
|
||||
mipscoff_new_init, /* init anything gbl to entire symtab */
|
||||
mipscoff_symfile_init, /* read initial info, setup for sym_read() */
|
||||
mipscoff_symfile_read, /* read a symbol file into symtab */
|
||||
mipscoff_symfile_finish, /* finished with file, cleanup */
|
||||
default_symfile_offsets, /* dummy FIXME til implem sym reloc */
|
||||
default_symfile_segments, /* Get segment information from a file. */
|
||||
NULL,
|
||||
default_symfile_relocate, /* Relocate a debug section. */
|
||||
&psym_functions
|
||||
};
|
||||
|
||||
|
@ -83,7 +83,7 @@ typedef struct
|
||||
Given a section name and size, create a struct reg object
|
||||
with a supply_register and a collect_register method. */
|
||||
|
||||
/* Copy register value of REGNUM from regset to regcache.
|
||||
/* Copy register value of REGNUM from regset to regcache.
|
||||
If REGNUM is -1, do this for all gp registers in regset. */
|
||||
|
||||
static void
|
||||
@ -240,8 +240,8 @@ am33_supply_gregset_method (const struct regset *regset,
|
||||
return;
|
||||
}
|
||||
|
||||
/* Copy fp register value of REGNUM from regset to regcache.
|
||||
If REGNUM is -1, do this for all fp registers in regset. */
|
||||
/* Copy fp register value of REGNUM from regset to regcache.
|
||||
If REGNUM is -1, do this for all fp registers in regset. */
|
||||
|
||||
static void
|
||||
am33_supply_fpregset_method (const struct regset *regset,
|
||||
@ -265,7 +265,8 @@ am33_supply_fpregset_method (const struct regset *regset,
|
||||
else if (regnum == E_FPCR_REGNUM)
|
||||
regcache_raw_supply (regcache, E_FPCR_REGNUM,
|
||||
&fpregset->fpcr);
|
||||
else if (E_FS0_REGNUM <= regnum && regnum < E_FS0_REGNUM + MN10300_ELF_NFPREG)
|
||||
else if (E_FS0_REGNUM <= regnum
|
||||
&& regnum < E_FS0_REGNUM + MN10300_ELF_NFPREG)
|
||||
regcache_raw_supply (regcache, regnum,
|
||||
&fpregset->fpregs[regnum - E_FS0_REGNUM]);
|
||||
|
||||
@ -692,7 +693,8 @@ am33_linux_sigframe_cache_init (const struct tramp_frame *self,
|
||||
sc_base + AM33_SIGCONTEXT_PC);
|
||||
|
||||
fpubase = get_frame_memory_unsigned (this_frame,
|
||||
sc_base + AM33_SIGCONTEXT_FPUCONTEXT, 4);
|
||||
sc_base + AM33_SIGCONTEXT_FPUCONTEXT,
|
||||
4);
|
||||
if (fpubase)
|
||||
{
|
||||
for (i = 0; i < 32; i++)
|
||||
|
@ -25,7 +25,7 @@
|
||||
#include "regcache.h"
|
||||
#include "gdb_string.h"
|
||||
#include "gdb_assert.h"
|
||||
#include "gdbcore.h" /* for write_memory_unsigned_integer */
|
||||
#include "gdbcore.h" /* For write_memory_unsigned_integer. */
|
||||
#include "value.h"
|
||||
#include "gdbtypes.h"
|
||||
#include "frame.h"
|
||||
@ -1142,7 +1142,8 @@ mn10300_frame_this_id (struct frame_info *this_frame,
|
||||
void **this_prologue_cache,
|
||||
struct frame_id *this_id)
|
||||
{
|
||||
*this_id = frame_id_build (mn10300_frame_base (this_frame, this_prologue_cache),
|
||||
*this_id = frame_id_build (mn10300_frame_base (this_frame,
|
||||
this_prologue_cache),
|
||||
get_frame_func (this_frame));
|
||||
|
||||
}
|
||||
@ -1263,7 +1264,7 @@ mn10300_push_dummy_call (struct gdbarch *gdbarch,
|
||||
else
|
||||
regs_used = 0;
|
||||
|
||||
/* Push all arguments onto the stack. */
|
||||
/* Push all arguments onto the stack. */
|
||||
for (argnum = 0; argnum < nargs; argnum++)
|
||||
{
|
||||
/* FIXME what about structs? Unions? */
|
||||
@ -1332,7 +1333,7 @@ mn10300_push_dummy_call (struct gdbarch *gdbarch,
|
||||
Note that we don't update the return value though because that's
|
||||
the value of the stack just after pushing the arguments, but prior
|
||||
to performing the call. This value is needed in order to
|
||||
construct the frame ID of the dummy call. */
|
||||
construct the frame ID of the dummy call. */
|
||||
{
|
||||
CORE_ADDR func_addr = find_function_addr (target_func, NULL);
|
||||
CORE_ADDR unwound_sp
|
||||
@ -1436,7 +1437,7 @@ mn10300_gdbarch_init (struct gdbarch_info info,
|
||||
set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
|
||||
/* Breakpoints. */
|
||||
set_gdbarch_breakpoint_from_pc (gdbarch, mn10300_breakpoint_from_pc);
|
||||
/* decr_pc_after_break? */
|
||||
/* decr_pc_after_break? */
|
||||
/* Disassembly. */
|
||||
set_gdbarch_print_insn (gdbarch, print_insn_mn10300);
|
||||
|
||||
@ -1456,7 +1457,7 @@ mn10300_gdbarch_init (struct gdbarch_info info,
|
||||
return gdbarch;
|
||||
}
|
||||
|
||||
/* Dump out the mn10300 specific architecture information. */
|
||||
/* Dump out the mn10300 specific architecture information. */
|
||||
|
||||
static void
|
||||
mn10300_dump_tdep (struct gdbarch *gdbarch, struct ui_file *file)
|
||||
|
@ -63,7 +63,7 @@ enum movm_register_bits {
|
||||
movm_d2_bit = 0x80
|
||||
};
|
||||
|
||||
/* Values for frame_info.status */
|
||||
/* Values for frame_info.status. */
|
||||
|
||||
enum frame_kind {
|
||||
MY_FRAME_IN_SP = 0x1,
|
||||
@ -71,7 +71,7 @@ enum frame_kind {
|
||||
NO_MORE_FRAMES = 0x4
|
||||
};
|
||||
|
||||
/* mn10300 private data */
|
||||
/* mn10300 private data. */
|
||||
struct gdbarch_tdep
|
||||
{
|
||||
int am33_mode;
|
||||
|
202
gdb/monitor.c
202
gdb/monitor.c
@ -22,9 +22,9 @@
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* This file was derived from various remote-* modules. It is a collection
|
||||
/* This file was derived from various remote-* modules. It is a collection
|
||||
of generic support functions so GDB can talk directly to a ROM based
|
||||
monitor. This saves use from having to hack an exception based handler
|
||||
monitor. This saves use from having to hack an exception based handler
|
||||
into existence, and makes for quick porting.
|
||||
|
||||
This module talks to a debug monitor called 'MONITOR', which
|
||||
@ -71,13 +71,13 @@ static int from_hex (int a);
|
||||
|
||||
static struct monitor_ops *current_monitor;
|
||||
|
||||
static int hashmark; /* flag set by "set hash" */
|
||||
static int hashmark; /* flag set by "set hash". */
|
||||
|
||||
static int timeout = 30;
|
||||
|
||||
static int in_monitor_wait = 0; /* Non-zero means we are in monitor_wait() */
|
||||
static int in_monitor_wait = 0; /* Non-zero means we are in monitor_wait(). */
|
||||
|
||||
static void (*ofunc) (); /* Old SIGINT signal handler */
|
||||
static void (*ofunc) (); /* Old SIGINT signal handler. */
|
||||
|
||||
static CORE_ADDR *breakaddr;
|
||||
|
||||
@ -87,7 +87,7 @@ static CORE_ADDR *breakaddr;
|
||||
|
||||
static struct serial *monitor_desc = NULL;
|
||||
|
||||
/* Pointer to regexp pattern matching data */
|
||||
/* Pointer to regexp pattern matching data. */
|
||||
|
||||
static struct re_pattern_buffer register_pattern;
|
||||
static char register_fastmap[256];
|
||||
@ -106,7 +106,7 @@ static int dump_reg_flag; /* Non-zero means do a dump_registers cmd when
|
||||
|
||||
static int first_time = 0; /* Is this the first time we're
|
||||
executing after gaving created the
|
||||
child proccess? */
|
||||
child proccess? */
|
||||
|
||||
|
||||
/* This is the ptid we use while we're connected to a monitor. Its
|
||||
@ -118,7 +118,7 @@ static ptid_t monitor_ptid;
|
||||
#define TARGET_BUF_SIZE 2048
|
||||
|
||||
/* Monitor specific debugging information. Typically only useful to
|
||||
the developer of a new monitor interface. */
|
||||
the developer of a new monitor interface. */
|
||||
|
||||
static void monitor_debug (const char *fmt, ...) ATTRIBUTE_PRINTF (1, 2);
|
||||
|
||||
@ -126,7 +126,7 @@ static int monitor_debug_p = 0;
|
||||
|
||||
/* NOTE: This file alternates between monitor_debug_p and remote_debug
|
||||
when determining if debug information is printed. Perhaps this
|
||||
could be simplified. */
|
||||
could be simplified. */
|
||||
|
||||
static void
|
||||
monitor_debug (const char *fmt, ...)
|
||||
@ -144,7 +144,7 @@ monitor_debug (const char *fmt, ...)
|
||||
|
||||
/* Convert a string into a printable representation, Return # byte in
|
||||
the new string. When LEN is >0 it specifies the size of the
|
||||
string. Otherwize strlen(oldstr) is used. */
|
||||
string. Otherwize strlen(oldstr) is used. */
|
||||
|
||||
static void
|
||||
monitor_printable_string (char *newstr, char *oldstr, int len)
|
||||
@ -253,8 +253,7 @@ fromhex (int a)
|
||||
If it is a '%s' format, the argument is a string; otherwise the
|
||||
argument is assumed to be a long integer.
|
||||
|
||||
%% is also turned into a single %.
|
||||
*/
|
||||
%% is also turned into a single %. */
|
||||
|
||||
static void
|
||||
monitor_vsprintf (char *sndbuf, char *pattern, va_list args)
|
||||
@ -441,7 +440,7 @@ readchar (int timeout)
|
||||
{
|
||||
c &= 0x7f;
|
||||
/* This seems to interfere with proper function of the
|
||||
input stream */
|
||||
input stream. */
|
||||
if (monitor_debug_p || remote_debug)
|
||||
{
|
||||
char buf[2];
|
||||
@ -453,7 +452,7 @@ readchar (int timeout)
|
||||
|
||||
}
|
||||
|
||||
/* Canonicialize \n\r combinations into one \r */
|
||||
/* Canonicialize \n\r combinations into one \r. */
|
||||
if ((current_monitor->flags & MO_HANDLE_NL) != 0)
|
||||
{
|
||||
if ((c == '\r' && state == last_nl)
|
||||
@ -480,8 +479,8 @@ readchar (int timeout)
|
||||
|
||||
if (c == SERIAL_TIMEOUT)
|
||||
#if 0
|
||||
/* I fail to see how detaching here can be useful */
|
||||
if (in_monitor_wait) /* Watchdog went off */
|
||||
/* I fail to see how detaching here can be useful. */
|
||||
if (in_monitor_wait) /* Watchdog went off. */
|
||||
{
|
||||
target_mourn_inferior ();
|
||||
error (_("GDB serial timeout has expired. Target detached."));
|
||||
@ -535,7 +534,7 @@ monitor_expect (char *string, char *buf, int buflen)
|
||||
else
|
||||
c = readchar (timeout);
|
||||
|
||||
/* Don't expect any ^C sent to be echoed */
|
||||
/* Don't expect any ^C sent to be echoed. */
|
||||
|
||||
if (*p == '\003' || c == *p)
|
||||
{
|
||||
@ -575,7 +574,7 @@ monitor_expect (char *string, char *buf, int buflen)
|
||||
p, since we know no prefix can be longer than that.
|
||||
|
||||
Note that we can use STRING itself, along with C, as a record
|
||||
of what we've received so far. :) */
|
||||
of what we've received so far. :) */
|
||||
int i;
|
||||
|
||||
for (i = (p - string) - 1; i >= 0; i--)
|
||||
@ -583,7 +582,7 @@ monitor_expect (char *string, char *buf, int buflen)
|
||||
{
|
||||
/* Is this prefix a suffix of what we've read so far?
|
||||
In other words, does
|
||||
string[0 .. i-1] == string[p - i, p - 1]? */
|
||||
string[0 .. i-1] == string[p - i, p - 1]? */
|
||||
if (! memcmp (string, p - i, i))
|
||||
{
|
||||
p = string + i + 1;
|
||||
@ -619,10 +618,10 @@ monitor_expect_regexp (struct re_pattern_buffer *pat, char *buf, int buflen)
|
||||
int retval;
|
||||
|
||||
if (p - mybuf >= buflen)
|
||||
{ /* Buffer about to overflow */
|
||||
{ /* Buffer about to overflow. */
|
||||
|
||||
/* On overflow, we copy the upper half of the buffer to the lower half. Not
|
||||
great, but it usually works... */
|
||||
great, but it usually works... */
|
||||
|
||||
memcpy (mybuf, mybuf + buflen / 2, buflen / 2);
|
||||
p = mybuf + buflen / 2;
|
||||
@ -709,7 +708,7 @@ compile_pattern (char *pattern, struct re_pattern_buffer *compiled_pattern,
|
||||
re_compile_fastmap (compiled_pattern);
|
||||
}
|
||||
|
||||
/* Open a connection to a remote debugger. NAME is the filename used
|
||||
/* Open a connection to a remote debugger. NAME is the filename used
|
||||
for communication. */
|
||||
|
||||
void
|
||||
@ -731,7 +730,7 @@ monitor_open (char *args, struct monitor_ops *mon_ops, int from_tty)
|
||||
|
||||
target_preopen (from_tty);
|
||||
|
||||
/* Setup pattern for register dump */
|
||||
/* Setup pattern for register dump. */
|
||||
|
||||
if (mon_ops->register_pattern)
|
||||
compile_pattern (mon_ops->register_pattern, ®ister_pattern,
|
||||
@ -773,7 +772,7 @@ monitor_open (char *args, struct monitor_ops *mon_ops, int from_tty)
|
||||
|
||||
serial_flush_input (monitor_desc);
|
||||
|
||||
/* some systems only work with 2 stop bits */
|
||||
/* some systems only work with 2 stop bits. */
|
||||
|
||||
serial_setstopbits (monitor_desc, mon_ops->stopbits);
|
||||
|
||||
@ -792,11 +791,11 @@ monitor_open (char *args, struct monitor_ops *mon_ops, int from_tty)
|
||||
}
|
||||
}
|
||||
|
||||
/* wake up the monitor and see if it's alive */
|
||||
/* wake up the monitor and see if it's alive. */
|
||||
for (p = mon_ops->init; *p != NULL; p++)
|
||||
{
|
||||
/* Some of the characters we send may not be echoed,
|
||||
but we hope to get a prompt at the end of it all. */
|
||||
but we hope to get a prompt at the end of it all. */
|
||||
|
||||
if ((current_monitor->flags & MO_NO_ECHO_ON_OPEN) == 0)
|
||||
monitor_printf (*p);
|
||||
@ -818,7 +817,7 @@ monitor_open (char *args, struct monitor_ops *mon_ops, int from_tty)
|
||||
memset (breakaddr, 0, mon_ops->num_breakpoints * sizeof (CORE_ADDR));
|
||||
}
|
||||
|
||||
/* Remove all breakpoints */
|
||||
/* Remove all breakpoints. */
|
||||
|
||||
if (mon_ops->clr_all_break)
|
||||
{
|
||||
@ -841,7 +840,7 @@ monitor_open (char *args, struct monitor_ops *mon_ops, int from_tty)
|
||||
inferior_appeared (inf, ptid_get_pid (inferior_ptid));
|
||||
add_thread_silent (inferior_ptid);
|
||||
|
||||
/* Give monitor_wait something to read */
|
||||
/* Give monitor_wait something to read. */
|
||||
|
||||
monitor_printf (current_monitor->line_term);
|
||||
|
||||
@ -857,7 +856,7 @@ monitor_close (int quitting)
|
||||
if (monitor_desc)
|
||||
serial_close (monitor_desc);
|
||||
|
||||
/* Free breakpoint memory */
|
||||
/* Free breakpoint memory. */
|
||||
if (breakaddr != NULL)
|
||||
{
|
||||
xfree (breakaddr);
|
||||
@ -876,7 +875,7 @@ monitor_close (int quitting)
|
||||
static void
|
||||
monitor_detach (struct target_ops *ops, char *args, int from_tty)
|
||||
{
|
||||
pop_target (); /* calls monitor_close to do the real work */
|
||||
pop_target (); /* calls monitor_close to do the real work. */
|
||||
if (from_tty)
|
||||
printf_unfiltered (_("Ending remote %s debugging\n"), target_shortname);
|
||||
}
|
||||
@ -921,7 +920,7 @@ monitor_supply_register (struct regcache *regcache, int regno, char *valstr)
|
||||
error (_("monitor_supply_register (%d): bad value from monitor: %s."),
|
||||
regno, valstr);
|
||||
|
||||
/* supply register stores in target byte order, so swap here */
|
||||
/* supply register stores in target byte order, so swap here. */
|
||||
|
||||
store_unsigned_integer (regbuf, register_size (gdbarch, regno), byte_order,
|
||||
val);
|
||||
@ -937,7 +936,7 @@ static void
|
||||
monitor_resume (struct target_ops *ops,
|
||||
ptid_t ptid, int step, enum target_signal sig)
|
||||
{
|
||||
/* Some monitors require a different command when starting a program */
|
||||
/* Some monitors require a different command when starting a program. */
|
||||
monitor_debug ("MON resume\n");
|
||||
if (current_monitor->flags & MO_RUN_FIRST_TIME && first_time == 1)
|
||||
{
|
||||
@ -1072,7 +1071,7 @@ monitor_wait_filter (char *buf,
|
||||
while (resp_len < 0);
|
||||
|
||||
/* Print any output characters that were preceded by ^O. */
|
||||
/* FIXME - This would be great as a user settabgle flag */
|
||||
/* FIXME - This would be great as a user settabgle flag. */
|
||||
if (monitor_debug_p || remote_debug
|
||||
|| current_monitor->flags & MO_PRINT_PROGRAM_OUTPUT)
|
||||
{
|
||||
@ -1105,11 +1104,11 @@ monitor_wait (struct target_ops *ops,
|
||||
monitor_debug ("MON wait\n");
|
||||
|
||||
#if 0
|
||||
/* This is somthing other than a maintenance command */
|
||||
/* This is somthing other than a maintenance command. */
|
||||
in_monitor_wait = 1;
|
||||
timeout = watchdog > 0 ? watchdog : -1;
|
||||
#else
|
||||
timeout = -1; /* Don't time out -- user program is running. */
|
||||
timeout = -1; /* Don't time out -- user program is running. */
|
||||
#endif
|
||||
|
||||
ofunc = (void (*)()) signal (SIGINT, monitor_interrupt);
|
||||
@ -1119,7 +1118,7 @@ monitor_wait (struct target_ops *ops,
|
||||
else
|
||||
monitor_wait_filter (buf, sizeof (buf), &resp_len, status);
|
||||
|
||||
#if 0 /* Transferred to monitor wait filter */
|
||||
#if 0 /* Transferred to monitor wait filter. */
|
||||
do
|
||||
{
|
||||
resp_len = monitor_expect_prompt (buf, sizeof (buf));
|
||||
@ -1132,7 +1131,7 @@ monitor_wait (struct target_ops *ops,
|
||||
while (resp_len < 0);
|
||||
|
||||
/* Print any output characters that were preceded by ^O. */
|
||||
/* FIXME - This would be great as a user settabgle flag */
|
||||
/* FIXME - This would be great as a user settabgle flag. */
|
||||
if (monitor_debug_p || remote_debug
|
||||
|| current_monitor->flags & MO_PRINT_PROGRAM_OUTPUT)
|
||||
{
|
||||
@ -1172,7 +1171,7 @@ monitor_wait (struct target_ops *ops,
|
||||
return inferior_ptid;
|
||||
}
|
||||
|
||||
/* Fetch register REGNO, or all registers if REGNO is -1. Returns
|
||||
/* Fetch register REGNO, or all registers if REGNO is -1. Returns
|
||||
errno value. */
|
||||
|
||||
static void
|
||||
@ -1200,7 +1199,7 @@ monitor_fetch_register (struct regcache *regcache, int regno)
|
||||
return;
|
||||
}
|
||||
|
||||
/* send the register examine command */
|
||||
/* Send the register examine command. */
|
||||
|
||||
monitor_printf (current_monitor->getreg.cmd, name);
|
||||
|
||||
@ -1221,7 +1220,7 @@ monitor_fetch_register (struct regcache *regcache, int regno)
|
||||
}
|
||||
}
|
||||
|
||||
/* Skip leading spaces and "0x" if MO_HEX_PREFIX flag is set */
|
||||
/* Skip leading spaces and "0x" if MO_HEX_PREFIX flag is set. */
|
||||
if (current_monitor->flags & MO_HEX_PREFIX)
|
||||
{
|
||||
int c;
|
||||
@ -1255,7 +1254,7 @@ monitor_fetch_register (struct regcache *regcache, int regno)
|
||||
regbuf[i] = c;
|
||||
}
|
||||
|
||||
regbuf[i] = '\000'; /* terminate the number */
|
||||
regbuf[i] = '\000'; /* Terminate the number. */
|
||||
monitor_debug ("REGVAL '%s'\n", regbuf);
|
||||
|
||||
/* If TERM is present, we wait for that to show up. Also, (if TERM
|
||||
@ -1266,8 +1265,8 @@ monitor_fetch_register (struct regcache *regcache, int regno)
|
||||
if (current_monitor->getreg.term)
|
||||
{
|
||||
monitor_debug ("EXP getreg.term\n");
|
||||
monitor_expect (current_monitor->getreg.term, NULL, 0); /* get
|
||||
response */
|
||||
monitor_expect (current_monitor->getreg.term, NULL, 0); /* Get
|
||||
response. */
|
||||
}
|
||||
|
||||
if (current_monitor->getreg.term_cmd)
|
||||
@ -1276,16 +1275,16 @@ monitor_fetch_register (struct regcache *regcache, int regno)
|
||||
monitor_printf (current_monitor->getreg.term_cmd);
|
||||
}
|
||||
if (!current_monitor->getreg.term || /* Already expected or */
|
||||
current_monitor->getreg.term_cmd) /* ack expected */
|
||||
monitor_expect_prompt (NULL, 0); /* get response */
|
||||
current_monitor->getreg.term_cmd) /* ack expected. */
|
||||
monitor_expect_prompt (NULL, 0); /* Get response. */
|
||||
|
||||
monitor_supply_register (regcache, regno, regbuf);
|
||||
}
|
||||
|
||||
/* Sometimes, it takes several commands to dump the registers */
|
||||
/* Sometimes, it takes several commands to dump the registers. */
|
||||
/* This is a primitive for use by variations of monitor interfaces in
|
||||
case they need to compose the operation.
|
||||
*/
|
||||
case they need to compose the operation. */
|
||||
|
||||
int
|
||||
monitor_dump_reg_block (struct regcache *regcache, char *block_cmd)
|
||||
{
|
||||
@ -1300,7 +1299,7 @@ monitor_dump_reg_block (struct regcache *regcache, char *block_cmd)
|
||||
|
||||
|
||||
/* Read the remote registers into the block regs. */
|
||||
/* Call the specific function if it has been provided */
|
||||
/* Call the specific function if it has been provided. */
|
||||
|
||||
static void
|
||||
monitor_dump_regs (struct regcache *regcache)
|
||||
@ -1309,15 +1308,15 @@ monitor_dump_regs (struct regcache *regcache)
|
||||
int resp_len;
|
||||
|
||||
if (current_monitor->dumpregs)
|
||||
(*(current_monitor->dumpregs)) (regcache); /* call supplied function */
|
||||
else if (current_monitor->dump_registers) /* default version */
|
||||
(*(current_monitor->dumpregs)) (regcache); /* Call supplied function. */
|
||||
else if (current_monitor->dump_registers) /* Default version. */
|
||||
{
|
||||
monitor_printf (current_monitor->dump_registers);
|
||||
resp_len = monitor_expect_prompt (buf, sizeof (buf));
|
||||
parse_register_dump (regcache, buf, resp_len);
|
||||
}
|
||||
else
|
||||
/* Need some way to read registers */
|
||||
/* Need some way to read registers. */
|
||||
internal_error (__FILE__, __LINE__,
|
||||
_("failed internal consistency check"));
|
||||
}
|
||||
@ -1368,7 +1367,7 @@ monitor_store_register (struct regcache *regcache, int regno)
|
||||
regcache_cooked_read_unsigned (regcache, regno, &val);
|
||||
monitor_debug ("MON storeg %d %s\n", regno, phex (val, reg_size));
|
||||
|
||||
/* send the register deposit command */
|
||||
/* Send the register deposit command. */
|
||||
|
||||
if (current_monitor->flags & MO_REGISTER_VALUE_FIRST)
|
||||
monitor_printf (current_monitor->setreg.cmd, val, name);
|
||||
@ -1394,7 +1393,7 @@ monitor_store_register (struct regcache *regcache, int regno)
|
||||
}
|
||||
else
|
||||
monitor_expect_prompt (NULL, 0);
|
||||
if (current_monitor->setreg.term_cmd) /* Mode exit required */
|
||||
if (current_monitor->setreg.term_cmd) /* Mode exit required. */
|
||||
{
|
||||
monitor_debug ("EXP setreg_termcmd\n");
|
||||
monitor_printf ("%s", current_monitor->setreg.term_cmd);
|
||||
@ -1428,7 +1427,7 @@ monitor_store_registers (struct target_ops *ops,
|
||||
static void
|
||||
monitor_prepare_to_store (struct regcache *regcache)
|
||||
{
|
||||
/* Do nothing, since we can store individual regs */
|
||||
/* Do nothing, since we can store individual regs. */
|
||||
}
|
||||
|
||||
static void
|
||||
@ -1458,7 +1457,7 @@ monitor_write_memory (CORE_ADDR memaddr, char *myaddr, int len)
|
||||
if (myaddr[i] != 0)
|
||||
break;
|
||||
|
||||
if (i > 4) /* More than 4 zeros is worth doing */
|
||||
if (i > 4) /* More than 4 zeros is worth doing. */
|
||||
{
|
||||
monitor_debug ("MON FILL %d\n", i);
|
||||
if (current_monitor->flags & MO_FILL_USES_ADDR)
|
||||
@ -1526,9 +1525,9 @@ monitor_write_memory (CORE_ADDR memaddr, char *myaddr, int len)
|
||||
monitor_printf ("%x\r", val);
|
||||
}
|
||||
if (current_monitor->setmem.term_cmd)
|
||||
{ /* Emit this to get out of the memory editing state */
|
||||
{ /* Emit this to get out of the memory editing state. */
|
||||
monitor_printf ("%s", current_monitor->setmem.term_cmd);
|
||||
/* Drop through to expecting a prompt */
|
||||
/* Drop through to expecting a prompt. */
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -1548,7 +1547,7 @@ monitor_write_memory_bytes (CORE_ADDR memaddr, char *myaddr, int len)
|
||||
|
||||
if (len == 0)
|
||||
return 0;
|
||||
/* Enter the sub mode */
|
||||
/* Enter the sub mode. */
|
||||
monitor_printf (current_monitor->setmem.cmdb, memaddr);
|
||||
monitor_expect_prompt (NULL, 0);
|
||||
while (len)
|
||||
@ -1558,11 +1557,11 @@ monitor_write_memory_bytes (CORE_ADDR memaddr, char *myaddr, int len)
|
||||
myaddr++;
|
||||
memaddr++;
|
||||
written++;
|
||||
/* If we wanted to, here we could validate the address */
|
||||
/* If we wanted to, here we could validate the address. */
|
||||
monitor_expect_prompt (NULL, 0);
|
||||
len--;
|
||||
}
|
||||
/* Now exit the sub mode */
|
||||
/* Now exit the sub mode. */
|
||||
monitor_printf (current_monitor->getreg.term_cmd);
|
||||
monitor_expect_prompt (NULL, 0);
|
||||
return written;
|
||||
@ -1585,7 +1584,7 @@ longlongendswap (unsigned char *a)
|
||||
i++, j--;
|
||||
}
|
||||
}
|
||||
/* Format 32 chars of long long value, advance the pointer */
|
||||
/* Format 32 chars of long long value, advance the pointer. */
|
||||
static char *hexlate = "0123456789abcdef";
|
||||
static char *
|
||||
longlong_hexchars (unsigned long long value,
|
||||
@ -1611,16 +1610,16 @@ longlong_hexchars (unsigned long long value,
|
||||
dp = (unsigned long long *) scan;
|
||||
*dp = value;
|
||||
}
|
||||
longlongendswap (disbuf); /* FIXME: ONly on big endian hosts */
|
||||
longlongendswap (disbuf); /* FIXME: ONly on big endian hosts. */
|
||||
while (scan < limit)
|
||||
{
|
||||
c = *scan++; /* a byte of our long long value */
|
||||
c = *scan++; /* A byte of our long long value. */
|
||||
if (leadzero)
|
||||
{
|
||||
if (c == 0)
|
||||
continue;
|
||||
else
|
||||
leadzero = 0; /* henceforth we print even zeroes */
|
||||
leadzero = 0; /* Henceforth we print even zeroes. */
|
||||
}
|
||||
nib = c >> 4; /* high nibble bits */
|
||||
*outbuff++ = hexlate[nib];
|
||||
@ -1634,12 +1633,12 @@ longlong_hexchars (unsigned long long value,
|
||||
|
||||
|
||||
/* I am only going to call this when writing virtual byte streams.
|
||||
Which possably entails endian conversions
|
||||
*/
|
||||
Which possably entails endian conversions. */
|
||||
|
||||
static int
|
||||
monitor_write_memory_longlongs (CORE_ADDR memaddr, char *myaddr, int len)
|
||||
{
|
||||
static char hexstage[20]; /* At least 16 digits required, plus null */
|
||||
static char hexstage[20]; /* At least 16 digits required, plus null. */
|
||||
char *endstring;
|
||||
long long *llptr;
|
||||
long long value;
|
||||
@ -1654,16 +1653,16 @@ monitor_write_memory_longlongs (CORE_ADDR memaddr, char *myaddr, int len)
|
||||
{
|
||||
value = *llptr;
|
||||
endstring = longlong_hexchars (*llptr, hexstage);
|
||||
*endstring = '\0'; /* NUll terminate for printf */
|
||||
*endstring = '\0'; /* NUll terminate for printf. */
|
||||
monitor_printf ("%s\r", hexstage);
|
||||
llptr++;
|
||||
memaddr += 8;
|
||||
written += 8;
|
||||
/* If we wanted to, here we could validate the address */
|
||||
/* If we wanted to, here we could validate the address. */
|
||||
monitor_expect_prompt (NULL, 0);
|
||||
len -= 8;
|
||||
}
|
||||
/* Now exit the sub mode */
|
||||
/* Now exit the sub mode. */
|
||||
monitor_printf (current_monitor->getreg.term_cmd);
|
||||
monitor_expect_prompt (NULL, 0);
|
||||
return written;
|
||||
@ -1681,9 +1680,8 @@ monitor_write_memory_longlongs (CORE_ADDR memaddr, char *myaddr, int len)
|
||||
MO_SETMEM_INTERACTIVE
|
||||
! MO_NO_ECHO_ON_SETMEM
|
||||
To use this, the you have to patch the monitor_cmds block with
|
||||
this function. Otherwise, its not tuned up for use by all
|
||||
monitor variations.
|
||||
*/
|
||||
this function. Otherwise, its not tuned up for use by all
|
||||
monitor variations. */
|
||||
|
||||
static int
|
||||
monitor_write_memory_block (CORE_ADDR memaddr, char *myaddr, int len)
|
||||
@ -1691,7 +1689,7 @@ monitor_write_memory_block (CORE_ADDR memaddr, char *myaddr, int len)
|
||||
int written;
|
||||
|
||||
written = 0;
|
||||
/* FIXME: This would be a good place to put the zero test */
|
||||
/* FIXME: This would be a good place to put the zero test. */
|
||||
#if 1
|
||||
if ((len > 8) && (((len & 0x07)) == 0) && current_monitor->setmem.cmdll)
|
||||
{
|
||||
@ -1759,7 +1757,7 @@ monitor_read_memory_single (CORE_ADDR memaddr, char *myaddr, int len)
|
||||
/* Now, read the appropriate number of hex digits for this loc,
|
||||
skipping spaces. */
|
||||
|
||||
/* Skip leading spaces and "0x" if MO_HEX_PREFIX flag is set. */
|
||||
/* Skip leading spaces and "0x" if MO_HEX_PREFIX flag is set. */
|
||||
if (current_monitor->flags & MO_HEX_PREFIX)
|
||||
{
|
||||
int c;
|
||||
@ -1796,7 +1794,7 @@ monitor_read_memory_single (CORE_ADDR memaddr, char *myaddr, int len)
|
||||
}
|
||||
membuf[i] = c;
|
||||
}
|
||||
membuf[i] = '\000'; /* terminate the number */
|
||||
membuf[i] = '\000'; /* Terminate the number. */
|
||||
}
|
||||
|
||||
/* If TERM is present, we wait for that to show up. Also, (if TERM is
|
||||
@ -1805,8 +1803,8 @@ monitor_read_memory_single (CORE_ADDR memaddr, char *myaddr, int len)
|
||||
|
||||
if (current_monitor->getmem.term)
|
||||
{
|
||||
monitor_expect (current_monitor->getmem.term, NULL, 0); /* get
|
||||
response */
|
||||
monitor_expect (current_monitor->getmem.term, NULL, 0); /* Get
|
||||
response. */
|
||||
|
||||
if (current_monitor->getmem.term_cmd)
|
||||
{
|
||||
@ -1815,7 +1813,7 @@ monitor_read_memory_single (CORE_ADDR memaddr, char *myaddr, int len)
|
||||
}
|
||||
}
|
||||
else
|
||||
monitor_expect_prompt (NULL, 0); /* get response */
|
||||
monitor_expect_prompt (NULL, 0); /* Get response. */
|
||||
|
||||
p = membuf;
|
||||
val = strtoul (membuf, &p, 16);
|
||||
@ -1825,7 +1823,7 @@ monitor_read_memory_single (CORE_ADDR memaddr, char *myaddr, int len)
|
||||
"bad value from monitor",
|
||||
memaddr, 0, membuf, 0);
|
||||
|
||||
/* supply register stores in target byte order, so swap here */
|
||||
/* supply register stores in target byte order, so swap here. */
|
||||
|
||||
store_unsigned_integer (myaddr, len, byte_order, val);
|
||||
|
||||
@ -1865,9 +1863,8 @@ monitor_read_memory (CORE_ADDR memaddr, char *myaddr, int len)
|
||||
len = min (len, 16);
|
||||
|
||||
/* Some dumpers align the first data with the preceeding 16
|
||||
byte boundary. Some print blanks and start at the
|
||||
requested boundary. EXACT_DUMPADDR
|
||||
*/
|
||||
byte boundary. Some print blanks and start at the
|
||||
requested boundary. EXACT_DUMPADDR */
|
||||
|
||||
dumpaddr = (current_monitor->flags & MO_EXACT_DUMPADDR)
|
||||
? memaddr : memaddr & ~0x0f;
|
||||
@ -1876,7 +1873,7 @@ monitor_read_memory (CORE_ADDR memaddr, char *myaddr, int len)
|
||||
if (((memaddr ^ (memaddr + len - 1)) & ~0xf) != 0)
|
||||
len = ((memaddr + len) & ~0xf) - memaddr;
|
||||
|
||||
/* send the memory examine command */
|
||||
/* Send the memory examine command. */
|
||||
|
||||
if (current_monitor->flags & MO_GETMEM_NEEDS_RANGE)
|
||||
monitor_printf (current_monitor->getmem.cmdb, memaddr, memaddr + len);
|
||||
@ -1893,7 +1890,7 @@ monitor_read_memory (CORE_ADDR memaddr, char *myaddr, int len)
|
||||
if (current_monitor->getmem.term)
|
||||
{
|
||||
resp_len = monitor_expect (current_monitor->getmem.term,
|
||||
buf, sizeof buf); /* get response */
|
||||
buf, sizeof buf); /* Get response. */
|
||||
|
||||
if (resp_len <= 0)
|
||||
monitor_error ("monitor_read_memory",
|
||||
@ -1908,7 +1905,7 @@ monitor_read_memory (CORE_ADDR memaddr, char *myaddr, int len)
|
||||
}
|
||||
}
|
||||
else
|
||||
resp_len = monitor_expect_prompt (buf, sizeof buf); /* get response */
|
||||
resp_len = monitor_expect_prompt (buf, sizeof buf); /* Get response. */
|
||||
|
||||
p = buf;
|
||||
|
||||
@ -1970,20 +1967,21 @@ monitor_read_memory (CORE_ADDR memaddr, char *myaddr, int len)
|
||||
++dumpaddr;
|
||||
++p;
|
||||
}
|
||||
++p; /* skip a blank or other non hex char */
|
||||
++p; /* Skip a blank or other non hex char. */
|
||||
c = *p;
|
||||
}
|
||||
if (fetched == 0)
|
||||
error (_("Failed to read via monitor"));
|
||||
if (monitor_debug_p || remote_debug)
|
||||
fprintf_unfiltered (gdb_stdlog, "\n");
|
||||
return fetched; /* Return the number of bytes actually read */
|
||||
return fetched; /* Return the number of bytes actually
|
||||
read. */
|
||||
}
|
||||
monitor_debug ("MON scanning bytes\n");
|
||||
|
||||
for (i = len; i > 0; i--)
|
||||
{
|
||||
/* Skip non-hex chars, but bomb on end of string and newlines */
|
||||
/* Skip non-hex chars, but bomb on end of string and newlines. */
|
||||
|
||||
while (1)
|
||||
{
|
||||
@ -2016,8 +2014,8 @@ monitor_read_memory (CORE_ADDR memaddr, char *myaddr, int len)
|
||||
}
|
||||
|
||||
/* Transfer LEN bytes between target address MEMADDR and GDB address
|
||||
MYADDR. Returns 0 for success, errno code for failure. TARGET is
|
||||
unused. */
|
||||
MYADDR. Returns 0 for success, errno code for failure. TARGET is
|
||||
unused. */
|
||||
|
||||
static int
|
||||
monitor_xfer_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len, int write,
|
||||
@ -2043,7 +2041,7 @@ monitor_xfer_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len, int write,
|
||||
static void
|
||||
monitor_kill (struct target_ops *ops)
|
||||
{
|
||||
return; /* ignore attempts to kill target system */
|
||||
return; /* Ignore attempts to kill target system. */
|
||||
}
|
||||
|
||||
/* All we actually do is set the PC to the start address of exec_bfd. */
|
||||
@ -2070,7 +2068,7 @@ static void
|
||||
monitor_mourn_inferior (struct target_ops *ops)
|
||||
{
|
||||
unpush_target (targ_ops);
|
||||
generic_mourn_inferior (); /* Do all the proper things now */
|
||||
generic_mourn_inferior (); /* Do all the proper things now. */
|
||||
delete_thread_silent (monitor_ptid);
|
||||
}
|
||||
|
||||
@ -2129,7 +2127,7 @@ monitor_remove_breakpoint (struct gdbarch *gdbarch,
|
||||
if (breakaddr[i] == addr)
|
||||
{
|
||||
breakaddr[i] = 0;
|
||||
/* some monitors remove breakpoints based on the address */
|
||||
/* Some monitors remove breakpoints based on the address. */
|
||||
if (current_monitor->flags & MO_CLR_BREAK_USES_ADDR)
|
||||
monitor_printf (current_monitor->clr_break, addr);
|
||||
else if (current_monitor->flags & MO_CLR_BREAK_1_BASED)
|
||||
@ -2173,7 +2171,7 @@ monitor_wait_srec_ack (void)
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* monitor_load -- download a file. */
|
||||
/* monitor_load -- download a file. */
|
||||
|
||||
static void
|
||||
monitor_load (char *file, int from_tty)
|
||||
@ -2183,12 +2181,12 @@ monitor_load (char *file, int from_tty)
|
||||
if (current_monitor->load_routine)
|
||||
current_monitor->load_routine (monitor_desc, file, hashmark);
|
||||
else
|
||||
{ /* The default is ascii S-records */
|
||||
{ /* The default is ascii S-records. */
|
||||
int n;
|
||||
unsigned long load_offset;
|
||||
char buf[128];
|
||||
|
||||
/* enable user to specify address for downloading as 2nd arg to load */
|
||||
/* Enable user to specify address for downloading as 2nd arg to load. */
|
||||
n = sscanf (file, "%s 0x%lx", buf, &load_offset);
|
||||
if (n > 1)
|
||||
file = buf;
|
||||
@ -2207,7 +2205,7 @@ monitor_load (char *file, int from_tty)
|
||||
monitor_expect_prompt (NULL, 0);
|
||||
}
|
||||
|
||||
/* Finally, make the PC point at the start address */
|
||||
/* Finally, make the PC point at the start address. */
|
||||
if (exec_bfd)
|
||||
regcache_write_pc (get_current_regcache (),
|
||||
bfd_get_start_address (exec_bfd));
|
||||
@ -2238,7 +2236,7 @@ monitor_stop (ptid_t ptid)
|
||||
}
|
||||
|
||||
/* Put a COMMAND string out to MONITOR. Output from MONITOR is placed
|
||||
in OUTPUT until the prompt is seen. FIXME: We read the characters
|
||||
in OUTPUT until the prompt is seen. FIXME: We read the characters
|
||||
ourseleves here cause of a nasty echo. */
|
||||
|
||||
static void
|
||||
@ -2261,7 +2259,7 @@ monitor_rcmd (char *command,
|
||||
|
||||
resp_len = monitor_expect_prompt (buf, sizeof buf);
|
||||
|
||||
fputs_unfiltered (buf, outbuf); /* Output the response */
|
||||
fputs_unfiltered (buf, outbuf); /* Output the response. */
|
||||
}
|
||||
|
||||
/* Convert hex digit A to a number. */
|
||||
@ -2350,7 +2348,7 @@ init_base_monitor_ops (void)
|
||||
monitor_ops.to_magic = OPS_MAGIC;
|
||||
} /* init_base_monitor_ops */
|
||||
|
||||
/* Init the target_ops structure pointed at by OPS */
|
||||
/* Init the target_ops structure pointed at by OPS. */
|
||||
|
||||
void
|
||||
init_monitor_ops (struct target_ops *ops)
|
||||
|
@ -16,8 +16,7 @@
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef MONITOR_H
|
||||
#define MONITOR_H
|
||||
@ -80,13 +79,13 @@ struct regrw_cmd
|
||||
struct monitor_ops
|
||||
{
|
||||
int flags; /* See below */
|
||||
char **init; /* List of init commands. NULL terminated. */
|
||||
char **init; /* List of init commands. NULL terminated. */
|
||||
char *cont; /* continue command */
|
||||
char *step; /* single step */
|
||||
char *stop; /* Interrupt program string */
|
||||
char *set_break; /* set a breakpoint. If NULL, monitor
|
||||
char *set_break; /* set a breakpoint. If NULL, monitor
|
||||
implementation sets its own
|
||||
to_insert_breakpoint method. */
|
||||
to_insert_breakpoint method. */
|
||||
char *clr_break; /* clear a breakpoint */
|
||||
char *clr_all_break; /* Clear all breakpoints */
|
||||
char *fill; /* Memory fill cmd (addr len val) */
|
||||
@ -129,11 +128,11 @@ struct monitor_ops
|
||||
};
|
||||
|
||||
/* The monitor ops magic number, used to detect if an ops structure doesn't
|
||||
have the right number of entries filled in. */
|
||||
have the right number of entries filled in. */
|
||||
|
||||
#define MONITOR_OPS_MAGIC 600925
|
||||
|
||||
/* Flag definitions. */
|
||||
/* Flag definitions. */
|
||||
|
||||
/* If set, then clear breakpoint command uses address, otherwise it
|
||||
uses an index returned by the monitor. */
|
||||
@ -141,7 +140,7 @@ struct monitor_ops
|
||||
#define MO_CLR_BREAK_USES_ADDR 0x1
|
||||
|
||||
/* If set, then memory fill command uses STARTADDR, ENDADDR+1, VALUE
|
||||
as args, else it uses STARTADDR, LENGTH, VALUE as args. */
|
||||
as args, else it uses STARTADDR, LENGTH, VALUE as args. */
|
||||
|
||||
#define MO_FILL_USES_ADDR 0x2
|
||||
|
||||
@ -150,35 +149,35 @@ struct monitor_ops
|
||||
|
||||
#define MO_NEED_REGDUMP_AFTER_CONT 0x4
|
||||
|
||||
/* getmem needs start addr and end addr */
|
||||
/* getmem needs start addr and end addr. */
|
||||
|
||||
#define MO_GETMEM_NEEDS_RANGE 0x8
|
||||
|
||||
/* getmem can only read one loc at a time */
|
||||
/* getmem can only read one loc at a time. */
|
||||
|
||||
#define MO_GETMEM_READ_SINGLE 0x10
|
||||
|
||||
/* handle \r\n combinations */
|
||||
/* handle \r\n combinations. */
|
||||
|
||||
#define MO_HANDLE_NL 0x20
|
||||
|
||||
/* don't expect echos in monitor_open */
|
||||
/* don't expect echos in monitor_open. */
|
||||
|
||||
#define MO_NO_ECHO_ON_OPEN 0x40
|
||||
|
||||
/* If set, send break to stop monitor */
|
||||
/* If set, send break to stop monitor. */
|
||||
|
||||
#define MO_SEND_BREAK_ON_STOP 0x80
|
||||
|
||||
/* If set, target sends an ACK after each S-record */
|
||||
/* If set, target sends an ACK after each S-record. */
|
||||
|
||||
#define MO_SREC_ACK 0x100
|
||||
|
||||
/* Allow 0x prefix on addresses retured from monitor */
|
||||
/* Allow 0x prefix on addresses retured from monitor. */
|
||||
|
||||
#define MO_HEX_PREFIX 0x200
|
||||
|
||||
/* Some monitors require a different command when starting a program */
|
||||
/* Some monitors require a different command when starting a program. */
|
||||
|
||||
#define MO_RUN_FIRST_TIME 0x400
|
||||
|
||||
@ -186,7 +185,7 @@ struct monitor_ops
|
||||
|
||||
#define MO_NO_ECHO_ON_SETMEM 0x800
|
||||
|
||||
/* If set, then register store command expects value BEFORE regname */
|
||||
/* If set, then register store command expects value BEFORE regname. */
|
||||
|
||||
#define MO_REGISTER_VALUE_FIRST 0x1000
|
||||
|
||||
@ -228,17 +227,17 @@ struct monitor_ops
|
||||
#define MO_PRINT_PROGRAM_OUTPUT 0x200000
|
||||
|
||||
/* Some dump bytes commands align the first data with the preceeding
|
||||
16 byte boundary. Some print blanks and start at the exactly the
|
||||
requested boundary. */
|
||||
16 byte boundary. Some print blanks and start at the exactly the
|
||||
requested boundary. */
|
||||
|
||||
#define MO_EXACT_DUMPADDR 0x400000
|
||||
|
||||
/* Rather entering and exiting the write memory dialog for each word byte,
|
||||
we can save time by transferring the whole block without exiting
|
||||
the memory editing mode. You only need to worry about this
|
||||
the memory editing mode. You only need to worry about this
|
||||
if you are doing memory downloading.
|
||||
This engages a new write function registered with dcache.
|
||||
*/
|
||||
This engages a new write function registered with dcache. */
|
||||
|
||||
#define MO_HAS_BLOCKWRITES 0x800000
|
||||
|
||||
#define SREC_SIZE 160
|
||||
|
@ -245,7 +245,7 @@ moxie_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
|
||||
/* Found a function. */
|
||||
sym = lookup_symbol (func_name, NULL, VAR_DOMAIN, NULL);
|
||||
/* Don't use line number debug info for assembly source
|
||||
files. */
|
||||
files. */
|
||||
if (sym && SYMBOL_LANGUAGE (sym) != language_asm)
|
||||
{
|
||||
sal = find_pc_line (func_addr, 0);
|
||||
@ -513,7 +513,7 @@ moxie_process_readu (CORE_ADDR addr, char *buf,
|
||||
|
||||
/* Parse the current instruction and record the values of the registers and
|
||||
memory that will be changed in current instruction to "record_arch_list".
|
||||
Return -1 if something wrong. */
|
||||
Return -1 if something wrong. */
|
||||
|
||||
int
|
||||
moxie_process_record (struct gdbarch *gdbarch, struct regcache *regcache,
|
||||
@ -848,7 +848,7 @@ moxie_process_record (struct gdbarch *gdbarch, struct regcache *regcache,
|
||||
ptr = extract_unsigned_integer ((gdb_byte *) & ptr,
|
||||
4, byte_order);
|
||||
|
||||
/* String length is at 0x12($fp) */
|
||||
/* String length is at 0x12($fp). */
|
||||
regcache_raw_read (regcache,
|
||||
MOXIE_FP_REGNUM, (gdb_byte *) & tmpu32);
|
||||
tmpu32 = extract_unsigned_integer ((gdb_byte *) & tmpu32,
|
||||
|
@ -22,7 +22,7 @@
|
||||
|
||||
struct gdbarch_tdep
|
||||
{
|
||||
/* gdbarch target dependent data here. Currently unused for MOXIE. */
|
||||
/* gdbarch target dependent data here. Currently unused for MOXIE. */
|
||||
};
|
||||
|
||||
enum moxie_regnum
|
||||
|
@ -456,7 +456,7 @@ mt_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
|
||||
instruction in the instruction set.
|
||||
|
||||
The BP for ms1 is defined as 0x68000000 (BREAK).
|
||||
The BP for ms2 is defined as 0x69000000 (illegal) */
|
||||
The BP for ms2 is defined as 0x69000000 (illegal). */
|
||||
|
||||
static const gdb_byte *
|
||||
mt_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *bp_addr,
|
||||
@ -483,7 +483,7 @@ mt_select_coprocessor (struct gdbarch *gdbarch,
|
||||
unsigned index, base;
|
||||
gdb_byte copro[4];
|
||||
|
||||
/* Get the copro pseudo regnum. */
|
||||
/* Get the copro pseudo regnum. */
|
||||
regcache_raw_read (regcache, MT_COPRO_REGNUM, copro);
|
||||
base = ((extract_signed_integer (&copro[0], 2, byte_order)
|
||||
* MT_COPRO_PSEUDOREG_DIM_2)
|
||||
@ -877,7 +877,7 @@ mt_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||
|
||||
struct mt_unwind_cache
|
||||
{
|
||||
/* The previous frame's inner most stack address.
|
||||
/* The previous frame's inner most stack address.
|
||||
Used as this frame ID's stack_addr. */
|
||||
CORE_ADDR prev_sp;
|
||||
CORE_ADDR frame_base;
|
||||
@ -915,7 +915,7 @@ mt_frame_unwind_cache (struct frame_info *this_frame,
|
||||
info->frameless_p = 1;
|
||||
info->saved_regs = trad_frame_alloc_saved_regs (this_frame);
|
||||
|
||||
/* Grab the frame-relative values of SP and FP, needed below.
|
||||
/* Grab the frame-relative values of SP and FP, needed below.
|
||||
The frame_saved_register function will find them on the
|
||||
stack or in the registers as appropriate. */
|
||||
sp = get_frame_register_unsigned (this_frame, MT_SP_REGNUM);
|
||||
@ -933,17 +933,17 @@ mt_frame_unwind_cache (struct frame_info *this_frame,
|
||||
for (next_addr = start_addr; next_addr < end_addr; next_addr += 4)
|
||||
{
|
||||
instr = get_frame_memory_unsigned (this_frame, next_addr, 4);
|
||||
if (delayed_store) /* previous instr was a push */
|
||||
if (delayed_store) /* Previous instr was a push. */
|
||||
{
|
||||
upper_half = delayed_store >> 16;
|
||||
regnum = upper_half & 0xf;
|
||||
offset = delayed_store & 0xffff;
|
||||
switch (upper_half & 0xfff0)
|
||||
{
|
||||
case 0x43c0: /* push using frame pointer */
|
||||
case 0x43c0: /* push using frame pointer. */
|
||||
info->saved_regs[regnum].addr = offset;
|
||||
break;
|
||||
case 0x43d0: /* push using stack pointer */
|
||||
case 0x43d0: /* push using stack pointer. */
|
||||
info->saved_regs[regnum].addr = offset;
|
||||
break;
|
||||
default: /* lint */
|
||||
@ -957,7 +957,8 @@ mt_frame_unwind_cache (struct frame_info *this_frame,
|
||||
case 0x12000000: /* NO-OP */
|
||||
continue;
|
||||
case 0x12ddc000: /* copy sp into fp */
|
||||
info->frameless_p = 0; /* Record that the frame pointer is in use. */
|
||||
info->frameless_p = 0; /* Record that the frame
|
||||
pointer is in use. */
|
||||
continue;
|
||||
default:
|
||||
upper_half = instr >> 16;
|
||||
@ -990,9 +991,9 @@ mt_frame_unwind_cache (struct frame_info *this_frame,
|
||||
keep scanning until we reach it (or we reach end_addr). */
|
||||
|
||||
if (prologue_end_addr && (prologue_end_addr > (next_addr + 4)))
|
||||
continue; /* Keep scanning, recording saved_regs etc. */
|
||||
continue; /* Keep scanning, recording saved_regs etc. */
|
||||
else
|
||||
break; /* Quit scanning: breakpoint can be set here. */
|
||||
break; /* Quit scanning: breakpoint can be set here. */
|
||||
}
|
||||
}
|
||||
|
||||
@ -1185,7 +1186,7 @@ mt_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
|
||||
set_gdbarch_unwind_pc (gdbarch, mt_unwind_pc);
|
||||
set_gdbarch_unwind_sp (gdbarch, mt_unwind_sp);
|
||||
|
||||
/* Methods for saving / extracting a dummy frame's ID.
|
||||
/* Methods for saving / extracting a dummy frame's ID.
|
||||
The ID's stack address must match the SP value returned by
|
||||
PUSH_DUMMY_CALL, and saved by generic_save_dummy_frame_tos. */
|
||||
set_gdbarch_dummy_id (gdbarch, mt_dummy_id);
|
||||
|
Loading…
Reference in New Issue
Block a user