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

Unified Diff: gdb/avr-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/auxv.c ('k') | gdb/ax.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gdb/avr-tdep.c
diff --git a/gdb/avr-tdep.c b/gdb/avr-tdep.c
index 864d2880027ffd8c7cc6f3b77ae4c19bc5f3ff0e..6d243c476e2b0e83a365eed9f70f39673642d338 100644
--- a/gdb/avr-tdep.c
+++ b/gdb/avr-tdep.c
@@ -1,6 +1,6 @@
/* Target-dependent code for Atmel AVR, for GDB.
- Copyright (C) 1996-2012 Free Software Foundation, Inc.
+ Copyright (C) 1996-2013 Free Software Foundation, Inc.
This file is part of GDB.
@@ -34,7 +34,7 @@
#include "symfile.h"
#include "arch-utils.h"
#include "regcache.h"
-#include "gdb_string.h"
+#include <string.h>
#include "dis-asm.h"
/* AVR Background:
@@ -68,9 +68,6 @@
via the remote serial protocol. The extra bits are the MSBs and are used to
decode which memory space the address is referring to. */
-#undef XMALLOC
-#define XMALLOC(TYPE) ((TYPE*) xmalloc (sizeof (TYPE)))
-
/* Constants: prefixed with AVR_ to avoid name space clashes */
enum
@@ -1103,7 +1100,7 @@ avr_frame_prev_register (struct frame_info *this_frame,
everything else about the avr is little endian. Ick! */
ULONGEST pc;
int i;
- unsigned char buf[3];
+ gdb_byte buf[3];
struct gdbarch *gdbarch = get_frame_arch (this_frame);
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
@@ -1245,7 +1242,7 @@ avr_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
{
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
int i;
- unsigned char buf[3];
+ gdb_byte buf[3];
int call_length = gdbarch_tdep (gdbarch)->call_length;
CORE_ADDR return_pc = avr_convert_iaddr_to_raw (bp_addr);
int regnum = AVR_ARGN_REGNUM;
@@ -1468,8 +1465,9 @@ avr_io_reg_read_command (char *args, int from_tty)
{
LONGEST bufsiz = 0;
gdb_byte *buf;
+ const char *bufstr;
char query[400];
- char *p;
+ const char *p;
unsigned int nreg = 0;
unsigned int val;
int i, j, k, step;
@@ -1477,6 +1475,7 @@ avr_io_reg_read_command (char *args, int from_tty)
/* Find out how many io registers the target has. */
bufsiz = target_read_alloc (&current_target, TARGET_OBJECT_AVR,
"avr.io_reg", &buf);
+ bufstr = (const char *) buf;
if (bufsiz <= 0)
{
@@ -1486,7 +1485,7 @@ avr_io_reg_read_command (char *args, int from_tty)
return;
}
- if (sscanf (buf, "%x", &nreg) != 1)
+ if (sscanf (bufstr, "%x", &nreg) != 1)
{
fprintf_unfiltered (gdb_stderr,
_("Error fetching number of io registers\n"));
@@ -1514,7 +1513,7 @@ avr_io_reg_read_command (char *args, int from_tty)
bufsiz = target_read_alloc (&current_target, TARGET_OBJECT_AVR,
query, &buf);
- p = buf;
+ p = (const char *) buf;
for (k = i; k < (i + j); k++)
{
if (sscanf (p, "%[^,],%x;", query, &val) == 2)
« no previous file with comments | « gdb/auxv.c ('k') | gdb/ax.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698