From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31111 invoked by alias); 23 Dec 2013 19:47:47 -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 31102 invoked by uid 89); 23 Dec 2013 19:47:47 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.8 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 23 Dec 2013 19:47:46 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rBNJlg2R025661 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 23 Dec 2013 14:47:42 -0500 Received: from psique ([10.3.113.9]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id rBNJldDm010698 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Mon, 23 Dec 2013 14:47:41 -0500 From: Sergio Durigan Junior To: GDB Patches Cc: Marcus Shawcroft , Yufeng Zhang Subject: [PATCH] Extend handling of immediates on ARM's SystemTap SDT probe support X-URL: http://www.redhat.com Date: Mon, 23 Dec 2013 19:47:00 -0000 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2013-12/txt/msg00895.txt.bz2 Hi there, Continuing my series of fixes on the SystemTap SDT support for the ARM/AArch64 architectures, this patch now extends how ARM's SDT specific parser handles literal numbers (immediates). Currently, it only accepts "#" as the prefix. However, according to "info '(as) ARM-Chars'", expressions can also have "$" and nothing as a prefix. This patch extends the parser to accept those options. It is a rather trivial patch, and tests have proved that it works fine. OK to apply? -- Sergio 2013-12-23 Sergio Durigan Junior * arm-linux-tdep.c (arm_stap_is_single_operand): Accept "$" as a literal prefix. Also accept no prefix at all. (arm_stap_parse_special_token): Likewise. (arm_linux_init_abi): Likewise. diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c index 0284f69..df2b8c4 100644 --- a/gdb/arm-linux-tdep.c +++ b/gdb/arm-linux-tdep.c @@ -1116,7 +1116,7 @@ arm_linux_displaced_step_copy_insn (struct gdbarch *gdbarch, static int arm_stap_is_single_operand (struct gdbarch *gdbarch, const char *s) { - return (*s == '#' /* Literal number. */ + return (*s == '#' || *s == '$' || isdigit (*s) /* Literal number. */ || *s == '[' /* Register indirection or displacement. */ || isalpha (*s)); /* Register value. */ @@ -1183,14 +1183,19 @@ arm_stap_parse_special_token (struct gdbarch *gdbarch, ++tmp; tmp = skip_spaces_const (tmp); - if (*tmp++ != '#') - return 0; + if (*tmp == '#' || *tmp == '$') + ++tmp; if (*tmp == '-') { ++tmp; got_minus = 1; } + else if (*tmp == '+') + ++tmp; + + if (!isdigit (*tmp)) + return 0; displacement = strtol (tmp, &endp, 10); tmp = endp; @@ -1235,7 +1240,7 @@ static void arm_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { - static const char *const stap_integer_prefixes[] = { "#", NULL }; + static const char *const stap_integer_prefixes[] = { "#", "$", "", NULL }; static const char *const stap_register_prefixes[] = { "r", NULL }; static const char *const stap_register_indirection_prefixes[] = { "[", NULL };