From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 405 invoked by alias); 16 Dec 2013 17:09:05 -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 396 invoked by uid 89); 16 Dec 2013 17:09:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: glazunov.sibelius.xs4all.nl Received: from sibelius.xs4all.nl (HELO glazunov.sibelius.xs4all.nl) (83.163.83.176) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Mon, 16 Dec 2013 17:09:02 +0000 Received: from glazunov.sibelius.xs4all.nl (kettenis@localhost [127.0.0.1]) by glazunov.sibelius.xs4all.nl (8.14.5/8.14.3) with ESMTP id rBGH8n4E008439; Mon, 16 Dec 2013 18:08:49 +0100 (CET) Received: (from kettenis@localhost) by glazunov.sibelius.xs4all.nl (8.14.5/8.14.3/Submit) id rBGH8m8L017003; Mon, 16 Dec 2013 18:08:48 +0100 (CET) Date: Mon, 16 Dec 2013 17:09:00 -0000 Message-Id: <201312161708.rBGH8m8L017003@glazunov.sibelius.xs4all.nl> From: Mark Kettenis To: sergiodj@redhat.com CC: gdb-patches@sourceware.org In-reply-to: (message from Sergio Durigan Junior on Mon, 16 Dec 2013 15:01:38 -0200) Subject: Re: [PATCH] Extend SystemTap SDT probe argument parser References: <1386734160-29837-1-git-send-email-sergiodj@redhat.com> X-SW-Source: 2013-12/txt/msg00582.txt.bz2 > From: Sergio Durigan Junior > Date: Mon, 16 Dec 2013 15:01:38 -0200 > > On Wednesday, December 11 2013, I wrote: > > > This patch extends the current generic parser for SystemTap SDT probe > > arguments. It can be almost considered a cleanup, but the main point of > > it is actually to allow the generic parser to accept multiple prefixes > > and suffixes for the its operands (i.e., integers, register names, and > > register indirection). > > Ping. Can't say I like the added complexity, but the i386/amd64 are ok. > > I have chosen to implement this as a list of const strings, which needs > > to be declared as "static const char *const *", and is provided to > > gdbarch on initialization. I think it is cleaner to implement it this > > way, but for a moment I wondered whether demanding the variables to be > > declared as "static" is a good idea... After some thought and > > discussion, I decided to leave it as is. > > > > This patch is actually a preparation for an upcoming patch for ARM, > > which implements the support for multiple integer prefixes (as defined > > by ARM's asm spec). And AArch64 will also need this, for the same > > reason. > > > > This patch was regtested on all architectures that it touches (i.e., > > i386, x86_64, ARM, PPC/PPC64, s390x and IA-64). No regressions were found. > > > > 2013-12-11 Sergio Durigan Junior > > > > * amd64-tdep.c (amd64_init_abi): Declare SystemTap SDT probe > > argument prefixes and suffixes. Initialize gdbarch with them. > > * arm-linux-tdep.c (arm_linux_init_abi): Likewise. > > * gdbarch.c: Regenerate. > > * gdbarch.h: Regenerate. > > * gdbarch.sh (stap_integer_prefix, stap_integer_suffix) > > (stap_register_prefix, stap_register_suffix) > > (stap_register_indirection_prefix) > > (stap_register_indirection_suffix): Declare as "const char *const > > *" instead of "const char *". Adjust printing function. > > (pstring_list): New function. > > * i386-tdep.c (i386_elf_init_abi): Declare SystemTap SDT probe > > argument prefixes and suffixes. Initialize gdbarch with them. > > * ia64-linux-tdep.c (ia64_linux_init_abi): Likewise. > > * ppc-linux-tdep.c (ppc_linux_init_abi): Likewise. > > * s390-linux-tdep.c (s390_gdbarch_init): Likewise. > > * stap-probe.c (stap_is_generic_prefix): New function. > > (stap_is_register_prefix): Likewise. > > (stap_is_register_indirection_prefix): Likewise. > > (stap_is_integer_prefix): Likewise. > > (stap_generic_check_suffix): Likewise. > > (stap_check_integer_suffix): Likewise. > > (stap_check_register_suffix): Likewise. > > (stap_check_register_indirection_suffix): Likewise. > > (stap_parse_register_operand): Remove unecessary declarations for > > variables holding prefix and suffix information. Use the new > > functions listed above for checking for prefixes and suffixes. > > (stap_parse_single_operand): Likewise. > > --- > > gdb/ChangeLog | 31 ++++++ > > gdb/amd64-tdep.c | 14 ++- > > gdb/arm-linux-tdep.c | 14 ++- > > gdb/gdbarch.c | 71 +++++++----- > > gdb/gdbarch.h | 76 +++++++++---- > > gdb/gdbarch.sh | 79 +++++++++++--- > > gdb/i386-tdep.c | 15 ++- > > gdb/ia64-linux-tdep.c | 11 +- > > gdb/ppc-linux-tdep.c | 11 +- > > gdb/s390-linux-tdep.c | 11 +- > > gdb/stap-probe.c | 291 +++++++++++++++++++++++++++++++++++++-------------