From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29602 invoked by alias); 22 Jan 2016 15:17:13 -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 29512 invoked by uid 89); 22 Jan 2016 15:17:12 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=1.1 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,UNWANTED_LANGUAGE_BODY autolearn=no version=3.3.2 spammy=Hx-spam-relays-external:mga04.intel.com, HX-HELO:mga04.intel.com, H*RU:192.55.52.120, Hx-spam-relays-external:192.55.52.120 X-HELO: mga04.intel.com Received: from mga04.intel.com (HELO mga04.intel.com) (192.55.52.120) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 22 Jan 2016 15:17:11 +0000 Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga104.fm.intel.com with ESMTP; 22 Jan 2016 07:17:09 -0800 X-ExtLoop1: 1 Received: from irvmail001.ir.intel.com ([163.33.26.43]) by orsmga003.jf.intel.com with ESMTP; 22 Jan 2016 07:17:09 -0800 Received: from ulvlx001.iul.intel.com (ulvlx001.iul.intel.com [172.28.207.17]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id u0MEsOPa020012; Fri, 22 Jan 2016 14:54:24 GMT Received: from ulvlx001.iul.intel.com (localhost [127.0.0.1]) by ulvlx001.iul.intel.com with ESMTP id u0MEsOG3013231; Fri, 22 Jan 2016 15:54:24 +0100 Received: (from wtedesch@localhost) by ulvlx001.iul.intel.com with œ id u0MEsOqN013227; Fri, 22 Jan 2016 15:54:24 +0100 From: Walfred Tedeschi To: palves@redhat.com, eliz@gnu.org, brobecker@adacore.com Cc: gdb-patches@sourceware.org, Walfred Tedeschi Subject: [PATCH V5 3/5] Add bound related fields to the siginfo structure Date: Fri, 22 Jan 2016 15:17:00 -0000 Message-Id: <1453474456-13169-4-git-send-email-walfred.tedeschi@intel.com> In-Reply-To: <1453474456-13169-1-git-send-email-walfred.tedeschi@intel.com> References: <1453474456-13169-1-git-send-email-walfred.tedeschi@intel.com> X-IsSubscribed: yes X-SW-Source: 2016-01/txt/msg00564.txt.bz2 Both Linux and glibc have introduced bound related fields in the segmentation fault fields of the siginfo_t type. Ass the new fields to our x86's siginfo_t type too. Kernel patch: http://git.kernel.org/cgit/linux/kernel/git/tip/tip.git/commit/?id=ee1b58d36aa1b5a79eaba11f5c3633c88231da83 Glibc patch: http://repo.or.cz/w/glibc.git/commit/d4358b51c26a634eb885955aea06cad26af6f696 2016-01-15 Walfred Tedeschi gdb/ChangeLog: * linux-tdep.c (linux_get_siginfo_type): Add the _addr_bnd structure to the siginfo if extra_fields contains LINUX_SIGINFO_FIELD_ADDR_BND. --- gdb/linux-tdep.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/gdb/linux-tdep.c b/gdb/linux-tdep.c index acc6e16..70196d0 100644 --- a/gdb/linux-tdep.c +++ b/gdb/linux-tdep.c @@ -251,7 +251,7 @@ linux_get_siginfo_type_with_fields (struct gdbarch *gdbarch, linux_siginfo_extra_fields extra_fields) { struct linux_gdbarch_data *linux_gdbarch_data; - struct type *int_type, *uint_type, *long_type, *void_ptr_type; + struct type *int_type, *uint_type, *long_type, *void_ptr_type, *short_type; struct type *uid_type, *pid_type; struct type *sigval_type, *clock_type; struct type *siginfo_type, *sifields_type; @@ -267,6 +267,8 @@ linux_get_siginfo_type_with_fields (struct gdbarch *gdbarch, 1, "unsigned int"); long_type = arch_integer_type (gdbarch, gdbarch_long_bit (gdbarch), 0, "long"); + short_type = arch_integer_type (gdbarch, gdbarch_long_bit (gdbarch), + 0, "short"); void_ptr_type = lookup_pointer_type (builtin_type (gdbarch)->builtin_void); /* sival_t */ @@ -342,6 +344,18 @@ linux_get_siginfo_type_with_fields (struct gdbarch *gdbarch, /* _sigfault */ type = arch_composite_type (gdbarch, NULL, TYPE_CODE_STRUCT); append_composite_type_field (type, "si_addr", void_ptr_type); + + /* additional bound fields for _sigfault in case they are added. */ + if ((extra_fields & LINUX_SIGINFO_FIELD_ADDR_BND) != 0) + { + struct type *sigfault_bnd_fields; + + append_composite_type_field (type, "_addr_lsb", short_type); + sigfault_bnd_fields = arch_composite_type (gdbarch, NULL, TYPE_CODE_STRUCT); + append_composite_type_field (sigfault_bnd_fields, "_lower", void_ptr_type); + append_composite_type_field (sigfault_bnd_fields, "_upper", void_ptr_type); + append_composite_type_field (type, "_addr_bnd", sigfault_bnd_fields); + } append_composite_type_field (sifields_type, "_sigfault", type); /* _sigpoll */ -- 2.1.4