public inbox for frysk-cvs@sourceware.org help / color / mirror / Atom feed
From: swagiaal@sourceware.org To: frysk-cvs@sourceware.org Subject: [SCM] master: swagiaal: added implemented and tested getPubNames(). Date: Mon, 03 Dec 2007 17:51:00 -0000 [thread overview] Message-ID: <20071203175125.30416.qmail@sourceware.org> (raw) The branch, master has been updated via aabe9d8db237353c405ca58827d0026978bc6d26 (commit) from cba1f284ab9d7e1c3f8166601d486a52d7cee5fe (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit aabe9d8db237353c405ca58827d0026978bc6d26 Author: Sami Wagiaalla <swagiaal@redhat.com> Date: Mon Dec 3 12:48:57 2007 -0500 swagiaal: added implemented and tested getPubNames(). frysk-core/frysk/pkglibdir/ChangeLog +2007-12-03 Sami Wagiaalla <swagiaal@toner.toronto.redhat.com> + + * funit-class-static.cxx: Added a def of static_i. + frysk-core/frysk/scopes/ChangeLog +2007-12-03 Sami Wagiaalla <swagiaal@redhat.com> + + * TestDie.java (testGetPubnames): New test. + frysk-sys/lib/dwfl/ChangeLog +2007-12-03 Sami Wagiaalla <swagiaal@redhat.com> + + * DwflModule.java (getPubNames): New function. + * cni/DwflModule.cxx: Implemented get_pubnames + * Dwfl.java: Changed factory from private to protected + final. + ----------------------------------------------------------------------- Summary of changes: frysk-core/frysk/pkglibdir/ChangeLog | 4 ++ frysk-core/frysk/pkglibdir/funit-class-static.cxx | 2 + frysk-core/frysk/scopes/ChangeLog | 4 ++ frysk-core/frysk/scopes/TestDie.java | 30 +++++++++++++++++- frysk-sys/lib/dwfl/ChangeLog | 7 ++++ frysk-sys/lib/dwfl/Dwfl.java | 2 +- frysk-sys/lib/dwfl/DwflModule.java | 16 +++++++++- frysk-sys/lib/dwfl/cni/DwflModule.cxx | 36 +++++++++++++++++++++ 8 files changed, 98 insertions(+), 3 deletions(-) First 500 lines of diff: diff --git a/frysk-core/frysk/pkglibdir/ChangeLog b/frysk-core/frysk/pkglibdir/ChangeLog index f7cda52..22faac1 100644 --- a/frysk-core/frysk/pkglibdir/ChangeLog +++ b/frysk-core/frysk/pkglibdir/ChangeLog @@ -1,3 +1,7 @@ +2007-12-03 Sami Wagiaalla <swagiaal@toner.toronto.redhat.com> + + * funit-class-static.cxx: Added a def of static_i. + 2007-12-03 Andrew Cagney <cagney@redhat.com> * funit-regs.S (fxregs): Align to 16-byte boundary. diff --git a/frysk-core/frysk/pkglibdir/funit-class-static.cxx b/frysk-core/frysk/pkglibdir/funit-class-static.cxx index c086f74..57e16c4 100644 --- a/frysk-core/frysk/pkglibdir/funit-class-static.cxx +++ b/frysk-core/frysk/pkglibdir/funit-class-static.cxx @@ -9,6 +9,8 @@ public: void crash(); }; +int A::static_i = 5; + void A::crash(){ int* a = 0; a[0] = 0; diff --git a/frysk-core/frysk/scopes/ChangeLog b/frysk-core/frysk/scopes/ChangeLog index 2f114b5..24470da 100644 --- a/frysk-core/frysk/scopes/ChangeLog +++ b/frysk-core/frysk/scopes/ChangeLog @@ -1,3 +1,7 @@ +2007-12-03 Sami Wagiaalla <swagiaal@redhat.com> + + * TestDie.java (testGetPubnames): New test. + 2007-11-20 Sami Wagiaalla <swagiaal@redhat.com> * Scope.java (toPrint): Added printing for variable diff --git a/frysk-core/frysk/scopes/TestDie.java b/frysk-core/frysk/scopes/TestDie.java index 336f235..9ad5a93 100644 --- a/frysk-core/frysk/scopes/TestDie.java +++ b/frysk-core/frysk/scopes/TestDie.java @@ -40,14 +40,20 @@ package frysk.scopes; import java.io.File; +import java.util.Iterator; +import java.util.LinkedList; import lib.dwfl.DwAt; import lib.dwfl.DwarfDie; +import lib.dwfl.Dwfl; +import lib.dwfl.DwflModule; import frysk.Config; -import frysk.debuginfo.ObjectDeclarationSearchEngine; import frysk.debuginfo.DebugInfoFrame; import frysk.debuginfo.DebugInfoStackFactory; +import frysk.debuginfo.ObjectDeclarationSearchEngine; +import frysk.dwfl.DwflCache; import frysk.proc.Task; +import frysk.stack.StackFactory; import frysk.testbed.DaemonBlockedAtSignal; import frysk.testbed.TestLib; import frysk.testbed.TestfileTokenScanner; @@ -92,6 +98,28 @@ public class TestDie assertNotNull("Found original die", die); assertEquals("Die has correct name", "crash" ,die.getName()); + } + + public void testGetPubnames(){ + String fileName = "funit-class-static"; + Task task = (new DaemonBlockedAtSignal(fileName)).getMainTask(); + long pc = StackFactory.createFrame(task).getAdjustedAddress(); + + Dwfl dwfl = DwflCache.getDwfl(task); + DwflModule dwflModule = dwfl.getModule(pc); + LinkedList pubnames = dwflModule.getPubNames(); + Iterator iterator = pubnames.iterator(); + + assertEquals("Size of pubnames ", 3, pubnames.size()); + + DwarfDie die = (DwarfDie) iterator.next(); + assertEquals("Die name", "crash", die.getName()); + + die = (DwarfDie) iterator.next(); + assertEquals("Die name", "main", die.getName()); + + die = (DwarfDie) iterator.next(); + assertEquals("Die name", "static_i", die.getName()); } diff --git a/frysk-sys/lib/dwfl/ChangeLog b/frysk-sys/lib/dwfl/ChangeLog index 4e0117e..a1bdd0c 100644 --- a/frysk-sys/lib/dwfl/ChangeLog +++ b/frysk-sys/lib/dwfl/ChangeLog @@ -1,3 +1,10 @@ +2007-12-03 Sami Wagiaalla <swagiaal@redhat.com> + + * DwflModule.java (getPubNames): New function. + * cni/DwflModule.cxx: Implemented get_pubnames + * Dwfl.java: Changed factory from private to protected + final. + 2007-11-29 Phil Muldoon <pmuldoon@redhat.com> * cni/ElfPrstatus.cxx (ElfPrstatus::fillMemRegion): Copy diff --git a/frysk-sys/lib/dwfl/Dwfl.java b/frysk-sys/lib/dwfl/Dwfl.java index daeb382..313a9f5 100644 --- a/frysk-sys/lib/dwfl/Dwfl.java +++ b/frysk-sys/lib/dwfl/Dwfl.java @@ -48,7 +48,7 @@ public class Dwfl { private DwflModule[] modules; - private final DwarfDieFactory factory = DwarfDieFactory.getFactory(); + protected final DwarfDieFactory factory = DwarfDieFactory.getFactory(); public Dwfl() { pointer = dwflBegin(); diff --git a/frysk-sys/lib/dwfl/DwflModule.java b/frysk-sys/lib/dwfl/DwflModule.java index 85c15c8..def4304 100644 --- a/frysk-sys/lib/dwfl/DwflModule.java +++ b/frysk-sys/lib/dwfl/DwflModule.java @@ -39,17 +39,21 @@ package lib.dwfl; +import java.util.LinkedList; + /** * A wrapper object around the libdwfl Dwfl_Module structure. */ public class DwflModule { + protected LinkedList pubNames; + protected long bias; private long pointer; - private Dwfl parent; + protected final Dwfl parent; protected String name; @@ -80,6 +84,16 @@ public class DwflModule return module_getelf(); } + public LinkedList getPubNames(){ + if(this.pubNames == null){ + this.pubNames = new LinkedList(); + get_pubnames(); + } + return pubNames; + } + + private native void get_pubnames(); + /** * Get the name of the module. * diff --git a/frysk-sys/lib/dwfl/cni/DwflModule.cxx b/frysk-sys/lib/dwfl/cni/DwflModule.cxx index a5844fb..3a1113c 100644 --- a/frysk-sys/lib/dwfl/cni/DwflModule.cxx +++ b/frysk-sys/lib/dwfl/cni/DwflModule.cxx @@ -46,10 +46,16 @@ #include <gnu/gcj/RawData.h> #include "lib/dwfl/DwflModule.h" +#include "lib/dwfl/DwarfDie.h" #include "lib/dwfl/DwflLine.h" #include "lib/dwfl/ModuleElfBias.h" #include "lib/dwfl/SymbolBuilder.h" #include "lib/dwfl/Elf.h" +#include "lib/dwfl/DwarfDieFactory.h" +#include "lib/dwfl/Dwfl.h" +#include "lib/dwfl/DwException.h" + +#include "java/util/LinkedList.h" #define DWFL_MODULE_POINTER (Dwfl_Module *) this->pointer @@ -197,3 +203,33 @@ lib::dwfl::DwflModule::getDebuginfo() return getName(); } + +static int +callback (Dwarf *dwarf, Dwarf_Global *gl, void* thisObject) +{ + + lib::dwfl::DwflModule* dwflModule = (lib::dwfl::DwflModule*)thisObject; + lib::dwfl::Dwfl* dwfl = dwflModule->parent; + + Dwarf_Die *die = (Dwarf_Die*)JvMalloc(sizeof(Dwarf_Die)); + + if (dwarf_offdie (dwarf, gl->die_offset, die) == NULL){ + throw new lib::dwfl::DwarfException(JvNewStringUTF("failed to get object die")); + }else{ + lib::dwfl::DwarfDie* dwarfDie = dwfl->factory->makeDie((jlong)die, dwfl); + dwflModule->pubNames->add(dwarfDie); + + } + + return DWARF_CB_OK; +} + +void +lib::dwfl::DwflModule::get_pubnames() +{ + Dwarf_Addr bias; + ::Dwarf* dwarf = dwfl_module_getdwarf ((Dwfl_Module*)this->pointer, &bias); + + dwarf_getpubnames(dwarf, callback, this,0); +} + hooks/post-receive -- frysk system monitor/debugger
reply other threads:[~2007-12-03 17:51 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=20071203175125.30416.qmail@sourceware.org \ --to=swagiaal@sourceware.org \ --cc=frysk-cvs@sourceware.org \ --cc=frysk@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).