public inbox for archer-commits@sourceware.org help / color / mirror / Atom feed
From: sergiodj@sourceware.org To: archer-commits@sourceware.org Subject: [SCM] archer-sergiodj-stap: Implementing the relocation for probes. Date: Wed, 16 Feb 2011 21:41:00 -0000 [thread overview] Message-ID: <20110216214112.4814.qmail@sourceware.org> (raw) The branch, archer-sergiodj-stap has been updated via 5aa8ec25412e39d9c99df5a7a274b47403aef824 (commit) from 21cb8f37bbdc1e2e6017c78649b95be84a4fe4df (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit 5aa8ec25412e39d9c99df5a7a274b47403aef824 Author: Sergio Durigan Junior <sergiodj@redhat.com> Date: Wed Feb 16 19:41:01 2011 -0200 Implementing the relocation for probes. ----------------------------------------------------------------------- Summary of changes: gdb/elfread.c | 23 +++++++++++++++++++++++ gdb/objfiles.c | 5 +++++ gdb/symfile.h | 5 +++++ 3 files changed, 33 insertions(+), 0 deletions(-) First 500 lines of diff: diff --git a/gdb/elfread.c b/gdb/elfread.c index cb21c06..1b1df1b 100644 --- a/gdb/elfread.c +++ b/gdb/elfread.c @@ -1227,6 +1227,28 @@ elf_get_probe_argument_count (struct objfile *objfile, #endif static void +elf_symfile_relocate_probe (struct objfile *objfile, + struct section_offsets *new_offsets, + struct section_offsets *delta) +{ + int i; + struct stap_probe_per_objfile *p + = (struct stap_probe_per_objfile *) objfile_data (objfile, + stap_probe_key); + + if (!p) + /* No probe to relocate. */ + return; + + for (i = 0; i < p->stap_num_probes; i++) + { + p->probes[i].address += ANOFFSET (delta, SECT_OFF_TEXT (objfile)); + if (p->probes[i].sem_addr) + p->probes[i].sem_addr += ANOFFSET (delta, SECT_OFF_TEXT (objfile)); + } +} + +static void stap_probe_key_free (struct objfile *objfile, void *d) { struct stap_probe_per_objfile *data = (struct stap_probe_per_objfile *) d; @@ -1241,6 +1263,7 @@ static const struct sym_probe_fns elf_probe_fns = elf_get_probes, /* sym_get_probes */ NULL, /* sym_get_probe_argument_count */ NULL, /* sym_evaluate_probe_argument */ + elf_symfile_relocate_probe, /* sym_relocate_probe */ }; /* Register that we are able to handle ELF object file formats. */ diff --git a/gdb/objfiles.c b/gdb/objfiles.c index 4f70d3f..77e9634 100644 --- a/gdb/objfiles.c +++ b/gdb/objfiles.c @@ -846,6 +846,11 @@ objfile_relocate1 (struct objfile *objfile, obj_section_addr (s)); } + /* Relocating Systemtap probes. */ + if (objfile->sf && objfile->sf->sym_probe_fns) + objfile->sf->sym_probe_fns->sym_relocate_probe (objfile, + new_offsets, delta); + /* Data changed. */ return 1; } diff --git a/gdb/symfile.h b/gdb/symfile.h index 81c2de4..167b3b4 100644 --- a/gdb/symfile.h +++ b/gdb/symfile.h @@ -327,6 +327,11 @@ struct sym_probe_fns const struct stap_probe *probe, struct frame_info *frame, int n); + + /* Relocate the probe section of OBJFILE. */ + void (*sym_relocate_probe) (struct objfile *objfile, + struct section_offsets *new_offsets, + struct section_offsets *delta); }; /* Structure to keep track of symbol reading functions for various hooks/post-receive -- Repository for Project Archer.
reply other threads:[~2011-02-16 21:41 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20110216214112.4814.qmail@sourceware.org \ --to=sergiodj@sourceware.org \ --cc=archer-commits@sourceware.org \ /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: linkBe 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; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).