From patchwork Tue Dec 5 12:28:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Rudo X-Patchwork-Id: 24729 Received: (qmail 37616 invoked by alias); 5 Dec 2017 12:29:23 -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 37450 invoked by uid 89); 5 Dec 2017 12:29:22 -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=41211, 7398, belonging 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:20 +0000 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id vB5CSrIP103972 for ; Tue, 5 Dec 2017 07:29:19 -0500 Received: from e06smtp13.uk.ibm.com (e06smtp13.uk.ibm.com [195.75.94.109]) by mx0a-001b2d01.pphosted.com with ESMTP id 2entf5u9q9-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 05 Dec 2017 07:29:18 -0500 Received: from localhost by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 5 Dec 2017 12:29:16 -0000 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp13.uk.ibm.com (192.168.101.143) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 5 Dec 2017 12:29:14 -0000 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id vB5CTDr555246920; Tue, 5 Dec 2017 12:29:13 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 863364C052; Tue, 5 Dec 2017 12:24:05 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 525EC4C046; Tue, 5 Dec 2017 12:24:05 +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:05 +0000 (GMT) From: Philipp Rudo To: gdb-patches@sourceware.org Cc: Andreas Arnez , Ulrich Weigand Subject: [PATCH v2 11/11] s390: Add comments to uncommented functions in s390-linux-tdep.c Date: Tue, 5 Dec 2017 13:28:59 +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-0012-0000-0000-000005958B50 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17120512-0013-0000-0000-0000191088A7 Message-Id: <20171205122859.2919-12-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 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)