Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
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 11/11] s390: Add comments to uncommented functions in s390-linux-tdep.c
Date: Tue, 05 Dec 2017 12:29:00 -0000	[thread overview]
Message-ID: <20171205122859.2919-12-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
the left functions are lacking a description.  Fix that now.

gdb/ChangeLog:
	* s390-linux-tdep.c: Add comments to uncommented functions
---
 gdb/s390-linux-tdep.c | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 61 insertions(+)

diff --git a/gdb/s390-linux-tdep.c b/gdb/s390-linux-tdep.c
index 497f02303b..a815724e4d 100644
--- a/gdb/s390-linux-tdep.c
+++ b/gdb/s390-linux-tdep.c
@@ -63,6 +63,11 @@
 #define XML_SYSCALL_FILENAME_S390 "syscalls/s390-linux.xml"
 #define XML_SYSCALL_FILENAME_S390X "syscalls/s390x-linux.xml"
 
+
+/* Register handling.  */
+
+/* Implement cannot_store_register gdbarch method.  */
+
 static int
 s390_cannot_store_register (struct gdbarch *gdbarch, int regnum)
 {
@@ -70,6 +75,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)
 {
@@ -356,6 +363,8 @@ s390_iterate_over_regset_sections (struct gdbarch *gdbarch,
     }
 }
 
+/* Implement core_read_description gdbarch method.  */
+
 static const struct target_desc *
 s390_core_read_description (struct gdbarch *gdbarch,
 			    struct target_ops *target, bfd *abfd)
@@ -403,6 +412,11 @@ s390_core_read_description (struct gdbarch *gdbarch,
     }
 }
 
