From patchwork Tue Dec 5 12:28:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Rudo X-Patchwork-Id: 24734 Received: (qmail 45308 invoked by alias); 5 Dec 2017 12:29:55 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 45169 invoked by uid 89); 5 Dec 2017 12:29:55 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 spammy= X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0a-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.156.1) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 05 Dec 2017 12:29:53 +0000 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id vB5CTaGa059731 for ; Tue, 5 Dec 2017 07:29:52 -0500 Received: from e06smtp12.uk.ibm.com (e06smtp12.uk.ibm.com [195.75.94.108]) by mx0a-001b2d01.pphosted.com with ESMTP id 2enrfrhm7e-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 05 Dec 2017 07:29:49 -0500 Received: from localhost by e06smtp12.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 5 Dec 2017 12:29:14 -0000 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp12.uk.ibm.com (192.168.101.142) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 5 Dec 2017 12:29:12 -0000 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id vB5CTCfo39190654; Tue, 5 Dec 2017 12:29:12 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 45CB94C052; Tue, 5 Dec 2017 12:24:04 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 126264C044; Tue, 5 Dec 2017 12:24:04 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Tue, 5 Dec 2017 12:24:04 +0000 (GMT) From: Philipp Rudo To: gdb-patches@sourceware.org Cc: Andreas Arnez , Ulrich Weigand Subject: [PATCH v2 10/11] s390: Add comments to uncommented functions in s390-tdep.c Date: Tue, 5 Dec 2017 13:28:58 +0100 In-Reply-To: <20171205122859.2919-1-prudo@linux.vnet.ibm.com> References: <20171205122859.2919-1-prudo@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 17120512-0008-0000-0000-000004B38C45 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17120512-0009-0000-0000-00001E467FD1 Message-Id: <20171205122859.2919-11-prudo@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-12-05_04:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1712050180 X-IsSubscribed: yes 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,