From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3861 invoked by alias); 12 Mar 2018 15:31:27 -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 3826 invoked by uid 89); 12 Mar 2018 15:31:26 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-8.3 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 spammy=Hx-languages-length:4039 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; Mon, 12 Mar 2018 15:31:24 +0000 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w2CFUKFx069220 for ; Mon, 12 Mar 2018 11:31:23 -0400 Received: from e06smtp15.uk.ibm.com (e06smtp15.uk.ibm.com [195.75.94.111]) by mx0a-001b2d01.pphosted.com with ESMTP id 2gnut5sj3q-1 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT) for ; Mon, 12 Mar 2018 11:31:22 -0400 Received: from localhost by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 12 Mar 2018 15:31:19 -0000 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp15.uk.ibm.com (192.168.101.145) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 12 Mar 2018 15:31:17 -0000 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w2CFVGXa065850; Mon, 12 Mar 2018 15:31:16 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D8DEF52041; Mon, 12 Mar 2018 14:22:48 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTPS id 9BC275204B; Mon, 12 Mar 2018 14:22:48 +0000 (GMT) From: Philipp Rudo To: gdb-patches@sourceware.org Cc: Omair Javaid , Yao Qi , arnez@linux.vnet.ibm.com Subject: [RFC v5 0/9] Add support for Linux kernel debugging Date: Mon, 12 Mar 2018 15:31:00 -0000 X-TM-AS-GCONF: 00 x-cbid: 18031215-0020-0000-0000-000004026C89 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18031215-0021-0000-0000-00004296BDCC Message-Id: <20180312153115.47321-1-prudo@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-03-12_09:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=15 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1803120176 X-IsSubscribed: yes X-SW-Source: 2018-03/txt/msg00243.txt.bz2 Hi everybody, after a long time here is a sign of life from kernel awareness. Originally i planed to bring the patches upstream one by one. However i'm currently stuck on an other project. But I should find time soon to continue here. The main change between v4 and v5 is the C++ification of lk_low, which required big parts of the file to be rewritten. Along with that smaller improvements and bug fixes where made. Changes v4 -> v5: * Rebase to current master. * C++-ify lk-low, i.e. replace: - struct lk_private -> class linux_kernel_ops, - hooks -> virtual member functions in linux_kernel_ops, - macros -> member function of linux_kernel_ops, - htab_t -> std::unordered_map for cached symbols, - gdbarch_lk_init_private -> gdbarch_get_new_lk_ops, - lk_list & lk_bitmap -> iterator class, - const char * -> const std::string & (where possible), - whatever I forgot, lk-low was basically rewritten. * Add class s390_linux_kernel_ops inherited from linux_kernel_ops. * Add GDB_OSABI_LINUX_KERNEL (patch #4). Architectures must use a sniffer to distinguish between user- and kernel-space as in ELF both have type Linux. * Introduce ENUM_FLAG lk_kconfig to track config options used in kernel and turn off features not supported by the kernel (e.g. module support). * Fix handling of fields defined in anonymous structs. * Fix call to target beneath->to_fetch_registers. Adjust that to_fetch_registers uses regcache->ptid() instead of inferior_ptid nowadays (bcc0c096d5b et al.). Requires new patch #3. * Fix typo in size of (s390) topdpreg. * Fix bug in S390_LK_ROUNDUP and rename to LK_ALIGN. * Move s390 split up to separate patch set (already pushed) and adjust s390 code accordingly. Thanks Philipp Philipp Rudo (9): Convert substitute_path_component to C++ Add libiberty/concat styled concat_path function Add scoped_restore_regcache_ptid Add basic Linux kernel support Add kernel module support for linux-kernel target Add commands for linux-kernel target Add privileged registers for s390x Link frame_info to thread_info Add S390 support for linux-kernel target gdb/Makefile.in | 12 + gdb/auto-load.c | 19 +- gdb/common/common-utils.h | 11 + gdb/configure.tgt | 9 +- gdb/defs.h | 1 + gdb/features/Makefile | 11 +- gdb/features/s390-cr.xml | 26 + gdb/features/s390x-cr-linux64.c | 99 ++++ gdb/features/s390x-cr-linux64.xml | 24 + gdb/features/s390x-vxcr-linux64.c | 170 ++++++ gdb/features/s390x-vxcr-linux64.xml | 25 + gdb/frame.c | 12 + gdb/frame.h | 2 + gdb/gdbarch.c | 32 ++ gdb/gdbarch.h | 9 + gdb/gdbarch.sh | 4 + gdb/lk-bitmap.h | 226 ++++++++ gdb/lk-cmds.c | 254 +++++++++ gdb/lk-cmds.h | 25 + gdb/lk-list.h | 201 +++++++ gdb/lk-low.c | 953 +++++++++++++++++++++++++++++++ gdb/lk-low.h | 362 ++++++++++++ gdb/lk-modules.c | 501 ++++++++++++++++ gdb/lk-modules.h | 148 +++++ gdb/osabi.c | 1 + gdb/regcache.h | 21 + gdb/regformats/s390x-cr-linux64.dat | 76 +++ gdb/regformats/s390x-vxcr-linux64.dat | 108 ++++ gdb/s390-lk-tdep.c | 1015 +++++++++++++++++++++++++++++++++ gdb/s390-lk-tdep.h | 39 ++ gdb/s390-tdep.c | 44 +- gdb/s390-tdep.h | 90 ++- gdb/solib.c | 8 + gdb/solib.h | 5 + gdb/typeprint.c | 2 +- gdb/typeprint.h | 2 + gdb/utils.c | 85 +-- gdb/utils.h | 26 +- 38 files changed, 4599 insertions(+), 59 deletions(-) create mode 100644 gdb/features/s390-cr.xml create mode 100644 gdb/features/s390x-cr-linux64.c create mode 100644 gdb/features/s390x-cr-linux64.xml create mode 100644 gdb/features/s390x-vxcr-linux64.c create mode 100644 gdb/features/s390x-vxcr-linux64.xml create mode 100644 gdb/lk-bitmap.h create mode 100644 gdb/lk-cmds.c create mode 100644 gdb/lk-cmds.h create mode 100644 gdb/lk-list.h create mode 100644 gdb/lk-low.c create mode 100644 gdb/lk-low.h create mode 100644 gdb/lk-modules.c create mode 100644 gdb/lk-modules.h create mode 100644 gdb/regformats/s390x-cr-linux64.dat create mode 100644 gdb/regformats/s390x-vxcr-linux64.dat create mode 100644 gdb/s390-lk-tdep.c create mode 100644 gdb/s390-lk-tdep.h -- 2.13.5