/* Target-dependent code for the Tilera TILE-Gx processor.
- Copyright (C) 2012-2015 Free Software Foundation, Inc.
+ Copyright (C) 2012-2016 Free Software Foundation, Inc.
This file is part of GDB.
#include "solib-svr4.h"
#include "tilegx-tdep.h"
#include "opcode/tilegx.h"
+#include <algorithm>
struct tilegx_frame_cache
{
CORE_ADDR stack_dest = sp;
int argreg = TILEGX_R0_REGNUM;
int i, j;
- int typelen, slacklen, alignlen;
+ int typelen, slacklen;
static const gdb_byte four_zero_words[16] = { 0 };
/* If struct_return is 1, then the struct return address will
typelen = TYPE_LENGTH (value_enclosing_type (args[j]));
slacklen = align_up (typelen, 8) - typelen;
- val = xmalloc (typelen + slacklen);
+ val = (gdb_byte *) xmalloc (typelen + slacklen);
back_to = make_cleanup (xfree, val);
memcpy (val, contents, typelen);
memset (val + typelen, 0, slacklen);
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
CORE_ADDR next_addr;
CORE_ADDR prolog_end = end_addr;
- ULONGEST inst, inst2;
- LONGEST offset;
- int regnum;
gdb_byte instbuf[32 * TILEGX_BUNDLE_SIZE_IN_BYTES];
CORE_ADDR instbuf_start;
unsigned int instbuf_size;
if (instbuf_size > size_on_same_page)
instbuf_size = size_on_same_page;
- instbuf_size = min (instbuf_size, (end_addr - next_addr));
+ instbuf_size = std::min ((CORE_ADDR) instbuf_size,
+ (end_addr - next_addr));
instbuf_start = next_addr;
status = safe_frame_unwind_memory (next_frame, instbuf_start,
for (i = 0; i < num_insns; i++)
{
struct tilegx_decoded_instruction *this_insn = &decoded[i];
- int64_t *operands = (int64_t *) this_insn->operand_values;
+ long long *operands = this_insn->operand_values;
const struct tilegx_opcode *opcode = this_insn->opcode;
switch (opcode->mnemonic)
= skip_prologue_using_sal (gdbarch, func_start);
if (post_prologue_pc != 0)
- return max (start_pc, post_prologue_pc);
+ return std::max (start_pc, post_prologue_pc);
}
/* Don't straddle a section boundary. */
s = find_pc_section (start_pc);
end_pc = start_pc + 8 * TILEGX_BUNDLE_SIZE_IN_BYTES;
if (s != NULL)
- end_pc = min (end_pc, obj_section_endaddr (s));
+ end_pc = std::min (end_pc, obj_section_endaddr (s));
/* Otherwise, try to skip prologue the hard way. */
return tilegx_analyze_prologue (gdbarch,
if (find_pc_partial_function (pc, NULL, &func_addr, &func_end))
{
- ULONGEST inst, inst2;
CORE_ADDR addr = func_end - TILEGX_BUNDLE_SIZE_IN_BYTES;
/* FIXME: Find the actual epilogue. */
struct gdbarch *gdbarch = get_frame_arch (this_frame);
struct tilegx_frame_cache *cache;
CORE_ADDR current_pc;
- int i;
if (*this_cache)
- return *this_cache;
+ return (struct tilegx_frame_cache *) *this_cache;
cache = FRAME_OBSTACK_ZALLOC (struct tilegx_frame_cache);
*this_cache = cache;