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.
|
||||
|
@ -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;
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
@ -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);
|
||||
|
@ -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)
|
||||
|
||||
|
||||
|
||||
|
@ -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"
|
||||
@ -174,12 +174,12 @@ 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
|
||||
@ -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);
|
||||
@ -469,11 +479,12 @@ m32r_upload_command (char *args, int from_tty)
|
||||
}
|
||||
}
|
||||
if (server_addr == 0) /* failed? */
|
||||
error
|
||||
("Need to know gdb host computer's IP address (use 'set server-address')");
|
||||
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,8 +492,8 @@ 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);
|
||||
@ -503,8 +514,8 @@ m32r_upload_command (char *args, int from_tty)
|
||||
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,7 +553,7 @@ 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
|
||||
@ -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, _("\
|
||||
|
@ -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. */
|
||||
@ -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
|
||||
@ -333,8 +338,8 @@ decode_prologue (struct gdbarch *gdbarch,
|
||||
&& 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;
|
||||
@ -437,9 +442,10 @@ decode_prologue (struct gdbarch *gdbarch,
|
||||
}
|
||||
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))
|
||||
{
|
||||
@ -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),
|
||||
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
@ -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))
|
||||
@ -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)
|
||||
@ -178,7 +178,8 @@ 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;
|
||||
@ -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;
|
||||
|
||||
@ -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);
|
||||
|
||||
|
@ -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))
|
||||
@ -158,14 +159,15 @@ 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. */
|
||||
@ -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
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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. */
|
||||
|
@ -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':
|
||||
|
11
gdb/maint.c
11
gdb/maint.c
@ -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? */
|
||||
error (_("Need to specify <section-name> and <address>"));
|
||||
*p++ = '\000';
|
||||
while (isspace (*p))
|
||||
p++; /* Skip whitespace */
|
||||
p++; /* Skip whitespace. */
|
||||
|
||||
ALL_OBJSECTIONS (objfile, sect)
|
||||
{
|
||||
@ -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)
|
||||
{
|
||||
|
259
gdb/mdebugread.c
259
gdb/mdebugread.c
@ -61,11 +61,11 @@
|
||||
|
||||
#include "bfd.h"
|
||||
|
||||
#include "coff/ecoff.h" /* COFF-like aspects of ecoff files */
|
||||
#include "coff/ecoff.h" /* COFF-like aspects of ecoff files. */
|
||||
|
||||
#include "libaout.h" /* Private BFD a.out information. */
|
||||
#include "aout/aout64.h"
|
||||
#include "aout/stab_gnu.h" /* STABS information */
|
||||
#include "aout/stab_gnu.h" /* STABS information. */
|
||||
|
||||
#include "expression.h"
|
||||
|
||||
@ -119,7 +119,7 @@ struct symloc
|
||||
#define SC_IS_SBSS(sc) ((sc) == scSBss)
|
||||
#define SC_IS_UNDEF(sc) ((sc) == scUndefined || (sc) == scSUndefined)
|
||||
|
||||
/* Various complaints about symbol reading that don't abort the process */
|
||||
/* Various complaints about symbol reading that don't abort the process. */
|
||||
static void
|
||||
index_complaint (const char *arg1)
|
||||
{
|
||||
@ -159,16 +159,16 @@ unexpected_type_code_complaint (const char *arg1)
|
||||
complaint (&symfile_complaints, _("unexpected type code for %s"), arg1);
|
||||
}
|
||||
|
||||
/* Macros and extra defs */
|
||||
/* Macros and extra defs. */
|
||||
|
||||
/* Puns: hard to find whether -g was used and how */
|
||||
/* Puns: hard to find whether -g was used and how. */
|
||||
|
||||
#define MIN_GLEVEL GLEVEL_0
|
||||
#define compare_glevel(a,b) \
|
||||
(((a) == GLEVEL_3) ? ((b) < GLEVEL_3) : \
|
||||
((b) == GLEVEL_3) ? -1 : (int)((b) - (a)))
|
||||
|
||||
/* Things that really are local to this module */
|
||||
/* Things that really are local to this module. */
|
||||
|
||||
/* Remember what we deduced to be the source language of this psymtab. */
|
||||
|
||||
@ -186,22 +186,22 @@ static const struct ecoff_debug_swap *debug_swap;
|
||||
|
||||
static struct ecoff_debug_info *debug_info;
|
||||
|
||||
/* Pointer to current file decriptor record, and its index */
|
||||
/* Pointer to current file decriptor record, and its index. */
|
||||
|
||||
static FDR *cur_fdr;
|
||||
static int cur_fd;
|
||||
|
||||
/* Index of current symbol */
|
||||
/* Index of current symbol. */
|
||||
|
||||
static int cur_sdx;
|
||||
|
||||
/* Note how much "debuggable" this image is. We would like
|
||||
to see at least one FDR with full symbols */
|
||||
to see at least one FDR with full symbols. */
|
||||
|
||||
static int max_gdbinfo;
|
||||
static int max_glevel;
|
||||
|
||||
/* When examining .o files, report on undefined symbols */
|
||||
/* When examining .o files, report on undefined symbols. */
|
||||
|
||||
static int n_undef_symbols, n_undef_labels, n_undef_vars, n_undef_procs;
|
||||
|
||||
@ -213,7 +213,7 @@ static char stabs_symbol[] = STABS_SYMBOL;
|
||||
|
||||
static int found_ecoff_debugging_info;
|
||||
|
||||
/* Forward declarations */
|
||||
/* Forward declarations. */
|
||||
|
||||
static int upgrade_type (int, struct type **, int, union aux_ext *,
|
||||
int, char *);
|
||||
@ -267,7 +267,7 @@ static char *mdebug_next_symbol_text (struct objfile *);
|
||||
/* Exported procedure: Builds a symtab from the PST partial one.
|
||||
Restores the environment in effect when PST was created, delegates
|
||||
most of the work to an ancillary procedure, and sorts
|
||||
and reorders the symtab list at the end */
|
||||
and reorders the symtab list at the end. */
|
||||
|
||||
static void
|
||||
mdebug_psymtab_to_symtab (struct partial_symtab *pst)
|
||||
@ -293,9 +293,9 @@ mdebug_psymtab_to_symtab (struct partial_symtab *pst)
|
||||
printf_filtered (_("done.\n"));
|
||||
}
|
||||
|
||||
/* File-level interface functions */
|
||||
/* File-level interface functions. */
|
||||
|
||||
/* Find a file descriptor given its index RF relative to a file CF */
|
||||
/* Find a file descriptor given its index RF relative to a file CF. */
|
||||
|
||||
static FDR *
|
||||
get_rfd (int cf, int rf)
|
||||
@ -306,7 +306,7 @@ get_rfd (int cf, int rf)
|
||||
|
||||
fdrs = debug_info->fdr;
|
||||
f = fdrs + cf;
|
||||
/* Object files do not have the RFD table, all refs are absolute */
|
||||
/* Object files do not have the RFD table, all refs are absolute. */
|
||||
if (f->rfdBase == 0)
|
||||
return fdrs + rf;
|
||||
(*debug_swap->swap_rfd_in) (cur_bfd,
|
||||
@ -317,7 +317,7 @@ get_rfd (int cf, int rf)
|
||||
return fdrs + rfd;
|
||||
}
|
||||
|
||||
/* Return a safer print NAME for a file descriptor */
|
||||
/* Return a safer print NAME for a file descriptor. */
|
||||
|
||||
static char *
|
||||
fdr_name (FDR *f)
|
||||
@ -385,7 +385,7 @@ mdebug_build_psymtabs (struct objfile *objfile,
|
||||
|
||||
/* Local utilities */
|
||||
|
||||
/* Map of FDR indexes to partial symtabs */
|
||||
/* Map of FDR indexes to partial symtabs. */
|
||||
|
||||
struct pst_map
|
||||
{
|
||||
@ -416,26 +416,26 @@ static struct parse_stack
|
||||
|
||||
struct type *cur_type; /* Type we parse fields for. */
|
||||
int cur_field; /* Field number in cur_type. */
|
||||
CORE_ADDR procadr; /* Start addres of this procedure */
|
||||
int numargs; /* Its argument count */
|
||||
CORE_ADDR procadr; /* Start addres of this procedure. */
|
||||
int numargs; /* Its argument count. */
|
||||
}
|
||||
|
||||
*top_stack; /* Top stack ptr */
|
||||
|
||||
|
||||
/* Enter a new lexical context */
|
||||
/* Enter a new lexical context. */
|
||||
|
||||
static void
|
||||
push_parse_stack (void)
|
||||
{
|
||||
struct parse_stack *new;
|
||||
|
||||
/* Reuse frames if possible */
|
||||
/* Reuse frames if possible. */
|
||||
if (top_stack && top_stack->prev)
|
||||
new = top_stack->prev;
|
||||
else
|
||||
new = (struct parse_stack *) xzalloc (sizeof (struct parse_stack));
|
||||
/* Initialize new frame with previous content */
|
||||
/* Initialize new frame with previous content. */
|
||||
if (top_stack)
|
||||
{
|
||||
struct parse_stack *prev = new->prev;
|
||||
@ -448,7 +448,7 @@ push_parse_stack (void)
|
||||
top_stack = new;
|
||||
}
|
||||
|
||||
/* Exit a lexical context */
|
||||
/* Exit a lexical context. */
|
||||
|
||||
static void
|
||||
pop_parse_stack (void)
|
||||
@ -463,7 +463,7 @@ pop_parse_stack (void)
|
||||
/* Cross-references might be to things we haven't looked at
|
||||
yet, e.g. type references. To avoid too many type
|
||||
duplications we keep a quick fixup table, an array
|
||||
of lists of references indexed by file descriptor */
|
||||
of lists of references indexed by file descriptor. */
|
||||
|
||||
struct mdebug_pending
|
||||
{
|
||||
@ -482,7 +482,7 @@ struct mdebug_pending
|
||||
|
||||
static struct mdebug_pending **pending_list;
|
||||
|
||||
/* Check whether we already saw symbol SH in file FH */
|
||||
/* Check whether we already saw symbol SH in file FH. */
|
||||
|
||||
static struct mdebug_pending *
|
||||
is_pending_symbol (FDR *fh, char *sh)
|
||||
@ -490,14 +490,14 @@ is_pending_symbol (FDR *fh, char *sh)
|
||||
int f_idx = fh - debug_info->fdr;
|
||||
struct mdebug_pending *p;
|
||||
|
||||
/* Linear search is ok, list is typically no more than 10 deep */
|
||||
/* Linear search is ok, list is typically no more than 10 deep. */
|
||||
for (p = pending_list[f_idx]; p; p = p->next)
|
||||
if (p->s == sh)
|
||||
break;
|
||||
return p;
|
||||
}
|
||||
|
||||
/* Add a new symbol SH of type T */
|
||||
/* Add a new symbol SH of type T. */
|
||||
|
||||
static void
|
||||
add_pending (FDR *fh, char *sh, struct type *t)
|
||||
@ -505,7 +505,7 @@ add_pending (FDR *fh, char *sh, struct type *t)
|
||||
int f_idx = fh - debug_info->fdr;
|
||||
struct mdebug_pending *p = is_pending_symbol (fh, sh);
|
||||
|
||||
/* Make sure we do not make duplicates */
|
||||
/* Make sure we do not make duplicates. */
|
||||
if (!p)
|
||||
{
|
||||
p = ((struct mdebug_pending *)
|
||||
@ -594,7 +594,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
|
||||
case stNil:
|
||||
break;
|
||||
|
||||
case stGlobal: /* external symbol, goes into global block */
|
||||
case stGlobal: /* External symbol, goes into global block. */
|
||||
class = LOC_STATIC;
|
||||
b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (top_stack->cur_st),
|
||||
GLOBAL_BLOCK);
|
||||
@ -602,7 +602,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
|
||||
SYMBOL_VALUE_ADDRESS (s) = (CORE_ADDR) sh->value;
|
||||
goto data;
|
||||
|
||||
case stStatic: /* static data, goes into current block. */
|
||||
case stStatic: /* Static data, goes into current block. */
|
||||
class = LOC_STATIC;
|
||||
b = top_stack->cur_block;
|
||||
s = new_symbol (name);
|
||||
@ -619,7 +619,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
|
||||
SYMBOL_VALUE_ADDRESS (s) = (CORE_ADDR) sh->value;
|
||||
goto data;
|
||||
|
||||
case stLocal: /* local variable, goes into current block */
|
||||
case stLocal: /* Local variable, goes into current block. */
|
||||
b = top_stack->cur_block;
|
||||
s = new_symbol (name);
|
||||
SYMBOL_VALUE (s) = svalue;
|
||||
@ -631,7 +631,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
|
||||
else
|
||||
class = LOC_LOCAL;
|
||||
|
||||
data: /* Common code for symbols describing data */
|
||||
data: /* Common code for symbols describing data. */
|
||||
SYMBOL_DOMAIN (s) = VAR_DOMAIN;
|
||||
SYMBOL_CLASS (s) = class;
|
||||
add_symbol (s, top_stack->cur_st, b);
|
||||
@ -642,17 +642,18 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
|
||||
SYMBOL_TYPE (s) = objfile_type (objfile)->nodebug_data_symbol;
|
||||
else
|
||||
SYMBOL_TYPE (s) = parse_type (cur_fd, ax, sh->index, 0, bigend, name);
|
||||
/* Value of a data symbol is its memory address */
|
||||
/* Value of a data symbol is its memory address. */
|
||||
break;
|
||||
|
||||
case stParam: /* arg to procedure, goes into current block */
|
||||
case stParam: /* Arg to procedure, goes into current
|
||||
block. */
|
||||
max_gdbinfo++;
|
||||
found_ecoff_debugging_info = 1;
|
||||
top_stack->numargs++;
|
||||
|
||||
/* Special GNU C++ name. */
|
||||
if (is_cplus_marker (name[0]) && name[1] == 't' && name[2] == 0)
|
||||
name = "this"; /* FIXME, not alloc'd in obstack */
|
||||
name = "this"; /* FIXME, not alloc'd in obstack. */
|
||||
s = new_symbol (name);
|
||||
|
||||
SYMBOL_DOMAIN (s) = VAR_DOMAIN;
|
||||
@ -683,17 +684,17 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
|
||||
add_symbol (s, top_stack->cur_st, top_stack->cur_block);
|
||||
break;
|
||||
|
||||
case stLabel: /* label, goes into current block */
|
||||
case stLabel: /* label, goes into current block. */
|
||||
s = new_symbol (name);
|
||||
SYMBOL_DOMAIN (s) = VAR_DOMAIN; /* so that it can be used */
|
||||
SYMBOL_CLASS (s) = LOC_LABEL; /* but not misused */
|
||||
SYMBOL_DOMAIN (s) = VAR_DOMAIN; /* So that it can be used */
|
||||
SYMBOL_CLASS (s) = LOC_LABEL; /* but not misused. */
|
||||
SYMBOL_VALUE_ADDRESS (s) = (CORE_ADDR) sh->value;
|
||||
SYMBOL_TYPE (s) = objfile_type (objfile)->builtin_int;
|
||||
add_symbol (s, top_stack->cur_st, top_stack->cur_block);
|
||||
break;
|
||||
|
||||
case stProc: /* Procedure, usually goes into global block */
|
||||
case stStaticProc: /* Static procedure, goes into current block */
|
||||
case stProc: /* Procedure, usually goes into global block. */
|
||||
case stStaticProc: /* Static procedure, goes into current block. */
|
||||
/* For stProc symbol records, we need to check the storage class
|
||||
as well, as only (stProc, scText) entries represent "real"
|
||||
procedures - See the Compaq document titled "Object File /
|
||||
@ -729,7 +730,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
|
||||
s = new_symbol (name);
|
||||
SYMBOL_DOMAIN (s) = VAR_DOMAIN;
|
||||
SYMBOL_CLASS (s) = LOC_BLOCK;
|
||||
/* Type of the return value */
|
||||
/* Type of the return value. */
|
||||
if (SC_IS_UNDEF (sh->sc) || sh->sc == scNil)
|
||||
t = objfile_type (objfile)->builtin_int;
|
||||
else
|
||||
@ -746,8 +747,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
|
||||
printf("howdy\n")" would fail with the error message
|
||||
"program has no memory available". To avoid this, we
|
||||
patch up the type and make it void*
|
||||
instead. (davidm@azstarnet.com)
|
||||
*/
|
||||
instead. (davidm@azstarnet.com). */
|
||||
t = make_pointer_type (t, NULL);
|
||||
}
|
||||
}
|
||||
@ -769,7 +769,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
|
||||
}
|
||||
add_symbol (s, top_stack->cur_st, b);
|
||||
|
||||
/* Make a type for the procedure itself */
|
||||
/* Make a type for the procedure itself. */
|
||||
SYMBOL_TYPE (s) = lookup_function_type (t);
|
||||
|
||||
/* All functions in C++ have prototypes. For C we don't have enough
|
||||
@ -777,7 +777,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
|
||||
if (SYMBOL_LANGUAGE (s) == language_cplus)
|
||||
TYPE_PROTOTYPED (SYMBOL_TYPE (s)) = 1;
|
||||
|
||||
/* Create and enter a new lexical context */
|
||||
/* Create and enter a new lexical context. */
|
||||
b = new_block (FUNCTION_BLOCK);
|
||||
SYMBOL_BLOCK_VALUE (s) = b;
|
||||
BLOCK_FUNCTION (b) = s;
|
||||
@ -785,7 +785,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
|
||||
BLOCK_SUPERBLOCK (b) = top_stack->cur_block;
|
||||
add_block (b, top_stack->cur_st);
|
||||
|
||||
/* Not if we only have partial info */
|
||||
/* Not if we only have partial info. */
|
||||
if (SC_IS_UNDEF (sh->sc) || sh->sc == scNil)
|
||||
break;
|
||||
|
||||
@ -807,19 +807,19 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
|
||||
long max_value;
|
||||
struct field *f;
|
||||
|
||||
case stStruct: /* Start a block defining a struct type */
|
||||
case stStruct: /* Start a block defining a struct type. */
|
||||
type_code = TYPE_CODE_STRUCT;
|
||||
goto structured_common;
|
||||
|
||||
case stUnion: /* Start a block defining a union type */
|
||||
case stUnion: /* Start a block defining a union type. */
|
||||
type_code = TYPE_CODE_UNION;
|
||||
goto structured_common;
|
||||
|
||||
case stEnum: /* Start a block defining an enum type */
|
||||
case stEnum: /* Start a block defining an enum type. */
|
||||
type_code = TYPE_CODE_ENUM;
|
||||
goto structured_common;
|
||||
|
||||
case stBlock: /* Either a lexical block, or some type */
|
||||
case stBlock: /* Either a lexical block, or some type. */
|
||||
if (sh->sc != scInfo && !SC_IS_COMMON (sh->sc))
|
||||
goto case_stBlock_code; /* Lexical block */
|
||||
|
||||
@ -1068,7 +1068,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
|
||||
if (unsigned_enum)
|
||||
TYPE_UNSIGNED (t) = 1;
|
||||
}
|
||||
/* make this the current type */
|
||||
/* Make this the current type. */
|
||||
top_stack->cur_type = t;
|
||||
top_stack->cur_field = 0;
|
||||
|
||||
@ -1098,8 +1098,8 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
|
||||
|
||||
case_stBlock_code:
|
||||
found_ecoff_debugging_info = 1;
|
||||
/* beginnning of (code) block. Value of symbol
|
||||
is the displacement from procedure start */
|
||||
/* Beginnning of (code) block. Value of symbol
|
||||
is the displacement from procedure start. */
|
||||
push_parse_stack ();
|
||||
|
||||
/* Do not start a new block if this is the outermost block of a
|
||||
@ -1139,7 +1139,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
|
||||
|
||||
BLOCK_END (top_stack->cur_block) += sh->value; /* size */
|
||||
|
||||
/* Make up special symbol to contain procedure specific info */
|
||||
/* Make up special symbol to contain procedure specific info. */
|
||||
s = new_symbol (MDEBUG_EFI_SYMBOL_NAME);
|
||||
SYMBOL_DOMAIN (s) = LABEL_DOMAIN;
|
||||
SYMBOL_CLASS (s) = LOC_CONST;
|
||||
@ -1223,7 +1223,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
|
||||
complaint (&symfile_complaints,
|
||||
_("stEnd with storage class %d not handled"), sh->sc);
|
||||
|
||||
pop_parse_stack (); /* restore previous lexical context */
|
||||
pop_parse_stack (); /* Restore previous lexical context. */
|
||||
break;
|
||||
|
||||
case stMember: /* member of struct or union */
|
||||
@ -1259,7 +1259,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
|
||||
else
|
||||
t = pend->t;
|
||||
|
||||
/* mips cc puts out a typedef with the name of the struct for forward
|
||||
/* Mips cc puts out a typedef with the name of the struct for forward
|
||||
declarations. These should not go into the symbol table and
|
||||
TYPE_NAME should not be set for them.
|
||||
They can't be distinguished from an intentional typedef to
|
||||
@ -1543,7 +1543,7 @@ parse_type (int fd, union aux_ext *ax, unsigned int aux_index, int *bs,
|
||||
tp = basic_type (t->bt, current_objfile);
|
||||
if (tp == NULL)
|
||||
{
|
||||
/* Cannot use builtin types -- build our own */
|
||||
/* Cannot use builtin types -- build our own. */
|
||||
switch (t->bt)
|
||||
{
|
||||
case btStruct:
|
||||
@ -1577,7 +1577,7 @@ parse_type (int fd, union aux_ext *ax, unsigned int aux_index, int *bs,
|
||||
}
|
||||
}
|
||||
|
||||
/* Move on to next aux */
|
||||
/* Move on to next aux. */
|
||||
ax++;
|
||||
|
||||
if (t->fBitfield)
|
||||
@ -1750,7 +1750,7 @@ parse_type (int fd, union aux_ext *ax, unsigned int aux_index, int *bs,
|
||||
}
|
||||
}
|
||||
|
||||
/* Deal with range types */
|
||||
/* Deal with range types. */
|
||||
if (t->bt == btRange)
|
||||
{
|
||||
TYPE_NFIELDS (tp) = 0;
|
||||
@ -1763,7 +1763,7 @@ parse_type (int fd, union aux_ext *ax, unsigned int aux_index, int *bs,
|
||||
}
|
||||
|
||||
/* Parse all the type qualifiers now. If there are more
|
||||
than 6 the game will continue in the next aux */
|
||||
than 6 the game will continue in the next aux. */
|
||||
|
||||
while (1)
|
||||
{
|
||||
@ -1811,7 +1811,7 @@ upgrade_type (int fd, struct type **tpp, int tq, union aux_ext *ax, int bigend,
|
||||
int off;
|
||||
struct type *t;
|
||||
|
||||
/* Used in array processing */
|
||||
/* Used in array processing. */
|
||||
int rf, id;
|
||||
FDR *fh;
|
||||
struct type *range;
|
||||
@ -1834,7 +1834,7 @@ upgrade_type (int fd, struct type **tpp, int tq, union aux_ext *ax, int bigend,
|
||||
case tqArray:
|
||||
off = 0;
|
||||
|
||||
/* Determine and record the domain type (type of index) */
|
||||
/* Determine and record the domain type (type of index). */
|
||||
(*debug_swap->swap_rndx_in) (bigend, &ax->a_rndx, &rndx);
|
||||
id = rndx.index;
|
||||
rf = rndx.rfd;
|
||||
@ -1930,7 +1930,7 @@ parse_procedure (PDR *pr, struct symtab *search_symtab,
|
||||
struct block *b;
|
||||
char *sh_name;
|
||||
|
||||
/* Simple rule to find files linked "-x" */
|
||||
/* Simple rule to find files linked "-x". */
|
||||
if (cur_fdr->rss == -1)
|
||||
{
|
||||
if (pr->isym == -1)
|
||||
@ -2008,11 +2008,11 @@ parse_procedure (PDR *pr, struct symtab *search_symtab,
|
||||
s = new_symbol (sh_name);
|
||||
SYMBOL_DOMAIN (s) = VAR_DOMAIN;
|
||||
SYMBOL_CLASS (s) = LOC_BLOCK;
|
||||
/* Donno its type, hope int is ok */
|
||||
/* Donno its type, hope int is ok. */
|
||||
SYMBOL_TYPE (s)
|
||||
= lookup_function_type (objfile_type (pst->objfile)->builtin_int);
|
||||
add_symbol (s, top_stack->cur_st, top_stack->cur_block);
|
||||
/* Wont have symbols for this one */
|
||||
/* Won't have symbols for this one. */
|
||||
b = new_block (2);
|
||||
SYMBOL_BLOCK_VALUE (s) = b;
|
||||
BLOCK_FUNCTION (b) = s;
|
||||
@ -2166,7 +2166,7 @@ parse_external (EXTR *es, int bigend, struct section_offsets *section_offsets,
|
||||
GDB's linetable LT. MIPS' encoding requires a little bit
|
||||
of magic to get things out. Note also that MIPS' line
|
||||
numbers can go back and forth, apparently we can live
|
||||
with that and do not need to reorder our linetables */
|
||||
with that and do not need to reorder our linetables. */
|
||||
|
||||
static void parse_lines (FDR *, PDR *, struct linetable *, int,
|
||||
struct partial_symtab *, CORE_ADDR);
|
||||
@ -2182,7 +2182,7 @@ parse_lines (FDR *fh, PDR *pr, struct linetable *lt, int maxlines,
|
||||
if (fh->cbLine == 0)
|
||||
return;
|
||||
|
||||
/* Scan by procedure descriptors */
|
||||
/* Scan by procedure descriptors. */
|
||||
k = 0;
|
||||
for (j = 0; j < fh->cpd; j++, pr++)
|
||||
{
|
||||
@ -2190,7 +2190,7 @@ parse_lines (FDR *fh, PDR *pr, struct linetable *lt, int maxlines,
|
||||
CORE_ADDR adr;
|
||||
unsigned char *halt;
|
||||
|
||||
/* No code for this one */
|
||||
/* No code for this one. */
|
||||
if (pr->iline == ilineNil ||
|
||||
pr->lnLow == -1 || pr->lnHigh == -1)
|
||||
continue;
|
||||
@ -2352,13 +2352,13 @@ parse_partial_symbols (struct objfile *objfile)
|
||||
int textlow_not_set = 1;
|
||||
int past_first_source_file = 0;
|
||||
|
||||
/* List of current psymtab's include files */
|
||||
/* List of current psymtab's include files. */
|
||||
char **psymtab_include_list;
|
||||
int includes_allocated;
|
||||
int includes_used;
|
||||
EXTR *extern_tab;
|
||||
struct pst_map *fdr_to_pst;
|
||||
/* Index within current psymtab dependency list */
|
||||
/* Index within current psymtab dependency list. */
|
||||
struct partial_symtab **dependency_list;
|
||||
int dependencies_used, dependencies_allocated;
|
||||
struct cleanup *old_chain;
|
||||
@ -2409,7 +2409,7 @@ parse_partial_symbols (struct objfile *objfile)
|
||||
|
||||
/* Allocate the map FDR -> PST.
|
||||
Minor hack: -O3 images might claim some global data belongs
|
||||
to FDR -1. We`ll go along with that */
|
||||
to FDR -1. We`ll go along with that. */
|
||||
fdr_to_pst = (struct pst_map *)
|
||||
xzalloc ((hdr->ifdMax + 1) * sizeof *fdr_to_pst);
|
||||
old_chain = make_cleanup (xfree, fdr_to_pst);
|
||||
@ -2439,7 +2439,7 @@ parse_partial_symbols (struct objfile *objfile)
|
||||
for (; ext_out < ext_out_end; ext_out += external_ext_size, ext_in++)
|
||||
(*swap_ext_in) (cur_bfd, ext_out, ext_in);
|
||||
|
||||
/* Pass 1 over external syms: Presize and partition the list */
|
||||
/* Pass 1 over external syms: Presize and partition the list. */
|
||||
ext_in = ext_block;
|
||||
ext_in_end = ext_in + hdr->iextMax;
|
||||
for (; ext_in < ext_in_end; ext_in++)
|
||||
@ -2452,7 +2452,7 @@ parse_partial_symbols (struct objfile *objfile)
|
||||
fdr_to_pst[ext_in->ifd].n_globals++;
|
||||
}
|
||||
|
||||
/* Pass 1.5 over files: partition out global symbol space */
|
||||
/* Pass 1.5 over files: partition out global symbol space. */
|
||||
s_idx = 0;
|
||||
for (f_idx = -1; f_idx < hdr->ifdMax; f_idx++)
|
||||
{
|
||||
@ -2492,7 +2492,7 @@ parse_partial_symbols (struct objfile *objfile)
|
||||
Skip the creation of the minimal symbols based on the ECOFF
|
||||
symbol table. */
|
||||
|
||||
/* Pass 2 over external syms: fill in external symbols */
|
||||
/* Pass 2 over external syms: fill in external symbols. */
|
||||
ext_in = ext_block;
|
||||
ext_in_end = ext_in + hdr->iextMax;
|
||||
for (; ext_in < ext_in_end; ext_in++)
|
||||
@ -2525,10 +2525,10 @@ parse_partial_symbols (struct objfile *objfile)
|
||||
continue;
|
||||
|
||||
|
||||
/* Pass 3 over files, over local syms: fill in static symbols */
|
||||
/* Pass 3 over files, over local syms: fill in static symbols. */
|
||||
name = debug_info->ssext + ext_in->asym.iss;
|
||||
|
||||
/* Process ECOFF Symbol Types and Storage Classes */
|
||||
/* Process ECOFF Symbol Types and Storage Classes. */
|
||||
switch (ext_in->asym.st)
|
||||
{
|
||||
case stProc:
|
||||
@ -2591,8 +2591,7 @@ parse_partial_symbols (struct objfile *objfile)
|
||||
any .data section, although it contains a _fpdata label
|
||||
which storage class is scData... Since these symbols are
|
||||
usually useless for the debugger user anyway, we just
|
||||
discard these symbols.
|
||||
*/
|
||||
discard these symbols. */
|
||||
|
||||
if (SC_IS_TEXT (ext_in->asym.sc))
|
||||
{
|
||||
@ -2653,7 +2652,7 @@ parse_partial_symbols (struct objfile *objfile)
|
||||
objfile);
|
||||
}
|
||||
|
||||
/* Pass 3 over files, over local syms: fill in static symbols */
|
||||
/* Pass 3 over files, over local syms: fill in static symbols. */
|
||||
for (f_idx = 0; f_idx < hdr->ifdMax; f_idx++)
|
||||
{
|
||||
struct partial_symtab *save_pst;
|
||||
@ -2832,7 +2831,7 @@ parse_partial_symbols (struct objfile *objfile)
|
||||
}
|
||||
continue;
|
||||
}
|
||||
/* Handle stabs continuation */
|
||||
/* Handle stabs continuation. */
|
||||
{
|
||||
char *stabstring = debug_info->ss + fh->issBase + sh.iss;
|
||||
int len = strlen (stabstring);
|
||||
@ -2844,10 +2843,10 @@ parse_partial_symbols (struct objfile *objfile)
|
||||
char *stabstring2;
|
||||
int len2;
|
||||
|
||||
/* Ignore continuation char from 1st string */
|
||||
/* Ignore continuation char from 1st string. */
|
||||
len--;
|
||||
|
||||
/* Read next stabstring */
|
||||
/* Read next stabstring. */
|
||||
cur_sdx++;
|
||||
(*swap_sym_in) (cur_bfd,
|
||||
(((char *) debug_info->external_sym)
|
||||
@ -2857,7 +2856,7 @@ parse_partial_symbols (struct objfile *objfile)
|
||||
stabstring2 = debug_info->ss + fh->issBase + sh2.iss;
|
||||
len2 = strlen (stabstring2);
|
||||
|
||||
/* Concatinate stabstring2 with stabstring1 */
|
||||
/* Concatinate stabstring2 with stabstring1. */
|
||||
if (stabstring
|
||||
&& stabstring != debug_info->ss + fh->issBase + sh.iss)
|
||||
stabstring = xrealloc (stabstring, len + len2 + 1);
|
||||
@ -2900,7 +2899,7 @@ parse_partial_symbols (struct objfile *objfile)
|
||||
record_it:
|
||||
continue;
|
||||
|
||||
/* Standard, local, non-debugger, symbols */
|
||||
/* Standard, local, non-debugger, symbols. */
|
||||
|
||||
case N_NBTEXT:
|
||||
|
||||
@ -2921,7 +2920,7 @@ parse_partial_symbols (struct objfile *objfile)
|
||||
goto record_it;
|
||||
|
||||
case N_UNDF | N_EXT:
|
||||
continue; /* Just undefined, not COMMON */
|
||||
continue; /* Just undefined, not COMMON. */
|
||||
|
||||
case N_UNDF:
|
||||
continue;
|
||||
@ -2984,7 +2983,7 @@ parse_partial_symbols (struct objfile *objfile)
|
||||
past_first_source_file = 1;
|
||||
|
||||
if (prev_so_symnum != symnum - 1)
|
||||
{ /* Here if prev stab wasn't N_SO */
|
||||
{ /* Here if prev stab wasn't N_SO. */
|
||||
first_so_symnum = symnum;
|
||||
|
||||
if (pst)
|
||||
@ -2997,7 +2996,8 @@ parse_partial_symbols (struct objfile *objfile)
|
||||
|
||||
prev_so_symnum = symnum;
|
||||
|
||||
/* End the current partial symtab and start a new one */
|
||||
/* End the current partial symtab and start a
|
||||
new one. */
|
||||
|
||||
/* SET_NAMESTRING ();*/
|
||||
namestring = stabstring;
|
||||
@ -3016,7 +3016,7 @@ parse_partial_symbols (struct objfile *objfile)
|
||||
p = strrchr (namestring, '/');
|
||||
if (p && *(p + 1) == '\000')
|
||||
continue; /* Simply ignore directory
|
||||
name SOs */
|
||||
name SOs. */
|
||||
|
||||
/* Some other compilers (C++ ones in particular) emit
|
||||
useless SOs for non-existant .c files. We ignore
|
||||
@ -3035,9 +3035,9 @@ parse_partial_symbols (struct objfile *objfile)
|
||||
{
|
||||
enum language tmp_language;
|
||||
|
||||
/* Mark down an include file in the current psymtab */
|
||||
/* Mark down an include file in the current psymtab. */
|
||||
|
||||
/* SET_NAMESTRING ();*/
|
||||
/* SET_NAMESTRING (); */
|
||||
namestring = stabstring;
|
||||
|
||||
tmp_language
|
||||
@ -3114,7 +3114,7 @@ parse_partial_symbols (struct objfile *objfile)
|
||||
here. */
|
||||
case N_SCOPE: /* Same. */
|
||||
|
||||
/* SET_NAMESTRING ();*/
|
||||
/* SET_NAMESTRING (); */
|
||||
namestring = stabstring;
|
||||
p = (char *) strchr (namestring, ':');
|
||||
if (!p)
|
||||
@ -3149,8 +3149,9 @@ parse_partial_symbols (struct objfile *objfile)
|
||||
case 'G':
|
||||
sh.value += ANOFFSET (objfile->section_offsets,
|
||||
SECT_OFF_DATA (objfile));
|
||||
/* The addresses in these entries are reported to be
|
||||
wrong. See the code that reads 'G's for symtabs. */
|
||||
/* The addresses in these entries are reported
|
||||
to be wrong. See the code that reads 'G's
|
||||
for symtabs. */
|
||||
add_psymbol_to_list (namestring, p - namestring, 1,
|
||||
VAR_DOMAIN, LOC_STATIC,
|
||||
&objfile->global_psymbols,
|
||||
@ -3405,7 +3406,7 @@ parse_partial_symbols (struct objfile *objfile)
|
||||
case N_ENTRY: /* Alternate entry point; can
|
||||
ignore. */
|
||||
case N_MAIN: /* Can definitely ignore this. */
|
||||
case N_CATCH: /* These are GNU C++ extensions */
|
||||
case N_CATCH: /* These are GNU C++ extensions. */
|
||||
case N_EHDECL: /* that can safely be ignored here. */
|
||||
case N_LENG:
|
||||
case N_BCOMM:
|
||||
@ -3421,10 +3422,10 @@ parse_partial_symbols (struct objfile *objfile)
|
||||
case N_ALIAS: /* SunPro F77: alias name, ignore
|
||||
for now. */
|
||||
|
||||
case N_OBJ: /* useless types from Solaris */
|
||||
case N_OBJ: /* Useless types from Solaris. */
|
||||
case N_OPT:
|
||||
/* These symbols aren't interesting; don't worry about
|
||||
them */
|
||||
them. */
|
||||
|
||||
continue;
|
||||
|
||||
@ -3433,7 +3434,7 @@ parse_partial_symbols (struct objfile *objfile)
|
||||
probably some new type we don't know about yet. */
|
||||
complaint (&symfile_complaints,
|
||||
_("unknown symbol type %s"),
|
||||
hex_string (type_code)); /*CUR_SYMBOL_TYPE*/
|
||||
hex_string (type_code)); /* CUR_SYMBOL_TYPE */
|
||||
continue;
|
||||
}
|
||||
if (stabstring
|
||||
@ -3520,7 +3521,7 @@ parse_partial_symbols (struct objfile *objfile)
|
||||
/* Should not happen, but does when cross-compiling
|
||||
with the MIPS compiler. FIXME -- pull later. */
|
||||
index_complaint (name);
|
||||
new_sdx = cur_sdx + 1; /* Don't skip at all */
|
||||
new_sdx = cur_sdx + 1; /* Don't skip at all. */
|
||||
}
|
||||
else
|
||||
new_sdx = AUX_GET_ISYM (fh->fBigendian,
|
||||
@ -3534,7 +3535,7 @@ parse_partial_symbols (struct objfile *objfile)
|
||||
complaint (&symfile_complaints,
|
||||
_("bad proc end in aux found from symbol %s"),
|
||||
name);
|
||||
new_sdx = cur_sdx + 1; /* Don't skip backward */
|
||||
new_sdx = cur_sdx + 1; /* Don't skip backward. */
|
||||
}
|
||||
|
||||
/* For stProc symbol records, we need to check the
|
||||
@ -3607,7 +3608,7 @@ parse_partial_symbols (struct objfile *objfile)
|
||||
break;
|
||||
|
||||
case stIndirect: /* Irix5 forward declaration */
|
||||
/* Skip forward declarations from Irix5 cc */
|
||||
/* Skip forward declarations from Irix5 cc. */
|
||||
goto skip;
|
||||
|
||||
case stTypedef: /* Typedef */
|
||||
@ -3641,14 +3642,14 @@ parse_partial_symbols (struct objfile *objfile)
|
||||
}
|
||||
handle_psymbol_enumerators (objfile, fh, sh.st, sh.value);
|
||||
|
||||
/* Skip over the block */
|
||||
/* Skip over the block. */
|
||||
new_sdx = sh.index;
|
||||
if (new_sdx <= cur_sdx)
|
||||
{
|
||||
/* This happens with the Ultrix kernel. */
|
||||
complaint (&symfile_complaints,
|
||||
_("bad aux index at block symbol %s"), name);
|
||||
new_sdx = cur_sdx + 1; /* Don't skip backward */
|
||||
new_sdx = cur_sdx + 1; /* Don't skip backward. */
|
||||
}
|
||||
cur_sdx = new_sdx;
|
||||
continue;
|
||||
@ -3673,13 +3674,13 @@ parse_partial_symbols (struct objfile *objfile)
|
||||
cur_sdx++;
|
||||
continue;
|
||||
}
|
||||
/* Use this gdb symbol */
|
||||
/* Use this gdb symbol. */
|
||||
add_psymbol_to_list (name, strlen (name), 1,
|
||||
VAR_DOMAIN, class,
|
||||
&objfile->static_psymbols,
|
||||
0, sh.value, psymtab_language, objfile);
|
||||
skip:
|
||||
cur_sdx++; /* Go to next file symbol */
|
||||
cur_sdx++; /* Go to next file symbol. */
|
||||
}
|
||||
|
||||
/* Now do enter the external symbols. */
|
||||
@ -3801,7 +3802,7 @@ parse_partial_symbols (struct objfile *objfile)
|
||||
}
|
||||
}
|
||||
|
||||
/* Now scan the FDRs for dependencies */
|
||||
/* Now scan the FDRs for dependencies. */
|
||||
for (f_idx = 0; f_idx < hdr->ifdMax; f_idx++)
|
||||
{
|
||||
fh = f_idx + debug_info->fdr;
|
||||
@ -3989,7 +3990,7 @@ psymtab_to_symtab_1 (struct partial_symtab *pst, const char *filename)
|
||||
wrap_here (""); /* Flush output */
|
||||
gdb_flush (gdb_stdout);
|
||||
}
|
||||
/* We only pass the filename for debug purposes */
|
||||
/* We only pass the filename for debug purposes. */
|
||||
psymtab_to_symtab_1 (pst->dependencies[i],
|
||||
pst->dependencies[i]->filename);
|
||||
}
|
||||
@ -4000,7 +4001,7 @@ psymtab_to_symtab_1 (struct partial_symtab *pst, const char *filename)
|
||||
&& pst->textlow == 0 && pst->texthigh == 0)
|
||||
return;
|
||||
|
||||
/* Now read the symbols for this symtab */
|
||||
/* Now read the symbols for this symtab. */
|
||||
|
||||
cur_bfd = CUR_BFD (pst);
|
||||
debug_swap = DEBUG_SWAP (pst);
|
||||
@ -4042,9 +4043,9 @@ psymtab_to_symtab_1 (struct partial_symtab *pst, const char *filename)
|
||||
|
||||
/* This symbol table contains stabs-in-ecoff entries. */
|
||||
|
||||
/* Parse local symbols first */
|
||||
/* Parse local symbols first. */
|
||||
|
||||
if (fh->csym <= 2) /* FIXME, this blows psymtab->symtab ptr */
|
||||
if (fh->csym <= 2) /* FIXME, this blows psymtab->symtab ptr. */
|
||||
{
|
||||
current_objfile = NULL;
|
||||
return;
|
||||
@ -4105,7 +4106,7 @@ psymtab_to_symtab_1 (struct partial_symtab *pst, const char *filename)
|
||||
if (type_code == N_FUN)
|
||||
{
|
||||
/* Make up special symbol to contain
|
||||
procedure specific info */
|
||||
procedure specific info. */
|
||||
struct mdebug_extra_func_info *e =
|
||||
((struct mdebug_extra_func_info *)
|
||||
obstack_alloc (¤t_objfile->objfile_obstack,
|
||||
@ -4140,7 +4141,7 @@ psymtab_to_symtab_1 (struct partial_symtab *pst, const char *filename)
|
||||
}
|
||||
else if (sh.st == stProc || sh.st == stStaticProc
|
||||
|| sh.st == stStatic || sh.st == stEnd)
|
||||
/* These are generated by gcc-2.x, do not complain */
|
||||
/* These are generated by gcc-2.x, do not complain. */
|
||||
;
|
||||
else
|
||||
complaint (&symfile_complaints,
|
||||
@ -4225,7 +4226,7 @@ psymtab_to_symtab_1 (struct partial_symtab *pst, const char *filename)
|
||||
|
||||
lines = LINETABLE (st);
|
||||
|
||||
/* Get a new lexical context */
|
||||
/* Get a new lexical context. */
|
||||
|
||||
push_parse_stack ();
|
||||
top_stack->cur_st = st;
|
||||
@ -4244,7 +4245,7 @@ psymtab_to_symtab_1 (struct partial_symtab *pst, const char *filename)
|
||||
char *sym_ptr;
|
||||
char *sym_end;
|
||||
|
||||
/* Parse local symbols first */
|
||||
/* Parse local symbols first. */
|
||||
sym_ptr = ((char *) debug_info->external_sym
|
||||
+ fh->isymBase * external_sym_size);
|
||||
sym_end = sym_ptr + fh->csym * external_sym_size;
|
||||
@ -4313,7 +4314,7 @@ psymtab_to_symtab_1 (struct partial_symtab *pst, const char *filename)
|
||||
LINETABLE (st) = lines;
|
||||
|
||||
/* .. and our share of externals.
|
||||
XXX use the global list to speed up things here. how?
|
||||
XXX use the global list to speed up things here. How?
|
||||
FIXME, Maybe quit once we have found the right number of ext's? */
|
||||
top_stack->cur_st = st;
|
||||
top_stack->cur_block
|
||||
@ -4408,7 +4409,7 @@ cross_ref (int fd, union aux_ext *ax, struct type **tpp,
|
||||
|
||||
(*debug_swap->swap_rndx_in) (bigend, &ax->a_rndx, rn);
|
||||
|
||||
/* Escape index means 'the next one' */
|
||||
/* Escape index means 'the next one'. */
|
||||
if (rn->rfd == 0xfff)
|
||||
{
|
||||
result++;
|
||||
@ -4588,7 +4589,7 @@ cross_ref (int fd, union aux_ext *ax, struct type **tpp,
|
||||
|
||||
|
||||
/* Quick&dirty lookup procedure, to avoid the MI ones that require
|
||||
keeping the symtab sorted */
|
||||
keeping the symtab sorted. */
|
||||
|
||||
static struct symbol *
|
||||
mylookup_symbol (char *name, struct block *block,
|
||||
@ -4624,7 +4625,7 @@ add_symbol (struct symbol *s, struct symtab *symtab, struct block *b)
|
||||
dict_add_symbol (BLOCK_DICT (b), s);
|
||||
}
|
||||
|
||||
/* Add a new block B to a symtab S */
|
||||
/* Add a new block B to a symtab S. */
|
||||
|
||||
static void
|
||||
add_block (struct block *b, struct symtab *s)
|
||||
@ -4664,9 +4665,9 @@ add_line (struct linetable *lt, int lineno, CORE_ADDR adr, int last)
|
||||
if (lineno == 0)
|
||||
lineno = 1;
|
||||
if (last == 0)
|
||||
last = -2; /* make sure we record first line */
|
||||
last = -2; /* Make sure we record first line. */
|
||||
|
||||
if (last == lineno) /* skip continuation lines */
|
||||
if (last == lineno) /* Skip continuation lines. */
|
||||
return lineno;
|
||||
|
||||
lt->item[lt->nitems].line = lineno;
|
||||
@ -4674,9 +4675,9 @@ add_line (struct linetable *lt, int lineno, CORE_ADDR adr, int last)
|
||||
return lineno;
|
||||
}
|
||||
|
||||
/* Sorting and reordering procedures */
|
||||
/* Sorting and reordering procedures. */
|
||||
|
||||
/* Blocks with a smaller low bound should come first */
|
||||
/* Blocks with a smaller low bound should come first. */
|
||||
|
||||
static int
|
||||
compare_blocks (const void *arg1, const void *arg2)
|
||||
@ -4693,7 +4694,7 @@ compare_blocks (const void *arg1, const void *arg2)
|
||||
|
||||
/* Sort the blocks of a symtab S.
|
||||
Reorder the blocks in the blockvector by code-address,
|
||||
as required by some MI search routines */
|
||||
as required by some MI search routines. */
|
||||
|
||||
static void
|
||||
sort_blocks (struct symtab *s)
|
||||
@ -4741,10 +4742,10 @@ sort_blocks (struct symtab *s)
|
||||
}
|
||||
|
||||
|
||||
/* Constructor/restructor/destructor procedures */
|
||||
/* Constructor/restructor/destructor procedures. */
|
||||
|
||||
/* Allocate a new symtab for NAME. Needs an estimate of how many
|
||||
linenumbers MAXLINES we'll put in it */
|
||||
linenumbers MAXLINES we'll put in it. */
|
||||
|
||||
static struct symtab *
|
||||
new_symtab (const char *name, int maxlines, struct objfile *objfile)
|
||||
@ -4753,7 +4754,7 @@ new_symtab (const char *name, int maxlines, struct objfile *objfile)
|
||||
|
||||
LINETABLE (s) = new_linetable (maxlines);
|
||||
|
||||
/* All symtabs must have at least two blocks */
|
||||
/* All symtabs must have at least two blocks. */
|
||||
BLOCKVECTOR (s) = new_bvect (2);
|
||||
BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), GLOBAL_BLOCK)
|
||||
= new_block (NON_FUNCTION_BLOCK);
|
||||
@ -4767,7 +4768,7 @@ new_symtab (const char *name, int maxlines, struct objfile *objfile)
|
||||
return (s);
|
||||
}
|
||||
|
||||
/* Allocate a new partial_symtab NAME */
|
||||
/* Allocate a new partial_symtab NAME. */
|
||||
|
||||
static struct partial_symtab *
|
||||
new_psymtab (char *name, struct objfile *objfile)
|
||||
@ -4777,7 +4778,7 @@ new_psymtab (char *name, struct objfile *objfile)
|
||||
psymtab = allocate_psymtab (name, objfile);
|
||||
psymtab->section_offsets = objfile->section_offsets;
|
||||
|
||||
/* Keep a backpointer to the file's symbols */
|
||||
/* Keep a backpointer to the file's symbols. */
|
||||
|
||||
psymtab->read_symtab_private = obstack_alloc (&objfile->objfile_obstack,
|
||||
sizeof (struct symloc));
|
||||
@ -4860,7 +4861,7 @@ new_block (enum block_type type)
|
||||
return retval;
|
||||
}
|
||||
|
||||
/* Create a new symbol with printname NAME */
|
||||
/* Create a new symbol with printname NAME. */
|
||||
|
||||
static struct symbol *
|
||||
new_symbol (char *name)
|
||||
@ -4875,7 +4876,7 @@ new_symbol (char *name)
|
||||
return s;
|
||||
}
|
||||
|
||||
/* Create a new type with printname NAME */
|
||||
/* Create a new type with printname NAME. */
|
||||
|
||||
static struct type *
|
||||
new_type (char *name)
|
||||
|
@ -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)
|
||||
|
@ -66,7 +66,7 @@ struct mem_attrib
|
||||
/* enables host-side caching of memory region data */
|
||||
int cache;
|
||||
|
||||
/* enables memory verification. after a write, memory is re-read
|
||||
/* Enables memory verification. After a write, memory is re-read
|
||||
to verify that the write was successful. */
|
||||
int verify;
|
||||
|
||||
@ -85,10 +85,11 @@ struct mem_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
|
||||
|
@ -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++)
|
||||
|
@ -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,
|
||||
|
@ -522,8 +522,8 @@ lookup_minimal_symbol_by_pc_section_1 (CORE_ADDR pc,
|
||||
{
|
||||
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))
|
||||
@ -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)
|
||||
@ -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. */
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
217
gdb/mips-tdep.c
217
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)
|
||||
|
||||
@ -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);
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
@ -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 */
|
||||
@ -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,9 +1358,9 @@ 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)
|
||||
{
|
||||
@ -1365,9 +1368,9 @@ unpack_mips16 (struct gdbarch *gdbarch, CORE_ADDR pc,
|
||||
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;
|
||||
@ -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 */
|
||||
@ -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;
|
||||
}
|
||||
@ -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;
|
||||
@ -2110,7 +2116,7 @@ restart:
|
||||
|| 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
|
||||
@ -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;
|
||||
|
||||
@ -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 */
|
||||
{
|
||||
@ -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);
|
||||
}
|
||||
@ -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);
|
||||
}
|
||||
@ -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. */
|
||||
@ -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;
|
||||
@ -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. */
|
||||
|
||||
@ -4818,13 +4834,13 @@ print_gp_register_row (struct ui_file *file, struct frame_info *frame,
|
||||
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);
|
||||
@ -5070,8 +5086,8 @@ 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",
|
||||
printf_unfiltered ("The MIPS floating-point coprocessor "
|
||||
"is set automatically (currently %s)\n",
|
||||
fpu);
|
||||
else
|
||||
printf_unfiltered
|
||||
@ -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)
|
||||
{
|
||||
@ -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);
|
||||
}
|
||||
@ -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);
|
||||
@ -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,7 +6564,9 @@ 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. */
|
||||
@ -6552,6 +6576,7 @@ 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);
|
||||
}
|
||||
|
@ -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. */
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
};
|
||||
|
||||
|
@ -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));
|
||||
|
||||
}
|
||||
|
@ -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;
|
||||
|
162
gdb/monitor.c
162
gdb/monitor.c
@ -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];
|
||||
@ -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)
|
||||
{
|
||||
@ -619,7 +618,7 @@ 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... */
|
||||
@ -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,7 +791,7 @@ 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,
|
||||
@ -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,7 +1104,7 @@ 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
|
||||
@ -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)
|
||||
{
|
||||
@ -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;
|
||||
@ -1682,8 +1681,7 @@ monitor_write_memory_longlongs (CORE_ADDR memaddr, char *myaddr, int len)
|
||||
! 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.
|
||||
*/
|
||||
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)
|
||||
{
|
||||
@ -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);
|
||||
|
||||
@ -1866,8 +1864,7 @@ monitor_read_memory (CORE_ADDR memaddr, char *myaddr, int len)
|
||||
|
||||
/* Some dumpers align the first data with the preceeding 16
|
||||
byte boundary. Some print blanks and start at the
|
||||
requested boundary. EXACT_DUMPADDR
|
||||
*/
|
||||
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)
|
||||
{
|
||||
@ -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)
|
||||
@ -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));
|
||||
@ -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
|
||||
@ -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
|
||||
|
||||
@ -237,8 +236,8 @@ struct monitor_ops
|
||||
we can save time by transferring the whole block without exiting
|
||||
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
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user