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: moved getSymbolDie from DebugInfo to ObjectDeclarationSearchEngine Date: Tue, 08 Apr 2008 20:34:00 -0000 [thread overview] Message-ID: <20080408203358.28840.qmail@sourceware.org> (raw) The branch, master has been updated via f8e933b5cfed19b7d32a94efb00d9a49c05f7a2d (commit) from e46576dda8e33b2b78b563dd119a49ffb3f3e87d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit f8e933b5cfed19b7d32a94efb00d9a49c05f7a2d Author: Sami Wagiaalla <swagiaal@redhat.com> Date: Tue Apr 8 16:32:11 2008 -0400 swagiaal: moved getSymbolDie from DebugInfo to ObjectDeclarationSearchEngine +++ b/frysk-core/frysk/debuginfo/ChangeLog +2008-04-08 Sami Wagiaalla <swagiaal@redhat.com> + + * ObjectDeclarationSearchEngine.java: moved getSymbolDie(String input) + from DebugInfo to ObjectDeclarationSearchEngine. + * DebugInfo.java: Ditto. + frysk-core/frysk/hpd/ChangeLog +2008-04-08 Sami Wagiaalla <swagiaal@redhat.com> + + moved getSymbolDie(String input) from DebugInfo to ObjectDeclarationSearchEngine + * ListCommand.java: Updated. + * BreakpointCommand.java: Updated + ----------------------------------------------------------------------- Summary of changes: frysk-core/frysk/debuginfo/ChangeLog | 6 ++++ frysk-core/frysk/debuginfo/DebugInfo.java | 11 -------- .../debuginfo/ObjectDeclarationSearchEngine.java | 27 +++++++++++++++++++- frysk-core/frysk/hpd/BreakpointCommand.java | 25 +++++++++++------- frysk-core/frysk/hpd/ChangeLog | 6 ++++ frysk-core/frysk/hpd/ListCommand.java | 10 ++++--- 6 files changed, 59 insertions(+), 26 deletions(-) First 500 lines of diff: diff --git a/frysk-core/frysk/debuginfo/ChangeLog b/frysk-core/frysk/debuginfo/ChangeLog index 23e57ac..bc1767e 100644 --- a/frysk-core/frysk/debuginfo/ChangeLog +++ b/frysk-core/frysk/debuginfo/ChangeLog @@ -1,3 +1,9 @@ +2008-04-08 Sami Wagiaalla <swagiaal@redhat.com> + + * ObjectDeclarationSearchEngine.java: moved getSymbolDie(String input) + from DebugInfo to ObjectDeclarationSearchEngine. + * DebugInfo.java: Ditto. + 2008-04-07 Sami Wagiaalla <swagiaal@redhat.com> * ObjectDeclarationSearchEngine.java: Now searches binary (elf) symbol table. diff --git a/frysk-core/frysk/debuginfo/DebugInfo.java b/frysk-core/frysk/debuginfo/DebugInfo.java index cf9a713..a64ebfa 100644 --- a/frysk-core/frysk/debuginfo/DebugInfo.java +++ b/frysk-core/frysk/debuginfo/DebugInfo.java @@ -76,17 +76,6 @@ public class DebugInfo { } /** - * Get the DwarfDie for a function symbol - */ - public DwarfDie getSymbolDie(String input) { - DwarfDie result = DwarfDie.getDecl(dwarf, input); - if (result == null) - throw new RuntimeException("symbol " + input + " not found."); - else - return result; - } - - /** * Implement the cli what request * * @param sInput diff --git a/frysk-core/frysk/debuginfo/ObjectDeclarationSearchEngine.java b/frysk-core/frysk/debuginfo/ObjectDeclarationSearchEngine.java index 7d35392..62849b6 100644 --- a/frysk-core/frysk/debuginfo/ObjectDeclarationSearchEngine.java +++ b/frysk-core/frysk/debuginfo/ObjectDeclarationSearchEngine.java @@ -42,14 +42,19 @@ package frysk.debuginfo; import inua.eio.ByteBuffer; import inua.eio.ByteOrder; +import java.io.File; import java.util.Iterator; import java.util.LinkedList; import java.util.List; +import lib.dwfl.Dwarf; +import lib.dwfl.DwarfCommand; import lib.dwfl.DwarfDie; import lib.dwfl.Dwfl; import lib.dwfl.DwflDieBias; import lib.dwfl.DwflModule; +import lib.dwfl.Elf; +import lib.dwfl.ElfCommand; import lib.dwfl.SymbolBuilder; import frysk.dwfl.DwflCache; import frysk.expr.ExprSymTab; @@ -78,7 +83,27 @@ public class ObjectDeclarationSearchEngine implements ExprSymTab{ this.frame = frame; this.task = frame.getTask(); } - + + /** + * Get the DwarfDie for a function symbol + * XXX: this code has been moved here from DebugInfo + * should be modified to + * - use frysk search ({@link ObjectDeclarationSearchEngine}) + * - handle # syntax + * - return ObjectDeclaration + * ... + */ + public DwarfDie getSymbolDie(String input) { + Elf elf = new Elf(new File(task.getProc().getExeFile().getSysRootedPath()), ElfCommand.ELF_C_READ); + Dwarf dwarf = new Dwarf(elf, DwarfCommand.READ, null); + + DwarfDie result = DwarfDie.getDecl(dwarf, input); + if (result == null) + throw new RuntimeException("symbol " + input + " not found."); + else + return result; + } + public ObjectDeclaration getVariable(String name){ ObjectDeclaration declaredObject = null; diff --git a/frysk-core/frysk/hpd/BreakpointCommand.java b/frysk-core/frysk/hpd/BreakpointCommand.java index c31d630..f364fbb 100644 --- a/frysk-core/frysk/hpd/BreakpointCommand.java +++ b/frysk-core/frysk/hpd/BreakpointCommand.java @@ -39,7 +39,16 @@ package frysk.hpd; -import frysk.debuginfo.DebugInfo; +import java.io.PrintWriter; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import lib.dwfl.DwarfDie; +import frysk.debuginfo.DebugInfoFrame; +import frysk.debuginfo.DebugInfoStackFactory; +import frysk.debuginfo.ObjectDeclarationSearchEngine; import frysk.event.Event; import frysk.proc.Manager; import frysk.proc.Task; @@ -48,12 +57,6 @@ import frysk.rt.FunctionBreakpoint; import frysk.rt.LineBreakpoint; import frysk.rt.SourceBreakpoint; import frysk.rt.SourceBreakpointObserver; -import java.io.PrintWriter; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; -import lib.dwfl.DwarfDie; -import java.util.List; class BreakpointCommand extends ParameterizedCommand { @@ -138,11 +141,13 @@ class BreakpointCommand extends ParameterizedCommand { } else { while (taskIter.hasNext()) { Task task = (Task) taskIter.next(); - DebugInfo debugInfo = cli.getTaskDebugInfo(task); - if (debugInfo != null) { + DebugInfoFrame frame = DebugInfoStackFactory.createDebugInfoStackTrace(task); + ObjectDeclarationSearchEngine declarationSearchEngine = new ObjectDeclarationSearchEngine(frame); + + if (declarationSearchEngine != null) { DwarfDie die; try { - die = debugInfo.getSymbolDie(breakpt); + die = declarationSearchEngine.getSymbolDie(breakpt); } catch (RuntimeException e) { // Symbol not yet visible. die = null; diff --git a/frysk-core/frysk/hpd/ChangeLog b/frysk-core/frysk/hpd/ChangeLog index 7c14beb..ed780f2 100644 --- a/frysk-core/frysk/hpd/ChangeLog +++ b/frysk-core/frysk/hpd/ChangeLog @@ -1,3 +1,9 @@ +2008-04-08 Sami Wagiaalla <swagiaal@redhat.com> + + moved getSymbolDie(String input) from DebugInfo to ObjectDeclarationSearchEngine + * ListCommand.java: Updated. + * BreakpointCommand.java: Updated + 2008-04-02 Rick Moseley <rmoseley@redhat.com> * KillCommand.java: Add ability to use HPD notation. diff --git a/frysk-core/frysk/hpd/ListCommand.java b/frysk-core/frysk/hpd/ListCommand.java index 8c7355a..79b5fd5 100644 --- a/frysk-core/frysk/hpd/ListCommand.java +++ b/frysk-core/frysk/hpd/ListCommand.java @@ -52,7 +52,7 @@ import lib.dwfl.DwarfDie; import lib.dwfl.DwTag; import lib.dwfl.DwflLine; import frysk.debuginfo.DebugInfoFrame; -import frysk.debuginfo.DebugInfo; +import frysk.debuginfo.ObjectDeclarationSearchEngine; import frysk.dwfl.DwflCache; import frysk.sysroot.SysRoot; import frysk.sysroot.SysRootCache; @@ -210,9 +210,11 @@ class ListCommand extends ParameterizedCommand { return frame.getLine().getLine(); else { DwarfDie funcDie = null; - DebugInfo debugInfo = cli.getTaskDebugInfo(task); - if (debugInfo != null) { - funcDie = debugInfo + + ObjectDeclarationSearchEngine declarationSearchEngine = new ObjectDeclarationSearchEngine(frame); + + if (declarationSearchEngine != null) { + funcDie = declarationSearchEngine .getSymbolDie(cmdParm); } if (funcDie.getTag().hashCode() == DwTag.SUBPROGRAM_) { hooks/post-receive -- frysk system monitor/debugger
reply other threads:[~2008-04-08 20:34 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=20080408203358.28840.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).