This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 3/4] Add comments to uncommented functions in s390-tdep.c


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 | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 53 insertions(+), 2 deletions(-)

diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c
index 849ddc7cfa..de81add604 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,7 @@ 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,
@@ -116,6 +119,7 @@ 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)
@@ -130,6 +134,7 @@ 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)
@@ -145,6 +150,7 @@ 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,
@@ -162,6 +168,7 @@ 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,
@@ -182,6 +189,7 @@ 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,
@@ -199,6 +207,7 @@ 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,
@@ -533,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)
@@ -1009,6 +1020,8 @@ s390_register_name (struct gdbarch *gdbarch, int regnum)
   return tdesc_register_name (gdbarch, regnum);
 }
 
+/* Implement cannot_store_register gdbarch method.  */
+
 static int
 s390_cannot_store_register (struct gdbarch *gdbarch, int regnum)
 {
@@ -1016,6 +1029,8 @@ s390_cannot_store_register (struct gdbarch *gdbarch, int regnum)
   return regnum == S390_LAST_BREAK_REGNUM;
 }
 
+/* Implement write_pc gdbarch method.  */
+
 static void
 s390_write_pc (struct regcache *regcache, CORE_ADDR pc)
 {
@@ -1121,6 +1136,9 @@ s390_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int reg)
 
 /* Pseudo register handling.  */
 
+/* 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)
 {
@@ -1162,6 +1180,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)
 {
@@ -1194,6 +1214,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)
 {
@@ -1214,6 +1236,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)
@@ -1288,6 +1312,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)
@@ -1345,6 +1371,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)
@@ -1522,12 +1550,18 @@ const struct regset s390_vxrs_high_regset = {
 
 /* 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)
 {
@@ -1537,6 +1571,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)
 {
@@ -1546,6 +1583,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,
@@ -1928,6 +1968,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)
 {
@@ -2056,7 +2098,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
@@ -2100,6 +2142,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)
 {
@@ -2109,6 +2153,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)
 {
@@ -2187,6 +2233,9 @@ s390_adjust_frame_regnum (struct gdbarch *gdbarch, int num, int eh_frame_p)
 
 /* DWARF2 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)
@@ -2194,6 +2243,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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]