public inbox for frysk@sourceware.org
 help / color / mirror / Atom feed
* Re: [SCM]  <..>: swagiaal: fstack now prints shortened path names  by default
       [not found] <20071123205633.21966.qmail@sourceware.org>
@ 2007-11-26  8:48 ` Phil Muldoon
  0 siblings, 0 replies; only message in thread
From: Phil Muldoon @ 2007-11-26  8:48 UTC (permalink / raw)
  To: frysk

swagiaal@sourceware.org wrote:

Sami

I think this code caused a small regression. Filed details here:

http://sourceware.org/bugzilla/show_bug.cgi?id=5401

Regards

Phil
> The branch, master has been updated
>        via  62aaf4a1ee1f7a68ac9f8d694dd0bddba90c08ed (commit)
>       from  61673966237af43b52cb33a5f93a1803c66d2884 (commit)
>
> Those revisions listed above that are new to this repository have
> not appeared on any other notification email.
>
> - Log -----------------------------------------------------------------
> commit 62aaf4a1ee1f7a68ac9f8d694dd0bddba90c08ed
> Author: Sami Wagiaalla <swagiaal@redhat.com>
> Date:   Fri Nov 23 15:48:53 2007 -0500
>
>     swagiaal: fstack now prints shortened path names by default
>     
>     frysk-core/frysk/bindir/ChangeLog
>     +2007-11-23  Sami Wagiaalla  <swagiaal@redhat.com>
>     +
>     +       * fstack.java: Added -fullpath option
>     +
>     
>     frysk-core/frysk/debuginfo/ChangeLog
>     +2007-11-23  Sami Wagiaalla  <swagiaal@redhat.com>
>     +
>     +       * DebugInfoFrame.java: Added ".../" befor abbrivated file path.
>     +       * DebugInfoStackFactory.java: Removed misc print statement.
>     +
>     
>     frysk-core/frysk/proc/dead/ChangeLog
>     @@ -1,3 +1,7 @@
>     +2007-11-23  Sami Wagiaalla  <swagiaal@redhat.com>
>     +
>     +       * TestLinuxCore.java: Updated.
>     +
>     
>     frysk-core/frysk/stack/ChangeLog
>     +2007-11-23  Sami Wagiaalla  <swagiaal@redhat.com>
>     +
>     +       * Frame.java (toPrint): Removed printlibrary boolean argument.
>     +       added fullpath boolean argument.
>     +       * StackFactory.java: Updated
>     +
>     
>     frysk-core/frysk/util/ChangeLog
>     +2007-11-23  Sami Wagiaalla  <swagiaal@redhat.com>
>     +
>     +       Removed printlibrary boolean argument from Frame.toPrint()
>     +       added fullpath boolean argument.
>     +       * StacktraceAction.java: Updated.
>     +       * StressTestFStack.java: Updated.
>     +       * TestFStack.java: Updated.
>     +
>
> -----------------------------------------------------------------------
>
> Summary of changes:
>  frysk-core/frysk/bindir/ChangeLog                  |    6 ++++++
>  frysk-core/frysk/bindir/TestFstack.java            |   14 +++++++-------
>  frysk-core/frysk/bindir/fstack.java                |   16 +++++++++++-----
>  frysk-core/frysk/debuginfo/ChangeLog               |    5 +++++
>  frysk-core/frysk/debuginfo/DebugInfoFrame.java     |    2 +-
>  .../frysk/debuginfo/DebugInfoStackFactory.java     |    4 +---
>  frysk-core/frysk/proc/dead/ChangeLog               |    4 ++++
>  frysk-core/frysk/proc/dead/TestLinuxCore.java      |    4 ++--
>  frysk-core/frysk/stack/ChangeLog                   |    6 ++++++
>  frysk-core/frysk/stack/Frame.java                  |   15 +++++++++------
>  frysk-core/frysk/stack/StackFactory.java           |    4 ++--
>  frysk-core/frysk/util/ChangeLog                    |    8 ++++++++
>  frysk-core/frysk/util/StacktraceAction.java        |    6 ++----
>  frysk-core/frysk/util/StressTestFStack.java        |    2 +-
>  frysk-core/frysk/util/TestFStack.java              |    4 ++--
>  15 files changed, 67 insertions(+), 33 deletions(-)
>
> First 500 lines of diff:
> diff --git a/frysk-core/frysk/bindir/ChangeLog b/frysk-core/frysk/bindir/ChangeLog
> index 1921a3d..bc95dbe 100644
> --- a/frysk-core/frysk/bindir/ChangeLog
> +++ b/frysk-core/frysk/bindir/ChangeLog
> @@ -1,3 +1,9 @@
> +2007-11-23  Sami Wagiaalla  <swagiaal@redhat.com>
> +
> +	* TestFstack.java (testBackTraceWithDashN): Updated regex to not
> +	match newline.
> +	* fstack.java: Added -fullpath option
> +
>  2007-11-22  Sami Wagiaalla  <swagiaal@redhat.com>
>  
>  	* TestFstack.java (testBackTraceWithDashN): enabled test.
> diff --git a/frysk-core/frysk/bindir/TestFstack.java b/frysk-core/frysk/bindir/TestFstack.java
> index 61cd6ac..00f7eef 100644
> --- a/frysk-core/frysk/bindir/TestFstack.java
> +++ b/frysk-core/frysk/bindir/TestFstack.java
> @@ -142,18 +142,18 @@ public class TestFstack
>  	
>  	Expect e = fstack("funit-long-stack", new String[]{"-n","5"});
>  	e.expect("\\#0 .*crash[^\\r\\n]*");
> -	e.expect("\\#1 .*first[^\\r\\n]*");
> -	e.expect("\\#2 .*first[^\\r\\n]*");
> -	e.expect("\\#3 .*first[^\\r\\n]*");
> -	e.expect("\\#4 .*first[^\\r\\n]*");
> +	e.expect("\\#1 [^\r\n]*first[^\\r\\n]*");
> +	e.expect("\\#2 [^\r\n]*first[^\\r\\n]*");
> +	e.expect("\\#3 [^\r\n]*first[^\\r\\n]*");
> +	e.expect("\\#4 [^\r\n]*first[^\\r\\n]*");
>  	e.expect("...");
>  	e.close();
>  	
>  	e = fstack("funit-long-stack", new String[]{"-n","4"});
>  	e.expect("\\#0 .*crash[^\\r\\n]*");
> -	e.expect("\\#1 .*first[^\\r\\n]*");
> -	e.expect("\\#2 .*first[^\\r\\n]*");
> -	e.expect("\\#3 .*first[^\\r\\n]*");
> +	e.expect("\\#1 [^\r\n]*first[^\\r\\n]*");
> +	e.expect("\\#2 [^\r\n]*first[^\\r\\n]*");
> +	e.expect("\\#3 [^\r\n]*first[^\\r\\n]*");
>  	e.expect("...");
>  	e.close();
>  	
> diff --git a/frysk-core/frysk/bindir/fstack.java b/frysk-core/frysk/bindir/fstack.java
> index bb4f250..98e1046 100644
> --- a/frysk-core/frysk/bindir/fstack.java
> +++ b/frysk-core/frysk/bindir/fstack.java
> @@ -73,7 +73,6 @@ public final class fstack
>    static boolean printParameters = false;
>    static boolean printScopes = false;
>    static boolean fullpath = false;
> -  static boolean printSourceLibrary = true;
>    
>    private static class Stacker extends StacktraceAction
>    {
> @@ -81,9 +80,9 @@ public final class fstack
>      Proc proc;
>      public Stacker (PrintWriter printWriter, Proc theProc, Event theEvent,int numberOfFrames, boolean elfOnly, boolean virtualFrames,
>                      boolean printParameters, boolean printScopes, 
> -                    boolean fullpath, boolean printSourceLibrary)
> +                    boolean fullpath)
>      {
> -      super(printWriter, theProc, theEvent, numberOfFrames, elfOnly,virtualFrames, printParameters, printScopes, fullpath,printSourceLibrary);
> +      super(printWriter, theProc, theEvent, numberOfFrames, elfOnly,virtualFrames, printParameters, printScopes, fullpath);
>        this.proc = theProc;
>      }
>  
> @@ -142,7 +141,7 @@ public final class fstack
>    {
>        
>      Proc proc = Util.getProcFromCoreExePair(coreExePair);
> -    stacker = new Stacker(printWriter, proc, new PrintEvent(), numberOfFrames, elfOnly,virtualFrames,printParameters,printScopes, fullpath,printSourceLibrary);
> +    stacker = new Stacker(printWriter, proc, new PrintEvent(), numberOfFrames, elfOnly,virtualFrames,printParameters,printScopes, fullpath);
>      new ProcCoreAction(proc, stacker);
>      Manager.eventLoop.run();
>    }
> @@ -150,7 +149,7 @@ public final class fstack
>    private static void stackPid (ProcId procId)
>    {
>      Proc proc = Util.getProcFromPid(procId);
> -    stacker = new Stacker(printWriter, proc, new AbandonPrintEvent(proc), numberOfFrames, elfOnly,virtualFrames,printParameters,printScopes, fullpath,printSourceLibrary);
> +    stacker = new Stacker(printWriter, proc, new AbandonPrintEvent(proc), numberOfFrames, elfOnly,virtualFrames,printParameters,printScopes, fullpath);
>      new ProcBlockAction(proc, stacker);
>      Manager.eventLoop.run();
>    }
> @@ -189,6 +188,13 @@ public final class fstack
>  	  }
>        });
>   
> +      parser.add(new Option("fullpath", 'f', "print full path." +
> +  		"-f prints full path") {
> +	  public void parsed(String arg) throws OptionException {
> +	        fullpath = true;
> +	  }
> +      });
> +
>  
>      parser.add(new Option("all", 'a', "print all information that can currently be retrieved" +
>                            "about the stack\n" +
> diff --git a/frysk-core/frysk/debuginfo/ChangeLog b/frysk-core/frysk/debuginfo/ChangeLog
> index c4b34b3..47e4b91 100644
> --- a/frysk-core/frysk/debuginfo/ChangeLog
> +++ b/frysk-core/frysk/debuginfo/ChangeLog
> @@ -1,5 +1,10 @@
>  2007-11-23  Sami Wagiaalla  <swagiaal@redhat.com>
>  
> +	* DebugInfoFrame.java: Added ".../" befor abbrivated file path.
> +	* DebugInfoStackFactory.java: Removed misc print statement.
> +
> +2007-11-23  Sami Wagiaalla  <swagiaal@redhat.com>
> +
>  	* TestTypeEntry.java (testClassWithStaticMembers): enabled
>  	test.
>  
> diff --git a/frysk-core/frysk/debuginfo/DebugInfoFrame.java b/frysk-core/frysk/debuginfo/DebugInfoFrame.java
> index 5a60f7e..3c17d38 100644
> --- a/frysk-core/frysk/debuginfo/DebugInfoFrame.java
> +++ b/frysk-core/frysk/debuginfo/DebugInfoFrame.java
> @@ -231,7 +231,7 @@ public class DebugInfoFrame extends FrameDecorator {
>  		writer.print(line.getLine());
>  	    } else {
>  		Line line = this.getLines()[0];
> -		writer.print(line.getFile().getName());
> +		writer.print(".../"+line.getFile().getName());
>  		writer.print("#");
>  		writer.print(line.getLine());
>  	    }
> diff --git a/frysk-core/frysk/debuginfo/DebugInfoStackFactory.java b/frysk-core/frysk/debuginfo/DebugInfoStackFactory.java
> index 83a0cb3..dda6ea5 100644
> --- a/frysk-core/frysk/debuginfo/DebugInfoStackFactory.java
> +++ b/frysk-core/frysk/debuginfo/DebugInfoStackFactory.java
> @@ -124,9 +124,7 @@ public class DebugInfoStackFactory {
>  				       boolean printScopes,
>  				       boolean fullpath) {
>          
> -	System.out.println("DebugInfoStackFactory.printStackTrace() numberOfFrames " + numberOfFrames);
> -	
> -        int count = 0;
> +	int count = 0;
>          for (DebugInfoFrame frame = topFrame; frame != null;
>  	     frame = frame.getOuterDebugInfoFrame()) {
>              
> diff --git a/frysk-core/frysk/proc/dead/ChangeLog b/frysk-core/frysk/proc/dead/ChangeLog
> index 63adddf..377d92e 100644
> --- a/frysk-core/frysk/proc/dead/ChangeLog
> +++ b/frysk-core/frysk/proc/dead/ChangeLog
> @@ -1,3 +1,7 @@
> +2007-11-23  Sami Wagiaalla  <swagiaal@redhat.com>
> +
> +	* TestLinuxCore.java: Updated.
> +
>  2007-11-23  Mark Wielaard  <mwielaard@redhat.com>
>  
>  	* LinuxExeTask.java (bankBuffers): New final field.
> diff --git a/frysk-core/frysk/proc/dead/TestLinuxCore.java b/frysk-core/frysk/proc/dead/TestLinuxCore.java
> index 8d41403..3845f70 100644
> --- a/frysk-core/frysk/proc/dead/TestLinuxCore.java
> +++ b/frysk-core/frysk/proc/dead/TestLinuxCore.java
> @@ -159,7 +159,7 @@ public class TestLinuxCore
>      liveStacktrace = new StacktraceAction(new PrintWriter(liveStackOutput),
>  					  testProc, 
>  					  new RequestStopEvent(Manager.eventLoop),0, 
> -					  true, false, false, false, false, false)
> +					  true, false, false, false, false)
>  
>        {
>  	
> @@ -191,7 +191,7 @@ public class TestLinuxCore
>  					  coreProc, 
>  					  new PrintEvent(),0,
>  					  true, false, false, false , 
> -					  false, false)
> +					  false)
>      {
>  
>        public void addFailed (Object observable, Throwable w)
> diff --git a/frysk-core/frysk/stack/ChangeLog b/frysk-core/frysk/stack/ChangeLog
> index 72d529b..514e3fa 100644
> --- a/frysk-core/frysk/stack/ChangeLog
> +++ b/frysk-core/frysk/stack/ChangeLog
> @@ -1,3 +1,9 @@
> +2007-11-23  Sami Wagiaalla  <swagiaal@redhat.com>
> +
> +	* Frame.java (toPrint): Removed printlibrary boolean argument.
> +	added fullpath boolean argument.
> +	* StackFactory.java: Updated
> +
>  2007-11-23  Mark Wielaard  <mwielaard@redhat.com>
>  
>  	* LibunwindAddressSpace.java (getModuleFromAddress): Removed.
> diff --git a/frysk-core/frysk/stack/Frame.java b/frysk-core/frysk/stack/Frame.java
> index 1eee2eb..9a84283 100644
> --- a/frysk-core/frysk/stack/Frame.java
> +++ b/frysk-core/frysk/stack/Frame.java
> @@ -39,6 +39,7 @@
>  
>  package frysk.stack;
>  
> +import java.io.File;
>  import java.io.PrintWriter;
>  
>  import frysk.isa.Register;
> @@ -150,7 +151,7 @@ public abstract class Frame {
>       * Write a simple string representation of this stack frame.
>       * @param printWriter
>       */
> -    public void toPrint (PrintWriter writer, boolean printSourceLibrary) {
> +    public void toPrint (PrintWriter writer, boolean fullpath) {
>  	// the address, padded with 0s based on the task's word size, ...
>  	writer.write("0x");
>  	String addr = Long.toHexString(getAddress());
> @@ -165,11 +166,13 @@ public abstract class Frame {
>  	if (symbol != SymbolFactory.UNKNOWN)
>  	    writer.write(" ()");
>  	// the library if known ...
> -	if (printSourceLibrary) {
> -	    String library = getLibraryName();
> -	    if (library != null) {
> -		writer.print(" from ");
> -		writer.print(library);
> +	File library = new File(getLibraryName());
> +	if (library != null) {
> +	    writer.print(" from ");
> +	    if (fullpath) {
> +		writer.print(library.getAbsolutePath());
> +	    }else{
> +		writer.print(".../"+library.getName());
>  	    }
>  	}
>      }
> diff --git a/frysk-core/frysk/stack/StackFactory.java b/frysk-core/frysk/stack/StackFactory.java
> index 0bdaced..4a68a58 100644
> --- a/frysk-core/frysk/stack/StackFactory.java
> +++ b/frysk-core/frysk/stack/StackFactory.java
> @@ -87,7 +87,7 @@ public class StackFactory
>  
>      public static final void printTaskStackTrace(PrintWriter writer,
>  						 Task task,
> -						 boolean printSourceLibrary, int numberOfFrames) {
> +						 boolean fullpath, int numberOfFrames) {
>  	if (task != null) {
>  	    writer.print("Task #");
>  	    writer.print(task.getTid());
> @@ -102,7 +102,7 @@ public class StackFactory
>  		
>  		frame.printLevel(writer);
>  		writer.print(" ");
> -		frame.toPrint(writer, printSourceLibrary);
> +		frame.toPrint(writer, fullpath);
>  		writer.println();
>  	    }
>  	}
> diff --git a/frysk-core/frysk/util/ChangeLog b/frysk-core/frysk/util/ChangeLog
> index f3b20f5..b7b6829 100644
> --- a/frysk-core/frysk/util/ChangeLog
> +++ b/frysk-core/frysk/util/ChangeLog
> @@ -1,3 +1,11 @@
> +2007-11-23  Sami Wagiaalla  <swagiaal@redhat.com>
> +
> +	Removed printlibrary boolean argument from Frame.toPrint()
> +	added fullpath boolean argument.
> +	* StacktraceAction.java: Updated.
> +	* StressTestFStack.java: Updated.
> +	* TestFStack.java: Updated.
> +
>  2007-11-23  Mark Wielaard  <mwielaard@redhat.com>
>  
>  	* CountDownLatch.java (await): Mark as synchronized.
> diff --git a/frysk-core/frysk/util/StacktraceAction.java b/frysk-core/frysk/util/StacktraceAction.java
> index 2418dc7..855eea3 100644
> --- a/frysk-core/frysk/util/StacktraceAction.java
> +++ b/frysk-core/frysk/util/StacktraceAction.java
> @@ -83,7 +83,6 @@ public abstract class StacktraceAction
>    boolean printParameters;
>    boolean printScopes;
>    boolean fullpath;
> -  boolean printSourceLibrary;
>    private boolean virtualFrames;
>    
>    protected static Logger logger = Logger.getLogger("frysk"); 
> @@ -106,7 +105,7 @@ public abstract class StacktraceAction
>     *            file path is printed other wise only the name of the file is printed.
>     * @throws ProcException
>     */
> -  public StacktraceAction (PrintWriter printWriter, Proc theProc, Event theEvent, int numberOfFrames, boolean elfOnly, boolean virtualFrames, boolean printParameters, boolean printScopes, boolean fullpath, boolean printSourceLibrary)
> +  public StacktraceAction (PrintWriter printWriter, Proc theProc, Event theEvent, int numberOfFrames, boolean elfOnly, boolean virtualFrames, boolean printParameters, boolean printScopes, boolean fullpath)
>    {
>       event = theEvent;
>       
> @@ -116,7 +115,6 @@ public abstract class StacktraceAction
>       this.printParameters = printParameters;
>       this.printScopes = printScopes;
>       this.fullpath = fullpath;
> -     this.printSourceLibrary = printSourceLibrary;
>       
>       this.printWriter = printWriter;
>       Manager.eventLoop.add(new InterruptEvent(theProc));
> @@ -153,7 +151,7 @@ public abstract class StacktraceAction
>  	Task task =  (Task) iter.next();
>  	
>  	if(elfOnly){
> -	    StackFactory.printTaskStackTrace(printWriter,task,printSourceLibrary, numberOfFrames);
> +	    StackFactory.printTaskStackTrace(printWriter,task,fullpath, numberOfFrames);
>  	}else{
>  	    if(virtualFrames){
>  		DebugInfoStackFactory.printVirtualTaskStackTrace(printWriter,task,numberOfFrames, printParameters,printScopes,fullpath);
> diff --git a/frysk-core/frysk/util/StressTestFStack.java b/frysk-core/frysk/util/StressTestFStack.java
> index deb2b88..c38cd9f 100644
> --- a/frysk-core/frysk/util/StressTestFStack.java
> +++ b/frysk-core/frysk/util/StressTestFStack.java
> @@ -88,7 +88,7 @@ public class StressTestFStack
>        {
>          proc.requestAbandonAndRunEvent(new RequestStopEvent(Manager.eventLoop));
>        }
> -    },0, true,false, false, false, false,true)
> +    },0, true,false, false, false, true)
>      {
>  
>        public void addFailed (Object observable, Throwable w)
> diff --git a/frysk-core/frysk/util/TestFStack.java b/frysk-core/frysk/util/TestFStack.java
> index 42b5df8..dbbdcdf 100644
> --- a/frysk-core/frysk/util/TestFStack.java
> +++ b/frysk-core/frysk/util/TestFStack.java
> @@ -104,7 +104,7 @@ public class TestFStack
>  
>      StacktraceAction stacker;
>  
> -    stacker = new StacktraceAction(new PrintWriter(stringWriter),proc, new RequestStopEvent(Manager.eventLoop),20, true, false,false, false, false,true)
> +    stacker = new StacktraceAction(new PrintWriter(stringWriter),proc, new RequestStopEvent(Manager.eventLoop),20, true, false,false, false, true)
>      {
>  
>        public void addFailed (Object observable, Throwable w)
> @@ -145,7 +145,7 @@ public class TestFStack
>          Proc proc = (Proc) iter.next();
>          StacktraceAction stacker;
>  
> -        stacker = new StacktraceAction(new PrintWriter(stringWriter),proc, new RequestStopEvent(Manager.eventLoop),20, true, false,false, false, false,true)
> +        stacker = new StacktraceAction(new PrintWriter(stringWriter),proc, new RequestStopEvent(Manager.eventLoop),20, true, false,false, false,true)
>          {
>  
>            public void addFailed (Object observable, Throwable w)
>
>
> hooks/post-receive
> --
> frysk system monitor/debugger
>   

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

only message in thread, other threads:[~2007-11-26  8:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20071123205633.21966.qmail@sourceware.org>
2007-11-26  8:48 ` [SCM] <..>: swagiaal: fstack now prints shortened path names by default Phil Muldoon

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