From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27523 invoked by alias); 10 Jun 2003 00:05:00 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 27303 invoked from network); 10 Jun 2003 00:04:54 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 10 Jun 2003 00:04:54 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id h5A04rH17048 for ; Mon, 9 Jun 2003 20:04:53 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h5A04rI32659 for ; Mon, 9 Jun 2003 20:04:53 -0400 Received: from localhost.localdomain (vpn50-31.rdu.redhat.com [172.16.50.31]) by pobox.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h5A04r624727; Mon, 9 Jun 2003 20:04:53 -0400 Received: (from kev@localhost) by localhost.localdomain (8.11.6/8.11.6) id h59NO7j18903; Mon, 9 Jun 2003 16:24:07 -0700 Date: Tue, 10 Jun 2003 00:05:00 -0000 From: Kevin Buettner Message-Id: <1030609232407.ZM18902@localhost.localdomain> In-Reply-To: Jim Blandy "[ppc64-linux]: skip linkage functions" (Jun 5, 6:54pm) References: To: Jim Blandy , gdb-patches@sources.redhat.com Subject: Re: [ppc64-linux]: skip linkage functions MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2003-06/txt/msg00314.txt.bz2 On Jun 5, 6:54pm, Jim Blandy wrote: > 2003-06-05 Jim Blandy > > Recognize and skip 64-bit PowerPC Linux linkage functions. > * ppc-linux-tdep.c (insn_d, insn_ds, insn_xfx, read_insn, struct > insn_pattern, insns_match_pattern, d_field, ds_field): New > functions, macros, and types for working with PPC instructions. > (ppc64_standard_linkage, PPC64_STANDARD_LINKAGE_LEN, > ppc64_in_solib_call_trampoline, ppc64_standard_linkage_target, > ppc64_skip_trampoline_code): New functions, variables, and macros > for recognizing and skipping linkage functions. > (ppc_linux_init_abi): Use ppc64_in_solib_call_trampoline and > ppc64_skip_trampoline_code for the 64-bit PowerPC Linux ABI. Okay... ...except that I can't figure out where "set INSN[i] to -1" (from the comment) happens in insns_match_pattern(). Once you fix this (or explain it to me), feel free to commit this patch. > + /* Return non-zero if the instructions at PC match the series > + described in PATTERN, or zero otherwise. PATTERN is an array of > + 'struct insn_pattern' objects, terminated by an entry whose mask is > + zero. > + > + When the match is successful, fill INSN[i] with what PATTERN[i] > + matched. If PATTERN[i] is optional, and the instruction wasn't > + present, set INSN[i] to -1. INSN should have as many elements as > + PATTERN. Note that, if PATTERN contains optional instructions > + which aren't present in memory, then INSN will have holes, so > + INSN[i] isn't necessarily the i'th instruction in memory. */ > + static int > + insns_match_pattern (CORE_ADDR pc, > + struct insn_pattern *pattern, > + unsigned int *insn) > + { > + int i; > + > + for (i = 0; pattern[i].mask; i++) > + { > + insn[i] = read_insn (pc); > + if ((insn[i] & pattern[i].mask) == pattern[i].data) > + pc += 4; > + else if (pattern[i].optional) > + insn[i] = 0; > + else > + return 0; > + } > + > + return 1; > + }