public inbox for frysk-cvs@sourceware.org
help / color / mirror / Atom feed
* [SCM]  master: Provide fine grained control over printing stack library/source paths.
@ 2008-06-10 22:46 cagney
  0 siblings, 0 replies; only message in thread
From: cagney @ 2008-06-10 22:46 UTC (permalink / raw)
  To: frysk-cvs

The branch, master has been updated
       via  a67d402d632120a8333704285870220e35a87328 (commit)
      from  a41c8b2d53e4cfe4173f75b717d0c9ced0449982 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit a67d402d632120a8333704285870220e35a87328
Author: Andrew Cagney <cagney@toil.yyz.redhat.com>
Date:   Tue Jun 10 18:43:00 2008 -0400

    Provide fine grained control over printing stack library/source paths.
    
    frysk-core/frysk/bindir/ChangeLog
    2008-06-10  Andrew Cagney  <cagney@redhat.com>
    
    	* TestFstack.java (testBackTrace,
    	testBackTraceWithDebugNamesAndParams): Check for from <exe>.
    
    frysk-core/frysk/debuginfo/ChangeLog
    2008-06-10  Andrew Cagney  <cagney@redhat.com>
    
    	* PrintDebugInfoStackOptions.java (printSourcePaths): New.
    	(setPrintPaths(boolean)): New.
    	* DebugInfoFrame.java: Update.
    	* TestFrameDebugInfo.java: Use setPrintPaths.
    
    frysk-core/frysk/hpd/ChangeLog
    2008-06-10  Andrew Cagney  <cagney@redhat.com>
    
    	* StackCommands.java: Use setPrintPaths.
    
    frysk-core/frysk/stack/ChangeLog
    2008-06-10  Andrew Cagney  <cagney@redhat.com>
    
    	* Frame.java (toPrint): Use printLibraryPaths.
    	* PrintStackOptions.java (printLibraryPaths): Replace printFullPaths.
    	(setPrintPaths(boolean)): New.
    
    frysk-core/frysk/util/ChangeLog
    2008-06-10  Andrew Cagney  <cagney@redhat.com>
    
    	* TestStackTraceAction.java: Use setPrintPaths.
    	* stack-options.xml: Add paths, lib-paths, src-paths, values to
    	print options.

-----------------------------------------------------------------------

Summary of changes:
 frysk-core/frysk/bindir/ChangeLog                  |    8 +++--
 frysk-core/frysk/bindir/TestFstack.java            |    4 +-
 frysk-core/frysk/debuginfo/ChangeLog               |    5 +++
 frysk-core/frysk/debuginfo/DebugInfoFrame.java     |    2 +-
 .../debuginfo/PrintDebugInfoStackOptions.java      |   20 +++++++++++
 frysk-core/frysk/debuginfo/TestFrameDebugInfo.java |    6 ++--
 frysk-core/frysk/hpd/ChangeLog                     |    4 ++
 frysk-core/frysk/hpd/StackCommands.java            |    2 +-
 frysk-core/frysk/stack/ChangeLog                   |    4 ++
 frysk-core/frysk/stack/Frame.java                  |    2 +-
 frysk-core/frysk/stack/PrintStackOptions.java      |   21 +++++++----
 frysk-core/frysk/util/ChangeLog                    |    4 ++
 frysk-core/frysk/util/StackPrintUtil.java          |   10 ++++--
 frysk-core/frysk/util/TestStackTraceAction.java    |    2 +-
 frysk-core/frysk/util/stack-options.xml            |   37 ++++++++++++++-----
 15 files changed, 99 insertions(+), 32 deletions(-)

First 500 lines of diff:
diff --git a/frysk-core/frysk/bindir/ChangeLog b/frysk-core/frysk/bindir/ChangeLog
index ce774a0..29df5ba 100644
--- a/frysk-core/frysk/bindir/ChangeLog
+++ b/frysk-core/frysk/bindir/ChangeLog
@@ -1,8 +1,10 @@
 2008-06-10  Andrew Cagney  <cagney@redhat.com>
 
-	* TestFstack.java (testBackTrace,
-	testBackTraceWithDebugNamesAndParams): Check for from <exe>.
-
+	* TestFstack.java (testBackTraceWithFullPath): Specify "paths",
+	not "full-path".
+	
+	* TestFstack.java (testBackTrace)
+	(testBackTraceWithDebugNamesAndParams): Check for from <exe>.
 	* TestFstack.java (testBackTraceWithRich()): Mark as unresolved;
 	bug 6616.
 	* ferror.java: Use PrintDebugInfoStackOptions; don't specify the
diff --git a/frysk-core/frysk/bindir/TestFstack.java b/frysk-core/frysk/bindir/TestFstack.java
index fbcb730..952f12d 100644
--- a/frysk-core/frysk/bindir/TestFstack.java
+++ b/frysk-core/frysk/bindir/TestFstack.java
@@ -94,9 +94,9 @@ public class TestFstack extends TestLib {
 	e.expect("\\#1");
     }
 
-    public void testBackTraceWithFullPath () {
+    public void testBackTraceWithFullPath() {
 	TearDownExpect e = fstack("funit-stack-outlined", new String[] {
-		"-rich", "-print", "full-path"
+		"-rich", "-print", "paths"
 	    });
         e.expect (getCanonicalRootSrcDir()
 		  + ".*"
diff --git a/frysk-core/frysk/debuginfo/ChangeLog b/frysk-core/frysk/debuginfo/ChangeLog
index 8c2186b..16d23f3 100644
--- a/frysk-core/frysk/debuginfo/ChangeLog
+++ b/frysk-core/frysk/debuginfo/ChangeLog
@@ -1,5 +1,10 @@
 2008-06-10  Andrew Cagney  <cagney@redhat.com>
 
+	* PrintDebugInfoStackOptions.java (printSourcePaths): New.
+	(setPrintPaths(boolean)): New.
+	* DebugInfoFrame.java: Update.
+	* TestFrameDebugInfo.java: Use setPrintPaths.
+
 	* DebugInfoFrame.java (toPrint): Print the library using
 	Frame.printLibraryName.
 	
diff --git a/frysk-core/frysk/debuginfo/DebugInfoFrame.java b/frysk-core/frysk/debuginfo/DebugInfoFrame.java
index 3a0482e..586ed65 100644
--- a/frysk-core/frysk/debuginfo/DebugInfoFrame.java
+++ b/frysk-core/frysk/debuginfo/DebugInfoFrame.java
@@ -199,7 +199,7 @@ public class DebugInfoFrame extends FrameDecorator {
 	    }
 	    writer.print(") at ");
 	    SourceLocation line = this.getLine();
-	    if (options.printFullPaths()) {
+	    if (options.printSourcePaths()) {
 		writer.print(line.getFile().getPath());
 	    } else {
 		writer.print(line.getFile().getName());
diff --git a/frysk-core/frysk/debuginfo/PrintDebugInfoStackOptions.java b/frysk-core/frysk/debuginfo/PrintDebugInfoStackOptions.java
index c2110e1..486eae3 100644
--- a/frysk-core/frysk/debuginfo/PrintDebugInfoStackOptions.java
+++ b/frysk-core/frysk/debuginfo/PrintDebugInfoStackOptions.java
@@ -52,6 +52,7 @@ public class PrintDebugInfoStackOptions extends PrintStackOptions {
     private boolean printInlineFunctions;
     private boolean printDebugNames;
     private boolean printValues;
+    private boolean printSourcePaths;
     
     /**
      * Clear all options.
@@ -86,6 +87,14 @@ public class PrintDebugInfoStackOptions extends PrintStackOptions {
     }
 
     /**
+     * Print the full path to any source file.
+     */
+    public void setPrintPaths(boolean printPaths) {
+	super.setPrintPaths(printPaths);
+	setPrintSourcePaths(printPaths);
+    }
+
+    /**
      * Print the parameter list (see also printValues).
      */
     public boolean printParameters() {
@@ -137,6 +146,17 @@ public class PrintDebugInfoStackOptions extends PrintStackOptions {
 	this.printDebugNames = printDebugNames;
     }
 
+    /**
+     * Print the full path to source files (instead of just the file
+     * name).
+     */
+    public boolean printSourcePaths() {
+	return printSourcePaths;
+    }
+    public void setPrintSourcePaths(boolean printSourcePaths) {
+	this.printSourcePaths = printSourcePaths;
+    }
+
     public boolean abiOnly() {
 	return ! (printLocals
 		  || printInlineFunctions
diff --git a/frysk-core/frysk/debuginfo/TestFrameDebugInfo.java b/frysk-core/frysk/debuginfo/TestFrameDebugInfo.java
index ec0c65d..74eead7 100644
--- a/frysk-core/frysk/debuginfo/TestFrameDebugInfo.java
+++ b/frysk-core/frysk/debuginfo/TestFrameDebugInfo.java
@@ -88,7 +88,7 @@ public class TestFrameDebugInfo extends TestLib {
     options.setNumberOfFrames(20);
     options.setPrintParameters(true);
     options.setPrintLocals(true);
-    options.setPrintFullPaths(true);
+    options.setPrintPaths(true);
     DebugInfoStackFactory.printStackTrace(new PrintWriter(stringWriter),frame, options);
       
     String string = stringWriter.getBuffer().toString();
@@ -310,7 +310,7 @@ public class TestFrameDebugInfo extends TestLib {
     options.setNumberOfFrames(0);
     options.setPrintParameters(true);
     options.setPrintLocals(true);
-    options.setPrintFullPaths(true);
+    options.setPrintPaths(true);
     DebugInfoStackFactory.printVirtualTaskStackTrace(new PrintWriter(stringWriter), task, options);
     
     assertTrue("contains inline", stringWriter.getBuffer().toString().contains("inline"));
@@ -329,7 +329,7 @@ public class TestFrameDebugInfo extends TestLib {
     options.setNumberOfFrames(0); 
     options.setPrintParameters(true);
     options.setPrintLocals(true);
-    options.setPrintFullPaths(true);
+    options.setPrintPaths(true);
     
     DebugInfoFrame frame = DebugInfoStackFactory.createVirtualStackTrace(task);
     frame = frame.getOuterDebugInfoFrame();
diff --git a/frysk-core/frysk/hpd/ChangeLog b/frysk-core/frysk/hpd/ChangeLog
index 8b619f7..9fb2ad2 100644
--- a/frysk-core/frysk/hpd/ChangeLog
+++ b/frysk-core/frysk/hpd/ChangeLog
@@ -1,3 +1,7 @@
+2008-06-10  Andrew Cagney  <cagney@redhat.com>
+
+	* StackCommands.java: Use setPrintPaths.
+
 2008-06-10  Rick Moseley  <rmoseley@redhat.com>
 
 	* StartRun.java: Do not kill core procs.
diff --git a/frysk-core/frysk/hpd/StackCommands.java b/frysk-core/frysk/hpd/StackCommands.java
index 9e80d37..16f183a 100644
--- a/frysk-core/frysk/hpd/StackCommands.java
+++ b/frysk-core/frysk/hpd/StackCommands.java
@@ -75,7 +75,7 @@ abstract class StackCommands extends ParameterizedCommand {
 	printStackOptions.setNumberOfFrames(stopLevel);
 	printStackOptions.setPrintParameters(true);
 	printStackOptions.setPrintLocals(options.printLocals);
-	printStackOptions.setPrintFullPaths(true);
+	printStackOptions.setPrintPaths(true);
 	
 	DebugInfoStackFactory.printStackTrace(cli.outWriter, frame,
 					      printStackOptions);
diff --git a/frysk-core/frysk/stack/ChangeLog b/frysk-core/frysk/stack/ChangeLog
index 367f17a..e766365 100644
--- a/frysk-core/frysk/stack/ChangeLog
+++ b/frysk-core/frysk/stack/ChangeLog
@@ -1,5 +1,9 @@
 2008-06-10  Andrew Cagney  <cagney@redhat.com>
 
+	* Frame.java (toPrint): Use printLibraryPaths.
+	* PrintStackOptions.java (printLibraryPaths): Replace printFullPaths.
+	(setPrintPaths(boolean)): New.
+
 	* Frame.java (printLibraryName(PrintWriter,PrintStackOptions)): New.
 	(toPrint(PrintWriter,PrintStackOptions)): Use.
 	
diff --git a/frysk-core/frysk/stack/Frame.java b/frysk-core/frysk/stack/Frame.java
index 2ad9ea5..5405ae7 100644
--- a/frysk-core/frysk/stack/Frame.java
+++ b/frysk-core/frysk/stack/Frame.java
@@ -175,7 +175,7 @@ public abstract class Frame {
 		    writer.print(library);
 		} else {
 		    // Should there be separate libraryFullPath?
-		    if (options.printFullPaths()) {
+		    if (options.printLibraryPaths()) {
 			writer.print(library);
 		    } else {
 			// Discard the path
diff --git a/frysk-core/frysk/stack/PrintStackOptions.java b/frysk-core/frysk/stack/PrintStackOptions.java
index ea400f2..2e3f161 100644
--- a/frysk-core/frysk/stack/PrintStackOptions.java
+++ b/frysk-core/frysk/stack/PrintStackOptions.java
@@ -45,7 +45,7 @@ public class PrintStackOptions {
 
     private int numberOfFrames = 10;
 
-    private boolean printFullPaths;
+    private boolean printLibraryPaths;
     private boolean printLibraryNames;
     
     public PrintStackOptions() {
@@ -57,7 +57,7 @@ public class PrintStackOptions {
      * produced.
      */
     public void clear() {
-	printFullPaths = false;
+	printLibraryPaths = false;
 	printLibraryNames = false;
     }
     
@@ -67,11 +67,18 @@ public class PrintStackOptions {
      */
     public void setAbi() {
 	clear();
-	printFullPaths = false;
+	printLibraryPaths = false;
 	printLibraryNames = true;
     }
 
     /**
+     * Include the full path to any files.
+     */
+    public void setPrintPaths(boolean printPaths) {
+	setPrintLibraryPaths(printPaths);
+    }
+
+    /**
      * Specify the number of frames to include in the back-trace, 0 to
      * include all frames.
      */
@@ -82,11 +89,11 @@ public class PrintStackOptions {
 	return numberOfFrames;
     }
 
-    public void setPrintFullPaths(boolean printFullPaths) {
-	this.printFullPaths = printFullPaths;
+    public void setPrintLibraryPaths(boolean printLibraryPaths) {
+	this.printLibraryPaths = printLibraryPaths;
     }
-    public boolean printFullPaths() {
-	return printFullPaths;
+    public boolean printLibraryPaths() {
+	return printLibraryPaths;
     }
 
     public void setPrintLibraryNames(boolean printLibraryNames) {
diff --git a/frysk-core/frysk/util/ChangeLog b/frysk-core/frysk/util/ChangeLog
index 2e2f1c6..bb8009f 100644
--- a/frysk-core/frysk/util/ChangeLog
+++ b/frysk-core/frysk/util/ChangeLog
@@ -1,5 +1,9 @@
 2008-06-10  Andrew Cagney  <cagney@redhat.com>
 
+	* TestStackTraceAction.java: Use setPrintPaths.
+	* stack-options.xml: Add paths, lib-paths, src-paths, values to
+	print options.
+	
 	* TestStackTraceAction.java: Use PrintDebugInfoStackOptions.
 	* StackPrintUtil.java: Ditto.
 	* StacktraceAction.java: Ditto.
diff --git a/frysk-core/frysk/util/StackPrintUtil.java b/frysk-core/frysk/util/StackPrintUtil.java
index 6f1f100..c654b26 100644
--- a/frysk-core/frysk/util/StackPrintUtil.java
+++ b/frysk-core/frysk/util/StackPrintUtil.java
@@ -94,7 +94,7 @@ public class StackPrintUtil {
 		  ("print", "select the back-trace information to display\n"
 		   + "OPTION is:\n"
 		   + "debug-names: print debug-info names (e.g., DWARF)\n"
-		   + "full-path: include the full (untruncated) path to files\n"
+		   + "paths: include the full path to source files (src-paths) and libraries (lib-paths)e"
 		   + "inline: include inlined frames\n"
 		   + "locals: include each function's local variables\n"
 		   //+ "params: include function parameters\n"
@@ -114,8 +114,12 @@ public class StackPrintUtil {
 			}
 			if (name.equals("debug-names")) {
 			    options.setPrintDebugNames(val);
-			} else if (name.equals("full-path")) {
-			    options.setPrintFullPaths(val);
+			} else if (name.equals("paths")) {
+			    options.setPrintPaths(val);
+			} else if (name.equals("lib-paths")) {
+			    options.setPrintLibraryPaths(val);
+			} else if (name.equals("src-paths")) {
+			    options.setPrintSourcePaths(val);
 			} else if (name.equals("inline")) {
 			    options.setPrintInlineFunctions(val);
 			} else if (name.equals("locals")) {
diff --git a/frysk-core/frysk/util/TestStackTraceAction.java b/frysk-core/frysk/util/TestStackTraceAction.java
index 5951727..42fe49b 100644
--- a/frysk-core/frysk/util/TestStackTraceAction.java
+++ b/frysk-core/frysk/util/TestStackTraceAction.java
@@ -80,7 +80,7 @@ public class TestStackTraceAction extends TestLib {
 			      int numSecondaryThreads) {
 	PrintDebugInfoStackOptions options = new PrintDebugInfoStackOptions();
 	options.setNumberOfFrames(20);
-	options.setPrintFullPaths(true);
+	options.setPrintPaths(true);
 	options.setPrintLibraryNames(true);
 
 	StringWriter stringWriter = new StringWriter();
diff --git a/frysk-core/frysk/util/stack-options.xml b/frysk-core/frysk/util/stack-options.xml
index 90eeab4..5555d01 100644
--- a/frysk-core/frysk/util/stack-options.xml
+++ b/frysk-core/frysk/util/stack-options.xml
@@ -74,19 +74,36 @@
     </varlistentry>
 
     <varlistentry>
-      <term><option>-print <replaceable>print-option</replaceable>,...</option></term>
+      <term>
+	<option>-print <replaceable>print-option</replaceable>,...</option>
+      </term>
       <listitem>
-	<para>Specify the level of detail to include in a stack
+	<para>
+	  Specify the level of detail to include in a stack
 	  back-trace.  <replaceable>print-option</replaceable> can be
-	  any of: debug-names - use debug information, such as DWARF,
-	  to determine the name of functions; full-path - do not
-	  truncate file paths; inline - include in-line function in
-	  back-trace; locals - to include local variables from each
-	  frame; params - include the values of any parameters.  To
-	  negate a <replaceable>print-option</replaceable> prefix it
-	  with "-".</para></listitem>
+	  any of:
+	</para>
+
+	<para>debug-names: use debug information, such as DWARF, to
+	determine the name of functions</para>
+
+	<para>paths: include the full path to source files and
+	libraries</para>
+
+	<para>inline: include in-line function in back-trace</para>
+
+	<para>locals: to include local variables from each
+	frame</para>
+
+	<para>params: include the function parameters</para>
+	
+	<para>
+	  To negate a <replaceable>print-option</replaceable> prefix
+	  it with "-".
+	</para>
+
+      </listitem>
     </varlistentry>
-    
   </variablelist>
 
 </refsect2>


hooks/post-receive
--
frysk system monitor/debugger


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-06-10 22:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-06-10 22:46 [SCM] master: Provide fine grained control over printing stack library/source paths cagney

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).