From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 105648 invoked by alias); 5 Dec 2017 17:06:50 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 105580 invoked by uid 89); 5 Dec 2017 17:06:50 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.0 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy=Hx-languages-length:2510 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 17:06:49 +0000 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id vB5H6DdL093899 for ; Tue, 5 Dec 2017 12:06:47 -0500 Received: from e06smtp14.uk.ibm.com (e06smtp14.uk.ibm.com [195.75.94.110]) by mx0a-001b2d01.pphosted.com with ESMTP id 2envgpjhq0-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 05 Dec 2017 12:06:47 -0500 Received: from localhost by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 5 Dec 2017 17:06:45 -0000 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp14.uk.ibm.com (192.168.101.144) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 5 Dec 2017 17:06:43 -0000 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id vB5H6hGH47644740; Tue, 5 Dec 2017 17:06:43 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 864FAAE053; Tue, 5 Dec 2017 16:59:41 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 633A8AE045; Tue, 5 Dec 2017 16:59:41 +0000 (GMT) Received: from ThinkPad (unknown [9.152.212.148]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 5 Dec 2017 16:59:41 +0000 (GMT) Date: Tue, 05 Dec 2017 17:06:00 -0000 From: Philipp Rudo To: "Ulrich Weigand" Cc: gdb-patches@sourceware.org, arnez@linux.vnet.ibm.com (Andreas Arnez) Subject: Re: [PATCH v2 07/11] s390: Hook s390 into OSABI mechanism In-Reply-To: <20171205132055.C7002D80330@oc3748833570.ibm.com> References: <20171205122859.2919-8-prudo@linux.vnet.ibm.com> <20171205132055.C7002D80330@oc3748833570.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 17120517-0016-0000-0000-000005099EC9 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17120517-0017-0000-0000-000028459A42 Message-Id: <20171205180640.6677e975@ThinkPad> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-12-05_05:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 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-1712050246 X-IsSubscribed: yes X-SW-Source: 2017-12/txt/msg00111.txt.bz2 Hi Uli, On Tue, 5 Dec 2017 14:20:55 +0100 (CET) "Ulrich Weigand" wrote: > Philipp Rudo wrote: > > Just a couple of quick comments on the common vs. Linux split. > > > + set_gdbarch_guess_tracepoint_registers (gdbarch, > > + s390_guess_tracepoint_registers); > > This is OS-independent as far as I can see. Ok, I'll move it back. > > + /* Frame handling. */ > > + frame_unwind_append_unwinder (gdbarch, &s390_stub_frame_unwind); > > + frame_unwind_append_unwinder (gdbarch, &s390_sigtramp_frame_unwind); > > + frame_unwind_append_unwinder (gdbarch, &s390_frame_unwind); > > + frame_base_set_default (gdbarch, &s390_frame_base); > > All of that *except* the sigtramp unwinder is OS-independent. In fact, > if move the prolog-based sniffer to common code, you'll see that you no > longer need to export various internal routines from s390-tdep.c to > s390-linux-tdep.c. > > This may require swapping the order of the stub and the sigtramp unwinder, > but that should be harmless. In the end you should have this sequence: > > - first, in common code, announce all the DWARF-based unwinders > - then, in Linux ABI code, announce the sigtramp unwinder > - finally, back in common code, announce all the fallback unwinders That's not true. At least for the kernel the unwinders (except the DWARF-based) failed and I had to write my own one. Especially the fact that the kernel has multiple stack locations and no distinct 'End of Stack' caused problems. However if I go with your approach and add my unwinder in the kernel ABI code as default, i.e. that it always catches the call, it should work. But that won't be nice code. That's why I moved them to the Linux ABI. > > set_gdbarch_process_record (gdbarch, s390_process_record); > > set_gdbarch_process_record_signal (gdbarch, s390_linux_record_signal); > > The first of these should be generic, only the second is Linux specific > (that's why there are two different callbacks to begin with!). Ok, I'll move the first one back. > > + /* Miscellaneous. */ > > + set_gdbarch_stap_is_single_operand (gdbarch, s390_stap_is_single_operand); > > + set_gdbarch_gcc_target_options (gdbarch, s390_gcc_target_options); > > + set_gdbarch_gnu_triplet_regexp (gdbarch, s390_gnu_triplet_regexp); > > Are these really Linux-specific? No, not really. They should be common for the architecture for all systems with working GDB/GCC/BFD. I'll move them to the common file. Thanks Philipp