From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6208 invoked by alias); 20 Nov 2007 20:01:03 -0000 Received: (qmail 6121 invoked by uid 9561); 20 Nov 2007 20:00:59 -0000 Date: Tue, 20 Nov 2007 20:01:00 -0000 Message-ID: <20071120200059.6105.qmail@sourceware.org> From: swagiaal@sourceware.org To: frysk-cvs@sourceware.org Subject: [SCM] master: swagiaal: DeclarationSearchEngine throws an exception when an object is not found X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 41b077c1832668f78e4a3e3503bf919ea6472ac6 X-Git-Newrev: f81881effcd7fc9c9d35bc20fbac346ca4eaa088 Mailing-List: contact frysk-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: frysk-cvs-owner@sourceware.org Reply-To: frysk@sourceware.org X-SW-Source: 2007-q4/txt/msg00409.txt.bz2 The branch, master has been updated via f81881effcd7fc9c9d35bc20fbac346ca4eaa088 (commit) via 3dc414b91a043a1692b7caec0e03ff9d2563eb0a (commit) from 41b077c1832668f78e4a3e3503bf919ea6472ac6 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit f81881effcd7fc9c9d35bc20fbac346ca4eaa088 Author: Sami Wagiaalla Date: Tue Nov 20 14:46:48 2007 -0500 swagiaal: DeclarationSearchEngine throws an exception when an object is not found frysk-core/frysk/debuginfo/ChangeLog +2007-11-20 Sami Wagiaalla + + * ObjectDeclarationSearchEngine.java (getVariable): Now throws + ObjectDeclaratioinNotFoundException instead of returning null. + * TestObjectDeclarationSearchEngine.java (verifyVariable): Updated. + * ObjectDeclaratioinNotFoundException.java: New file. + commit 3dc414b91a043a1692b7caec0e03ff9d2563eb0a Author: Sami Wagiaalla Date: Tue Nov 20 14:10:05 2007 -0500 swagiaal: function parameter values are no longer printed frysk-core/frysk/bindir/ChangeLog +2007-11-20 Sami Wagiaalla + + * TestFstack.java (testBackTraceWithDashC): Removed check for + param values. + (testBackTraceWithDashA): Ditto. + frysk-core/frysk/scopes/ChangeLog +2007-11-20 Sami Wagiaalla + + * Scope.java (toPrint): Added printing for variable + value. + frysk-core/frysk/value/ChangeLog +2007-11-20 Sami Wagiaalla + + * Variable.java (toPrint): No longer prints variable values; + values must now be printed explicitly. + (printValue): Prints variable values. + ----------------------------------------------------------------------- Summary of changes: frysk-core/frysk/bindir/ChangeLog | 6 ++++++ frysk-core/frysk/bindir/TestFstack.java | 4 ++-- frysk-core/frysk/debuginfo/ChangeLog | 7 +++++++ ...va => ObjectDeclaratioinNotFoundException.java} | 7 ++++++- .../debuginfo/ObjectDeclarationSearchEngine.java | 2 +- .../TestObjectDeclarationSearchEngine.java | 10 ++++++++-- frysk-core/frysk/scopes/ChangeLog | 5 +++++ frysk-core/frysk/scopes/Scope.java | 2 ++ frysk-core/frysk/value/ChangeLog | 6 ++++++ frysk-core/frysk/value/Variable.java | 11 +++++------ 10 files changed, 48 insertions(+), 12 deletions(-) copy frysk-core/frysk/debuginfo/{ValueUavailableException.java => ObjectDeclaratioinNotFoundException.java} (92%) First 500 lines of diff: diff --git a/frysk-core/frysk/bindir/ChangeLog b/frysk-core/frysk/bindir/ChangeLog index b936499..4dbced2 100644 --- a/frysk-core/frysk/bindir/ChangeLog +++ b/frysk-core/frysk/bindir/ChangeLog @@ -1,3 +1,9 @@ +2007-11-20 Sami Wagiaalla + + * TestFstack.java (testBackTraceWithDashC): Removed check for + param values. + (testBackTraceWithDashA): Ditto. + 2007-11-19 Phil Muldoon * TestFhd.java (testHpdCore): Remove unresolved. diff --git a/frysk-core/frysk/bindir/TestFstack.java b/frysk-core/frysk/bindir/TestFstack.java index 58f1323..d45899d 100644 --- a/frysk-core/frysk/bindir/TestFstack.java +++ b/frysk-core/frysk/bindir/TestFstack.java @@ -115,7 +115,7 @@ public class TestFstack public void testBackTraceWithDashA () { Expect e = fstack("funit-stack-outlined", new String[] { "-a" }); - e.expect("\\#0 .* in third\\(int arg3 = 3\\)" + e.expect("\\#0 .* in third\\(int arg3\\)" + ".*" + Config.getRootSrcDir() + ".*" + "funit-stack-outlined" + "\\.c#" + ".*int var3.*"); @@ -124,7 +124,7 @@ public class TestFstack public void testBackTraceWithDashC () { Expect e = fstack("funit-stack-outlined", new String[] { "-c" }); - e.expect("\\#0 .* in third\\(int arg3 = 3\\)" + e.expect("\\#0 .* in third\\(int arg3\\)" + ".*" + Config.getRootSrcDir() + ".*" + "funit-stack-outlined" + "\\.c#"); e.expect("\\#1"); diff --git a/frysk-core/frysk/debuginfo/ChangeLog b/frysk-core/frysk/debuginfo/ChangeLog index 511f81f..76f2ed8 100644 --- a/frysk-core/frysk/debuginfo/ChangeLog +++ b/frysk-core/frysk/debuginfo/ChangeLog @@ -1,3 +1,10 @@ +2007-11-20 Sami Wagiaalla + + * ObjectDeclarationSearchEngine.java (getVariable): Now throws + ObjectDeclaratioinNotFoundException instead of returning null. + * TestObjectDeclarationSearchEngine.java (verifyVariable): Updated. + * ObjectDeclaratioinNotFoundException.java: New file. + 2007-11-19 Stan Cox * TypeEntry.java (getType): Remove setTypedefFIXME from STRUCTURE_TYPE_. diff --git a/frysk-core/frysk/debuginfo/ValueUavailableException.java b/frysk-core/frysk/debuginfo/ObjectDeclaratioinNotFoundException.java similarity index 92% copy from frysk-core/frysk/debuginfo/ValueUavailableException.java copy to frysk-core/frysk/debuginfo/ObjectDeclaratioinNotFoundException.java index 3b73bee..29df295 100644 --- a/frysk-core/frysk/debuginfo/ValueUavailableException.java +++ b/frysk-core/frysk/debuginfo/ObjectDeclaratioinNotFoundException.java @@ -39,11 +39,16 @@ package frysk.debuginfo; -public class ValueUavailableException extends RuntimeException { +public class ObjectDeclaratioinNotFoundException extends RuntimeException { + + public ObjectDeclaratioinNotFoundException(String name) { + super("Object "+ name + " was not found"); + } /** * */ private static final long serialVersionUID = 1L; + } diff --git a/frysk-core/frysk/debuginfo/ObjectDeclarationSearchEngine.java b/frysk-core/frysk/debuginfo/ObjectDeclarationSearchEngine.java index 62864b0..363569c 100644 --- a/frysk-core/frysk/debuginfo/ObjectDeclarationSearchEngine.java +++ b/frysk-core/frysk/debuginfo/ObjectDeclarationSearchEngine.java @@ -92,7 +92,7 @@ public class ObjectDeclarationSearchEngine implements ExprSymTab{ scope = scope.getOuter(); } - return null; + throw new ObjectDeclaratioinNotFoundException(name); } public Type getType(Variable variable) { diff --git a/frysk-core/frysk/debuginfo/TestObjectDeclarationSearchEngine.java b/frysk-core/frysk/debuginfo/TestObjectDeclarationSearchEngine.java index b861250..804e8bd 100644 --- a/frysk-core/frysk/debuginfo/TestObjectDeclarationSearchEngine.java +++ b/frysk-core/frysk/debuginfo/TestObjectDeclarationSearchEngine.java @@ -166,8 +166,14 @@ public class TestObjectDeclarationSearchEngine extends TestLib{ assertTrue("Found the correct variable", variable.getLineNumber() == variableLine); //Negative test: - variable = (Variable) objectDeclarationSearchEngine.getVariable("NOT"+variableName); - assertNull("Bogus object was not found", variable); + try { + variable = (Variable) objectDeclarationSearchEngine.getVariable("NOT"+variableName); + assertTrue("Exception was thrown", false); + } catch (ObjectDeclaratioinNotFoundException e) { + // exception was thrown + } + + } } diff --git a/frysk-core/frysk/scopes/ChangeLog b/frysk-core/frysk/scopes/ChangeLog index 499343f..2f114b5 100644 --- a/frysk-core/frysk/scopes/ChangeLog +++ b/frysk-core/frysk/scopes/ChangeLog @@ -1,3 +1,8 @@ +2007-11-20 Sami Wagiaalla + + * Scope.java (toPrint): Added printing for variable + value. + 2007-11-09 Sami Wagiaalla * Composite.java (getType): New function. diff --git a/frysk-core/frysk/scopes/Scope.java b/frysk-core/frysk/scopes/Scope.java index 0008ba4..d30d068 100644 --- a/frysk-core/frysk/scopes/Scope.java +++ b/frysk-core/frysk/scopes/Scope.java @@ -197,6 +197,8 @@ public class Scope writer.println(); writer.print(indentString + " "); variable.toPrint(writer, frame); + writer.print(" = "); + variable.printValue(writer, frame); writer.print(" "); variable.printLineCol(writer); writer.flush(); diff --git a/frysk-core/frysk/value/ChangeLog b/frysk-core/frysk/value/ChangeLog index a36eaef..da2438c 100644 --- a/frysk-core/frysk/value/ChangeLog +++ b/frysk-core/frysk/value/ChangeLog @@ -1,3 +1,9 @@ +2007-11-20 Sami Wagiaalla + + * Variable.java (toPrint): No longer prints variable values; + values must now be printed explicitly. + (printValue): Prints variable values. + 2007-11-19 Stan Cox * Type.java (isTypedef): Delete. diff --git a/frysk-core/frysk/value/Variable.java b/frysk-core/frysk/value/Variable.java index 297eeca..c8050f6 100644 --- a/frysk-core/frysk/value/Variable.java +++ b/frysk-core/frysk/value/Variable.java @@ -51,10 +51,6 @@ import frysk.debuginfo.TypeEntry; import frysk.debuginfo.ValueUavailableException; import frysk.debuginfo.VariableOptimizedOutException; import frysk.isa.ISA; -import frysk.value.ObjectDeclaration; -import frysk.value.Format; -import frysk.value.Type; -import frysk.value.Value; /** * This class contains the static information corresponding to a @@ -109,7 +105,10 @@ public class Variable extends ObjectDeclaration{ type.toPrint(printWriter, 0); printWriter.print(" "); printWriter.print(this.getName()); - printWriter.print(" = "); + + } + + public void printValue(PrintWriter printWriter, DebugInfoFrame frame){ try { Value value = getValue(frame); value.toPrint(printWriter, frame.getTask().getMemory(), @@ -122,7 +121,7 @@ public class Variable extends ObjectDeclaration{ printWriter.print("< ERROR >"); } } - + public void printLineCol(PrintWriter printWriter) { printWriter.print("line#"); try { hooks/post-receive -- frysk system monitor/debugger