From: Kevin Buettner <kevinb@redhat.com>
To: Jim Blandy <jimb@redhat.com>, gdb-patches@sources.redhat.com
Subject: Re: [ppc64-linux]: skip linkage functions
Date: Tue, 10 Jun 2003 00:05:00 -0000 [thread overview]
Message-ID: <1030609232407.ZM18902@localhost.localdomain> (raw)
In-Reply-To: Jim Blandy <jimb@redhat.com> "[ppc64-linux]: skip linkage functions" (Jun 5, 6:54pm)
On Jun 5, 6:54pm, Jim Blandy wrote:
> 2003-06-05 Jim Blandy <jimb@redhat.com>
>
> 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;
> + }
next prev parent reply other threads:[~2003-06-10 0:05 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-06-05 23:54 Jim Blandy
2003-06-06 0:03 ` Daniel Jacobowitz
2003-06-06 6:22 ` Jim Blandy
2003-06-06 13:11 ` Daniel Jacobowitz
2003-06-06 20:09 ` Jim Blandy
2003-06-06 20:17 ` Daniel Jacobowitz
2003-06-06 20:31 ` Jim Blandy
2003-06-06 21:40 ` Daniel Jacobowitz
2003-06-06 22:47 ` Jim Blandy
2003-06-10 0:05 ` Kevin Buettner [this message]
2003-06-10 17:29 ` Jim Blandy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1030609232407.ZM18902@localhost.localdomain \
--to=kevinb@redhat.com \
--cc=gdb-patches@sources.redhat.com \
--cc=jimb@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox