Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(856)

Unified Diff: gdb/sh64-tdep.c

Issue 124383005: GDB 7.6.50 (Closed) Base URL: http://git.chromium.org/native_client/nacl-gdb.git@upstream
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gdb/sh64-tdep.h ('k') | gdb/shnbsd-nat.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gdb/sh64-tdep.c
diff --git a/gdb/sh64-tdep.c b/gdb/sh64-tdep.c
index 4e6f262462a7b700b43d32e0171a3cac9e23b65a..79dde80778dd66d5ea0a6e7e2399a0fedcdb65ae 100644
--- a/gdb/sh64-tdep.c
+++ b/gdb/sh64-tdep.c
@@ -1,6 +1,6 @@
/* Target-dependent code for Renesas Super-H, for GDB.
- Copyright (C) 1993-2005, 2007-2012 Free Software Foundation, Inc.
+ Copyright (C) 1993-2013 Free Software Foundation, Inc.
This file is part of GDB.
@@ -32,7 +32,7 @@
#include "value.h"
#include "dis-asm.h"
#include "inferior.h"
-#include "gdb_string.h"
+#include <string.h>
#include "gdb_assert.h"
#include "arch-utils.h"
#include "regcache.h"
@@ -237,7 +237,7 @@ sh64_elf_make_msymbol_special (asymbol *sym, struct minimal_symbol *msym)
static int
pc_is_isa32 (bfd_vma memaddr)
{
- struct minimal_symbol *sym;
+ struct bound_minimal_symbol sym;
/* If bit 0 of the address is set, assume this is a
ISA32 (shmedia) address. */
@@ -248,8 +248,8 @@ pc_is_isa32 (bfd_vma memaddr)
the high bit of the info field. Use this to decide if the function is
ISA16 or ISA32. */
sym = lookup_minimal_symbol_by_pc (memaddr);
- if (sym)
- return MSYMBOL_IS_SPECIAL (sym);
+ if (sym.minsym)
+ return MSYMBOL_IS_SPECIAL (sym.minsym);
else
return 0;
}
@@ -1067,8 +1067,8 @@ sh64_push_dummy_call (struct gdbarch *gdbarch,
int argnum;
struct type *type;
CORE_ADDR regval;
- char *val;
- char valbuf[8];
+ const gdb_byte *val;
+ gdb_byte valbuf[8];
int len;
int argreg_size;
int fp_args[12];
@@ -1113,22 +1113,21 @@ sh64_push_dummy_call (struct gdbarch *gdbarch,
/* value gets right-justified in the register or stack word. */
if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG)
memcpy (valbuf + argreg_size - len,
- (char *) value_contents (args[argnum]), len);
+ value_contents (args[argnum]), len);
else
- memcpy (valbuf, (char *) value_contents (args[argnum]), len);
+ memcpy (valbuf, value_contents (args[argnum]), len);
val = valbuf;
}
else
- val = (char *) value_contents (args[argnum]);
+ val = value_contents (args[argnum]);
while (len > 0)
{
if (int_argreg > ARGLAST_REGNUM)
{
/* Must go on the stack. */
- write_memory (sp + stack_offset, (const bfd_byte *) val,
- argreg_size);
+ write_memory (sp + stack_offset, val, argreg_size);
stack_offset += 8;/*argreg_size;*/
}
/* NOTE WELL!!!!! This is not an "else if" clause!!!
@@ -1153,7 +1152,7 @@ sh64_push_dummy_call (struct gdbarch *gdbarch,
}
else
{
- val = (char *) value_contents (args[argnum]);
+ val = value_contents (args[argnum]);
if (len == 4)
{
/* Where is it going to be stored? */
@@ -1175,10 +1174,10 @@ sh64_push_dummy_call (struct gdbarch *gdbarch,
int_argreg ++;
}
else
- ;
- /* Store it as the integers, 8 bytes at the time, if
- necessary spilling on the stack. */
-
+ {
+ /* Store it as the integers, 8 bytes at the time, if
+ necessary spilling on the stack. */
+ }
}
else if (len == 8)
{
@@ -1202,9 +1201,10 @@ sh64_push_dummy_call (struct gdbarch *gdbarch,
int_argreg ++;
}
else
- ;
- /* Store it as the integers, 8 bytes at the time, if
- necessary spilling on the stack. */
+ {
+ /* Store it as the integers, 8 bytes at the time, if
+ necessary spilling on the stack. */
+ }
}
}
}
@@ -1260,7 +1260,7 @@ sh64_extract_return_value (struct type *type, struct regcache *regcache,
if (len <= 8)
{
int offset;
- char buf[8];
+ gdb_byte buf[8];
/* Result is in register 2. If smaller than 8 bytes, it is padded
at the most significant end. */
regcache_raw_read (regcache, DEFAULT_RETURN_REGNUM, buf);
@@ -1286,10 +1286,10 @@ sh64_extract_return_value (struct type *type, struct regcache *regcache,
static void
sh64_store_return_value (struct type *type, struct regcache *regcache,
- const void *valbuf)
+ const gdb_byte *valbuf)
{
struct gdbarch *gdbarch = get_regcache_arch (regcache);
- char buf[64]; /* more than enough... */
+ gdb_byte buf[64]; /* more than enough... */
int len = TYPE_LENGTH (type);
if (TYPE_CODE (type) == TYPE_CODE_FLT)
@@ -1298,9 +1298,9 @@ sh64_store_return_value (struct type *type, struct regcache *regcache,
for (i = 0; i < len; i += 4)
if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_LITTLE)
regcache_raw_write (regcache, regnum++,
- (char *) valbuf + len - 4 - i);
+ valbuf + len - 4 - i);
else
- regcache_raw_write (regcache, regnum++, (char *) valbuf + i);
+ regcache_raw_write (regcache, regnum++, valbuf + i);
}
else
{
@@ -1448,7 +1448,7 @@ sh64_register_type (struct gdbarch *gdbarch, int reg_nr)
static void
sh64_register_convert_to_virtual (struct gdbarch *gdbarch, int regnum,
- struct type *type, char *from, char *to)
+ struct type *type, gdb_byte *from, gdb_byte *to)
{
if (gdbarch_byte_order (gdbarch) != BFD_ENDIAN_LITTLE)
{
@@ -1529,7 +1529,7 @@ sh64_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
int base_regnum;
int offset = 0;
- char temp_buffer[MAX_REGISTER_SIZE];
+ gdb_byte temp_buffer[MAX_REGISTER_SIZE];
enum register_status status;
if (reg_nr >= DR0_REGNUM
@@ -1705,7 +1705,7 @@ sh64_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
int base_regnum, portion;
int offset;
- char temp_buffer[MAX_REGISTER_SIZE];
+ gdb_byte temp_buffer[MAX_REGISTER_SIZE];
if (reg_nr >= DR0_REGNUM
&& reg_nr <= DR_LAST_REGNUM)
@@ -1720,7 +1720,7 @@ sh64_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
for (portion = 0; portion < 2; portion++)
regcache_raw_write (regcache, base_regnum + portion,
(temp_buffer
- + register_size (gdbarch,
+ + register_size (gdbarch,
base_regnum) * portion));
}
@@ -1732,9 +1732,8 @@ sh64_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
/* Write the real regs for which this one is an alias. */
for (portion = 0; portion < 2; portion++)
regcache_raw_write (regcache, base_regnum + portion,
- ((char *) buffer
- + register_size (gdbarch,
- base_regnum) * portion));
+ (buffer + register_size (gdbarch,
+ base_regnum) * portion));
}
else if (reg_nr >= FV0_REGNUM
@@ -1745,9 +1744,8 @@ sh64_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
/* Write the real regs for which this one is an alias. */
for (portion = 0; portion < 4; portion++)
regcache_raw_write (regcache, base_regnum + portion,
- ((char *) buffer
- + register_size (gdbarch,
- base_regnum) * portion));
+ (buffer + register_size (gdbarch,
+ base_regnum) * portion));
}
/* sh compact general pseudo registers. 1-to-1 with a shmedia
@@ -1806,7 +1804,7 @@ sh64_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
for (portion = 0; portion < 4; portion++)
{
regcache_raw_write (regcache, base_regnum + portion,
- ((char *) buffer
+ (buffer
+ register_size (gdbarch,
base_regnum) * portion));
}
@@ -1930,7 +1928,7 @@ sh64_do_fp_register (struct gdbarch *gdbarch, struct ui_file *file,
alloca (register_size (gdbarch, gdbarch_fp0_regnum (gdbarch)));
/* Get the data in raw format. */
- if (!frame_register_read (frame, regnum, raw_buffer))
+ if (!deprecated_frame_register_read (frame, regnum, raw_buffer))
error (_("can't read register %d (%s)"),
regnum, gdbarch_register_name (gdbarch, regnum));
@@ -1950,14 +1948,10 @@ sh64_do_fp_register (struct gdbarch *gdbarch, struct ui_file *file,
fprintf_filtered (file, "%-10.9g", flt);
/* Print the fp register as hex. */
- fprintf_filtered (file, "\t(raw 0x");
- for (j = 0; j < register_size (gdbarch, regnum); j++)
- {
- int idx = gdbarch_byte_order (gdbarch)
- == BFD_ENDIAN_BIG ? j : register_size
- (gdbarch, regnum) - 1 - j;
- fprintf_filtered (file, "%02x", raw_buffer[idx]);
- }
+ fprintf_filtered (file, "\t(raw ");
+ print_hex_chars (file, raw_buffer,
+ register_size (gdbarch, regnum),
+ gdbarch_byte_order (gdbarch));
fprintf_filtered (file, ")");
fprintf_filtered (file, "\n");
}
@@ -2046,8 +2040,11 @@ sh64_do_register (struct gdbarch *gdbarch, struct ui_file *file,
(gdbarch, regnum)), file);
/* Get the data in raw format. */
- if (!frame_register_read (frame, regnum, raw_buffer))
- fprintf_filtered (file, "*value not available*\n");
+ if (!deprecated_frame_register_read (frame, regnum, raw_buffer))
+ {
+ fprintf_filtered (file, "*value not available*\n");
+ return;
+ }
get_formatted_print_options (&opts, 'x');
opts.deref_ref = 1;
« no previous file with comments | « gdb/sh64-tdep.h ('k') | gdb/shnbsd-nat.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698