+/* Frame unwinding. */
+
+/* Wrapper for trad_frame_get_prev_register to allow for s390 pseudo
+   register translation.  */
+
 static struct value *
 s390_trad_frame_prev_register (struct frame_info *this_frame,
 			       struct trad_frame_saved_reg saved_regs[],
@@ -425,6 +439,9 @@ struct s390_unwind_cache {
   struct trad_frame_saved_reg *saved_regs;
 };
 
+/* Unwind THIS_FRAME and write the information into unwind cache INFO using
+   prologue analysis.  Helper for s390_frame_unwind_cache.  */
+
 static int
 s390_prologue_frame_unwind_cache (struct frame_info *this_frame,
 				  struct s390_unwind_cache *info)
@@ -609,6 +626,9 @@ s390_prologue_frame_unwind_cache (struct frame_info *this_frame,
   return 1;
 }
 
+/* Unwind THIS_FRAME and write the information into unwind cache INFO using
+   back chain unwinding.  Helper for s390_frame_unwind_cache.  */
+
 static void
 s390_backchain_frame_unwind_cache (struct frame_info *this_frame,
 				   struct s390_unwind_cache *info)
@@ -663,6 +683,9 @@ s390_backchain_frame_unwind_cache (struct frame_info *this_frame,
   info->func = get_frame_pc (this_frame);
 }
 
+/* Unwind THIS_FRAME and return the corresponding unwind cache for
+   s390_frame_unwind and s390_frame_base.  */
+
 static struct s390_unwind_cache *
 s390_frame_unwind_cache (struct frame_info *this_frame,
 			 void **this_prologue_cache)
@@ -696,6 +719,8 @@ s390_frame_unwind_cache (struct frame_info *this_frame,
   return info;
 }
 
+/* Implement this_id frame_unwind method for s390_frame_unwind.  */
+
 static void
 s390_frame_this_id (struct frame_info *this_frame,
 		    void **this_prologue_cache,
@@ -714,6 +739,8 @@ s390_frame_this_id (struct frame_info *this_frame,
   *this_id = frame_id_build (info->frame_base, info->func);
 }
 
+/* Implement prev_register frame_unwind method for s390_frame_unwind.  */
+
 static struct value *
 s390_frame_prev_register (struct frame_info *this_frame,
 			  void **this_prologue_cache, int regnum)
@@ -724,6 +751,8 @@ s390_frame_prev_register (struct frame_info *this_frame,
   return s390_trad_frame_prev_register (this_frame, info->saved_regs, regnum);
 }
 
+/* Default S390 frame unwinder.  */
+
 static const struct frame_unwind s390_frame_unwind = {
   NORMAL_FRAME,
   default_frame_unwind_stop_reason,
@@ -743,6 +772,9 @@ struct s390_stub_unwind_cache
   struct trad_frame_saved_reg *saved_regs;
 };
 
+/* Unwind THIS_FRAME and return the corresponding unwind cache for
+   s390_stub_frame_unwind.  */
+
 static struct s390_stub_unwind_cache *
 s390_stub_frame_unwind_cache (struct frame_info *this_frame,
 			      void **this_prologue_cache)
@@ -769,6 +801,8 @@ s390_stub_frame_unwind_cache (struct frame_info *this_frame,
   return info;
 }
 
+/* Implement this_id frame_unwind method for s390_stub_frame_unwind.  */
+
 static void
 s390_stub_frame_this_id (struct frame_info *this_frame,
 			 void **this_prologue_cache,
@@ -779,6 +813,8 @@ s390_stub_frame_this_id (struct frame_info *this_frame,
   *this_id = frame_id_build (info->frame_base, get_frame_pc (this_frame));
 }
 
+/* Implement prev_register frame_unwind method for s390_stub_frame_unwind.  */
+
 static struct value *
 s390_stub_frame_prev_register (struct frame_info *this_frame,
 			       void **this_prologue_cache, int regnum)
@@ -788,6 +824,8 @@ s390_stub_frame_prev_register (struct frame_info *this_frame,
   return s390_trad_frame_prev_register (this_frame, info->saved_regs, regnum);
 }
 
+/* Implement sniffer frame_unwind method for s390_stub_frame_unwind.  */
+
 static int
 s390_stub_frame_sniffer (const struct frame_unwind *self,
 			 struct frame_info *this_frame,
@@ -806,6 +844,8 @@ s390_stub_frame_sniffer (const struct frame_unwind *self,
   return 0;
 }
 
+/* S390 stub frame unwinder.  */
+
 static const struct frame_unwind s390_stub_frame_unwind = {
   NORMAL_FRAME,
   default_frame_unwind_stop_reason,
@@ -822,6 +862,9 @@ struct s390_sigtramp_unwind_cache {
   struct trad_frame_saved_reg *saved_regs;
 };
 
+/* Unwind THIS_FRAME and return the corresponding unwind cache for
+   s390_sigtramp_frame_unwind.  */
+
 static struct s390_sigtramp_unwind_cache *
 s390_sigtramp_frame_unwind_cache (struct frame_info *this_frame,
 				  void **this_prologue_cache)
@@ -930,6 +973,8 @@ s390_sigtramp_frame_unwind_cache (struct frame_info *this_frame,
   return info;
 }
 
+/* Implement this_id frame_unwind method for s390_sigtramp_frame_unwind.  */
+
 static void
 s390_sigtramp_frame_this_id (struct frame_info *this_frame,
 			     void **this_prologue_cache,
@@ -940,6 +985,8 @@ s390_sigtramp_frame_this_id (struct frame_info *this_frame,
   *this_id = frame_id_build (info->frame_base, get_frame_pc (this_frame));
 }
 
+/* Implement prev_register frame_unwind method for sigtramp frames.  */
+
 static struct value *
 s390_sigtramp_frame_prev_register (struct frame_info *this_frame,
 				   void **this_prologue_cache, int regnum)
@@ -949,6 +996,8 @@ s390_sigtramp_frame_prev_register (struct frame_info *this_frame,
   return s390_trad_frame_prev_register (this_frame, info->saved_regs, regnum);
 }
 
+/* Implement sniffer frame_unwind method for sigtramp frames.  */
+
 static int
 s390_sigtramp_frame_sniffer (const struct frame_unwind *self,
 			     struct frame_info *this_frame,
@@ -970,6 +1019,8 @@ s390_sigtramp_frame_sniffer (const struct frame_unwind *self,
   return 1;
 }
 
+/* S390 sigtramp frame unwinder.  */
+
 static const struct frame_unwind s390_sigtramp_frame_unwind = {
   SIGTRAMP_FRAME,
   default_frame_unwind_stop_reason,
@@ -1077,6 +1128,9 @@ s390_all_but_pc_registers_record (struct regcache *regcache)
   return 0;
 }
 
+/* Canonicalize system call SYSCALL belonging to ABI.  Helper for
+   s390_linux_syscall_record.  */
+
 static enum gdb_syscall
 s390_canonicalize_syscall (int syscall, enum s390_abi_kind abi)
 {
@@ -1245,6 +1299,9 @@ s390_canonicalize_syscall (int syscall, enum s390_abi_kind abi)
     }
 }
 
+/* Record a system call.  Returns 0 on success, -1 otherwise.
+   Helper function for s390_process_record.  */
+
 static int
 s390_linux_syscall_record (struct regcache *regcache, LONGEST syscall_native)
 {
@@ -1293,6 +1350,8 @@ s390_linux_syscall_record (struct regcache *regcache, LONGEST syscall_native)
   return 0;
 }
 
+/* Implement process_record_signal gdbarch method.  */
+
 static int
 s390_linux_record_signal (struct gdbarch *gdbarch, struct regcache *regcache,
                           enum gdb_signal signal)
@@ -1496,6 +1555,8 @@ s390_record_vr (struct gdbarch *gdbarch, struct regcache *regcache, int i)
   return 0;
 }
 
+/* Implement process_record gdbarch method.  */
+
 static int
 s390_process_record (struct gdbarch *gdbarch, struct regcache *regcache,
                     CORE_ADDR addr)
-- 
2.13.5


  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 05/11] s390: Move tdesc validation to separate function 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 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 ` Philipp Rudo [this message]
2017-12-05 12:29 ` [PATCH v2 10/11] s390: Add comments to uncommented functions in s390-tdep.c 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 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 06/11] s390: if -> gdb_assert for tdesc_has_registers check 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-12-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