/* Target-dependent code for the S12Z, for the GDB.
- Copyright (C) 2018-2020 Free Software Foundation, Inc.
+ Copyright (C) 2018-2021 Free Software Foundation, Inc.
This file is part of GDB.
#include "defs.h"
#include "arch-utils.h"
-#include "dwarf2-frame.h"
+#include "dwarf2/frame.h"
#include "gdbsupport/errors.h"
#include "frame-unwind.h"
#include "gdbcore.h"
CORE_ADDR prologue_end = skip_prologue_using_sal (gdbarch, pc);
if (prologue_end != 0)
- return prologue_end;
+ return prologue_end;
}
warning (_("%s Failed to find end of prologue PC = %08x"),
if (start_addr == 0)
{
warning (_("Couldn't find function including address %s SP is %s"),
- paddress (gdbarch, this_pc),
- paddress (gdbarch, this_sp));
+ paddress (gdbarch, this_pc),
+ paddress (gdbarch, this_sp));
/* JPB: 28-Apr-11. This is a temporary patch, to get round GDB
crashing right at the beginning. Build the frame ID as best we
{
/* Only do if executing. */
if (0 != this_sp)
- {
- this_sp_for_id = this_sp - frame_size;
- trad_frame_set_this_base (info, this_sp_for_id);
- }
+ {
+ this_sp_for_id = this_sp - frame_size;
+ trad_frame_set_this_base (info, this_sp_for_id);
+ }
trad_frame_set_reg_value (info, REG_S, this_sp + 3);
trad_frame_set_reg_addr (info, REG_P, this_sp);
}
{
gdb_assert (this_sp == this_sp_for_id);
/* The stack pointer of the prev frame is frame_size greater
- than the stack pointer of this frame plus one address
- size (caused by the JSR or BSR). */
+ than the stack pointer of this frame plus one address
+ size (caused by the JSR or BSR). */
trad_frame_set_reg_value (info, REG_S,
- this_sp + frame_size + 3);
+ this_sp + frame_size + 3);
trad_frame_set_reg_addr (info, REG_P, this_sp + frame_size);
}
0xD0. */
static void
s12z_print_ccw_info (struct gdbarch *gdbarch,
- struct ui_file *file,
- struct frame_info *frame,
- int reg)
+ struct ui_file *file,
+ struct frame_info *frame,
+ int reg)
{
struct value *v = value_of_register (reg, frame);
const char *name = gdbarch_register_name (gdbarch, reg);
for (int b = 15; b >= 0; --b)
{
if (ccw & (0x1u << b))
- {
- if (ccw_bits[b] == 0)
- fputc_filtered ('1', file);
- else
- fputc_filtered (ccw_bits[b], file);
- }
+ {
+ if (ccw_bits[b] == 0)
+ fputc_filtered ('1', file);
+ else
+ fputc_filtered (ccw_bits[b], file);
+ }
else
- fputc_filtered (tolower (ccw_bits[b]), file);
+ fputc_filtered (tolower (ccw_bits[b]), file);
}
fputc_filtered ('\n', file);
}
if (regnum == -1)
{
for (int reg = 0; reg < numregs; reg++)
- {
- if (REG_CCW == reg_perm[reg])
- {
- s12z_print_ccw_info (gdbarch, file, frame, reg);
- continue;
- }
- default_print_registers_info (gdbarch, file, frame, reg, print_all);
- }
+ {
+ if (REG_CCW == reg_perm[reg])
+ {
+ s12z_print_ccw_info (gdbarch, file, frame, reg);
+ continue;
+ }
+ default_print_registers_info (gdbarch, file, frame, reg, print_all);
+ }
}
else if (REG_CCW == reg_perm[regnum])
s12z_print_ccw_info (gdbarch, file, frame, regnum);
static void
s12z_extract_return_value (struct type *type, struct regcache *regcache,
- void *valbuf)
+ void *valbuf)
{
int reg = -1;
static enum return_value_convention
s12z_return_value (struct gdbarch *gdbarch, struct value *function,
- struct type *type, struct regcache *regcache,
- gdb_byte *readbuf, const gdb_byte *writebuf)
+ struct type *type, struct regcache *regcache,
+ gdb_byte *readbuf, const gdb_byte *writebuf)
{
- if (TYPE_CODE (type) == TYPE_CODE_STRUCT
- || TYPE_CODE (type) == TYPE_CODE_UNION
- || TYPE_CODE (type) == TYPE_CODE_ARRAY
+ if (type->code () == TYPE_CODE_STRUCT
+ || type->code () == TYPE_CODE_UNION
+ || type->code () == TYPE_CODE_ARRAY
|| TYPE_LENGTH (type) > 4)
return RETURN_VALUE_STRUCT_CONVENTION;
add_cmd ("bdccsr", class_support, show_bdccsr_command,
_("Show the current value of the microcontroller's BDCCSR."),
- &maintenanceinfolist);
+ &maintenanceinfolist);
/* Target data types. */
set_gdbarch_short_bit (gdbarch, 16);
return gdbarch;
}
+void _initialize_s12z_tdep ();
void
-_initialize_s12z_tdep (void)
+_initialize_s12z_tdep ()
{
gdbarch_register (bfd_arch_s12z, s12z_gdbarch_init, NULL);
}