From: Philipp Rudo <prudo@linux.vnet.ibm.com>
To: gdb-patches@sourceware.org
Cc: Andreas Arnez <arnez@linux.vnet.ibm.com>,
Ulrich Weigand <uweigand@de.ibm.com>
Subject: [PATCH v2 10/11] s390: Add comments to uncommented functions in s390-tdep.c
Date: Tue, 05 Dec 2017 12:29:00 -0000 [thread overview]
Message-ID: <20171205122859.2919-11-prudo@linux.vnet.ibm.com> (raw)
In-Reply-To: <20171205122859.2919-1-prudo@linux.vnet.ibm.com>
Moving common functions from s390-linux-tdep to s390-tdep showed that some
of them are lacking a description. Fix that now.
gdb/ChangeLog:
* s390-tdep.c: Add comments to uncommented functions
---
gdb/s390-tdep.c | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 56 insertions(+), 2 deletions(-)
diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c
index 0961c5d8c7..8b05dfc130 100644
--- a/gdb/s390-tdep.c
+++ b/gdb/s390-tdep.c
@@ -79,7 +79,9 @@ s390_readinstruction (bfd_byte instr[], CORE_ADDR at)
come first, even though they're sometimes scattered around the
instructions. And displacements appear before base and extension
registers, as they do in the assembly syntax, not at the end, as
- they do in the machine language. */
+ they do in the machine language.
+
+ Test for RI instruction format. */
static int
is_ri (bfd_byte *insn, int op1, int op2, unsigned int *r1, int *i2)
@@ -95,6 +97,8 @@ is_ri (bfd_byte *insn, int op1, int op2, unsigned int *r1, int *i2)
return 0;
}
+/* Test for RIL instruction format. See comment on is_ri for details. */
+
static int
is_ril (bfd_byte *insn, int op1, int op2,
unsigned int *r1, int *i2)
@@ -115,6 +119,8 @@ is_ril (bfd_byte *insn, int op1, int op2,
return 0;
}
+/* Test for RR instruction format. See comment on is_ri for details. */
+
static int
is_rr (bfd_byte *insn, int op, unsigned int *r1, unsigned int *r2)
{
@@ -128,6 +134,8 @@ is_rr (bfd_byte *insn, int op, unsigned int *r1, unsigned int *r2)
return 0;
}
+/* Test for RRE instruction format. See comment on is_ri for details. */
+
static int
is_rre (bfd_byte *insn, int op, unsigned int *r1, unsigned int *r2)
{
@@ -142,6 +150,8 @@ is_rre (bfd_byte *insn, int op, unsigned int *r1, unsigned int *r2)
return 0;
}
+/* Test for RS instruction format. See comment on is_ri for details. */
+
static int
is_rs (bfd_byte *insn, int op,
unsigned int *r1, unsigned int *r3, int *d2, unsigned int *b2)
@@ -158,6 +168,8 @@ is_rs (bfd_byte *insn, int op,
return 0;
}
+/* Test for RSY instruction format. See comment on is_ri for details. */
+
static int
is_rsy (bfd_byte *insn, int op1, int op2,
unsigned int *r1, unsigned int *r3, int *d2, unsigned int *b2)
@@ -177,6 +189,8 @@ is_rsy (bfd_byte *insn, int op1, int op2,
return 0;
}
+/* Test for RX instruction format. See comment on is_ri for details. */
+
static int
is_rx (bfd_byte *insn, int op,
unsigned int *r1, int *d2, unsigned int *x2, unsigned int *b2)
@@ -193,6 +207,8 @@ is_rx (bfd_byte *insn, int op,
return 0;
}
+/* Test for RXY instruction format. See comment on is_ri for details. */
+
static int
is_rxy (bfd_byte *insn, int op1, int op2,
unsigned int *r1, int *d2, unsigned int *x2, unsigned int *b2)
@@ -526,6 +542,8 @@ s390_displaced_step_fixup (struct gdbarch *gdbarch,
paddress (gdbarch, regcache_read_pc (regs)));
}
+/* Implement displaced_step_hw_singlestep gdbarch method. */
+
static int
s390_displaced_step_hw_singlestep (struct gdbarch *gdbarch,
struct displaced_step_closure *closure)
@@ -1088,6 +1106,9 @@ s390_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int reg)
/* Pseudo registers. */
+/* Check whether REGNUM indicates a coupled general purpose register.
+ These pseudo-registers are composed of two adjacent gprs. */
+
static int
regnum_is_gpr_full (struct gdbarch_tdep *tdep, int regnum)
{
@@ -1129,6 +1150,8 @@ s390_value_from_register (struct gdbarch *gdbarch, struct type *type,
return value;
}
+/* Implement pseudo_register_name tdesc method. */
+
static const char *
s390_pseudo_register_name (struct gdbarch *gdbarch, int regnum)
{
@@ -1161,6 +1184,8 @@ s390_pseudo_register_name (struct gdbarch *gdbarch, int regnum)
internal_error (__FILE__, __LINE__, _("invalid regnum"));
}
+/* Implement pseudo_register_type tdesc method. */
+
static struct type *
s390_pseudo_register_type (struct gdbarch *gdbarch, int regnum)
{
@@ -1181,6 +1206,8 @@ s390_pseudo_register_type (struct gdbarch *gdbarch, int regnum)
internal_error (__FILE__, __LINE__, _("invalid regnum"));
}
+/* Implement pseudo_register_read gdbarch method. */
+
static enum register_status
s390_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
int regnum, gdb_byte *buf)
@@ -1255,6 +1282,8 @@ s390_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
internal_error (__FILE__, __LINE__, _("invalid regnum"));
}
+/* Implement pseudo_register_write gdbarch method. */
+
static void
s390_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
int regnum, const gdb_byte *buf)
@@ -1312,6 +1341,8 @@ s390_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
/* Register groups. */
+/* Implement pseudo_register_reggroup_p tdesc method. */
+
static int
s390_pseudo_register_reggroup_p (struct gdbarch *gdbarch, int regnum,
struct reggroup *group)
@@ -1435,12 +1466,18 @@ s390_gen_return_address (struct gdbarch *gdbarch,
/* Address handling. */
+/* Implement addr_bits_remove gdbarch method.
+ Only used for ABI_LINUX_S390. */
+
static CORE_ADDR
s390_addr_bits_remove (struct gdbarch *gdbarch, CORE_ADDR addr)
{
return addr & 0x7fffffff;
}
+/* Implement addr_class_type_flags gdbarch method.
+ Only used for ABI_LINUX_ZSERIES. */
+
static int
s390_address_class_type_flags (int byte_size, int dwarf2_addr_class)
{
@@ -1450,6 +1487,9 @@ s390_address_class_type_flags (int byte_size, int dwarf2_addr_class)
return 0;
}
+/* Implement addr_class_type_flags_to_name gdbarch method.
+ Only used for ABI_LINUX_ZSERIES. */
+
static const char *
s390_address_class_type_flags_to_name (struct gdbarch *gdbarch, int type_flags)
{
@@ -1459,6 +1499,9 @@ s390_address_class_type_flags_to_name (struct gdbarch *gdbarch, int type_flags)
return NULL;
}
+/* Implement addr_class_name_to_type_flags gdbarch method.
+ Only used for ABI_LINUX_ZSERIES. */
+
static int
s390_address_class_name_to_type_flags (struct gdbarch *gdbarch,
const char *name,
@@ -1842,6 +1885,8 @@ s390_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame)
get_frame_pc (this_frame));
}
+/* Implement frame_align gdbarch method. */
+
static CORE_ADDR
s390_frame_align (struct gdbarch *gdbarch, CORE_ADDR addr)
{
@@ -1970,7 +2015,7 @@ s390_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc)
{
int word_size = gdbarch_ptr_bit (gdbarch) / 8;
- /* In frameless functions, there's not frame to destroy and thus
+ /* In frameless functions, there's no frame to destroy and thus
we don't care about the epilogue.
In functions with frame, the epilogue sequence is a pair of
@@ -2014,6 +2059,8 @@ s390_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc)
return 0;
}
+/* Implement unwind_pc gdbarch method. */
+
static CORE_ADDR
s390_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
{
@@ -2023,6 +2070,8 @@ s390_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
return gdbarch_addr_bits_remove (gdbarch, pc);
}
+/* Implement unwind_sp gdbarch method. */
+
static CORE_ADDR
s390_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame)
{
@@ -2101,6 +2150,9 @@ s390_adjust_frame_regnum (struct gdbarch *gdbarch, int num, int eh_frame_p)
/* DWARF-2 frame unwinding. */
+/* Function to unwind a pseudo-register in dwarf2_frame unwinder. Used by
+ s390_dwarf2_frame_init_reg. */
+
static struct value *
s390_dwarf2_prev_register (struct frame_info *this_frame, void **this_cache,
int regnum)
@@ -2108,6 +2160,8 @@ s390_dwarf2_prev_register (struct frame_info *this_frame, void **this_cache,
return s390_unwind_pseudo_register (this_frame, regnum);
}
+/* Implement init_reg dwarf2_frame method. */
+
static void
s390_dwarf2_frame_init_reg (struct gdbarch *gdbarch, int regnum,
struct dwarf2_frame_state_reg *reg,
--
2.13.5
next prev parent reply other threads:[~2017-12-05 12:29 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-05 12:29 [PATCH v2 00/11] Split up s390-linux-tdep.c Philipp Rudo
2017-12-05 12:29 ` [PATCH v2 06/11] s390: if -> gdb_assert for tdesc_has_registers check Philipp Rudo
2017-12-05 12:29 ` [PATCH v2 07/11] s390: Hook s390 into OSABI mechanism Philipp Rudo
2017-12-05 13:21 ` Ulrich Weigand
2017-12-05 17:06 ` Philipp Rudo
2017-12-05 17:44 ` Ulrich Weigand
2017-12-06 11:39 ` Philipp Rudo
2017-12-05 12:29 ` [PATCH v2 01/11] s390: Remove duplicate checks for cached gdbarch at init Philipp Rudo
2017-12-05 16:16 ` Yao Qi
2017-12-06 9:56 ` Philipp Rudo
2017-12-06 10:28 ` [PATCH v2 01/11] s390: Remove duplicate checks for cached gdbarch@init Ulrich Weigand
2017-12-07 9:18 ` Philipp Rudo
2017-12-07 9:59 ` Yao Qi
2017-12-05 12:29 ` [PATCH v2 03/11] s390: gdbarch_tdep.have_* int -> bool Philipp Rudo
2017-12-05 12:29 ` [PATCH v2 11/11] s390: Add comments to uncommented functions in s390-linux-tdep.c Philipp Rudo
2017-12-05 12:29 ` Philipp Rudo [this message]
2017-12-05 12:29 ` [PATCH v2 02/11] s390: Allocate gdbarch & tdep at start of gdbarch init Philipp Rudo
2017-12-05 12:29 ` [PATCH v2 04/11] s390: gdbarch_tdep add field tdesc Philipp Rudo
2017-12-05 12:29 ` [PATCH v2 09/11] s390: Clean up s390-linux-tdep.c Philipp Rudo
2017-12-05 12:29 ` [PATCH v2 05/11] s390: Move tdesc validation to separate function Philipp Rudo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171205122859.2919-11-prudo@linux.vnet.ibm.com \
--to=prudo@linux.vnet.ibm.com \
--cc=arnez@linux.vnet.ibm.com \
--cc=gdb-patches@sourceware.org \
--cc=uweigand@de.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox