From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9275 invoked by alias); 10 Jun 2008 19:03:41 -0000 Received: (qmail 9250 invoked by uid 367); 10 Jun 2008 19:03:40 -0000 Date: Tue, 10 Jun 2008 19:03:00 -0000 Message-ID: <20080610190340.9235.qmail@sourceware.org> From: cagney@sourceware.org To: frysk-cvs@sourceware.org Subject: [SCM] master: Include the shared library program/solib's name in debug-info back traces. X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 65837bf7e7a75451a6d5971e52ed06edef716ed3 X-Git-Newrev: a17e35990190cdddc6e0a0447cb02774b661a659 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: 2008-q2/txt/msg00364.txt.bz2 The branch, master has been updated via a17e35990190cdddc6e0a0447cb02774b661a659 (commit) from 65837bf7e7a75451a6d5971e52ed06edef716ed3 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit a17e35990190cdddc6e0a0447cb02774b661a659 Author: Andrew Cagney Date: Tue Jun 10 15:02:17 2008 -0400 Include the shared library program/solib's name in debug-info back traces. frysk-core/frysk/bindir/ChangeLog 2008-06-10 Andrew Cagney * TestFstack.java (testBackTrace, testBackTraceWithDebugNamesAndParams): Check for from . frysk-core/frysk/debuginfo/ChangeLog 2008-06-10 Andrew Cagney * DebugInfoFrame.java (toPrint): Print the library using Frame.printLibraryName. frysk-core/frysk/stack/ChangeLog 2008-06-10 Andrew Cagney * Frame.java (printLibraryName(PrintWriter,PrintStackOptions)): New. (toPrint(PrintWriter,PrintStackOptions)): Use. ----------------------------------------------------------------------- Summary of changes: frysk-core/frysk/bindir/ChangeLog | 3 +++ frysk-core/frysk/bindir/TestFstack.java | 4 ++-- frysk-core/frysk/debuginfo/ChangeLog | 3 +++ frysk-core/frysk/debuginfo/DebugInfoFrame.java | 12 +++++++----- frysk-core/frysk/stack/ChangeLog | 3 +++ frysk-core/frysk/stack/Frame.java | 13 ++++++++++--- 6 files changed, 28 insertions(+), 10 deletions(-) First 500 lines of diff: diff --git a/frysk-core/frysk/bindir/ChangeLog b/frysk-core/frysk/bindir/ChangeLog index 226c6d7..ce774a0 100644 --- a/frysk-core/frysk/bindir/ChangeLog +++ b/frysk-core/frysk/bindir/ChangeLog @@ -1,5 +1,8 @@ 2008-06-10 Andrew Cagney + * TestFstack.java (testBackTrace, + testBackTraceWithDebugNamesAndParams): Check for from . + * 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 837aa3e..fbcb730 100644 --- a/frysk-core/frysk/bindir/TestFstack.java +++ b/frysk-core/frysk/bindir/TestFstack.java @@ -83,14 +83,14 @@ public class TestFstack extends TestLib { public void testBackTrace () { TearDownExpect e = fstack("funit-stack-outlined", new String[0]); // Just look for main. - e.expect ("main"); + e.expect ("main.* from funit-stack-outlined"); } public void testBackTraceWithDebugNamesAndParams() { TearDownExpect e = fstack("funit-stack-outlined", new String[] { "-print", "debug-names,params" }); - e.expect("\\#0 .* in third\\(int arg3\\) at funit-stack-outlined\\.c#"); + e.expect("\\#0 .* in third\\(int arg3\\) at funit-stack-outlined\\.c#[0-9]+ from funit-stack-outlined"); e.expect("\\#1"); } diff --git a/frysk-core/frysk/debuginfo/ChangeLog b/frysk-core/frysk/debuginfo/ChangeLog index 649fe31..8c2186b 100644 --- a/frysk-core/frysk/debuginfo/ChangeLog +++ b/frysk-core/frysk/debuginfo/ChangeLog @@ -1,5 +1,8 @@ 2008-06-10 Andrew Cagney + * DebugInfoFrame.java (toPrint): Print the library using + Frame.printLibraryName. + * DebugInfoFrame.java (toPrint(PrintWriter,boolean,boolean)): Delete. (toPrint(PrintWriter,DebugInfoStackOptions)): New. * PrintParameterOptions.java: New. diff --git a/frysk-core/frysk/debuginfo/DebugInfoFrame.java b/frysk-core/frysk/debuginfo/DebugInfoFrame.java index ea0b1b7..3a0482e 100644 --- a/frysk-core/frysk/debuginfo/DebugInfoFrame.java +++ b/frysk-core/frysk/debuginfo/DebugInfoFrame.java @@ -198,17 +198,19 @@ public class DebugInfoFrame extends FrameDecorator { subprogram.printParameters(writer, this, options.printValues()); } writer.print(") at "); + SourceLocation line = this.getLine(); if (options.printFullPaths()) { - SourceLocation line = this.getLine(); writer.print(line.getFile().getPath()); - writer.print("#"); - writer.print(line.getLine()); } else { - SourceLocation line = this.getLine(); writer.print(line.getFile().getName()); + } + writer.print("#"); + writer.print(line.getLine()); + if (line.getColumn() > 0) { writer.print("#"); - writer.print(line.getLine()); + writer.print(line.getColumn()); } + printLibraryName(writer, options); } else { super.toPrint(writer, options); } diff --git a/frysk-core/frysk/stack/ChangeLog b/frysk-core/frysk/stack/ChangeLog index 28e41a3..367f17a 100644 --- a/frysk-core/frysk/stack/ChangeLog +++ b/frysk-core/frysk/stack/ChangeLog @@ -1,5 +1,8 @@ 2008-06-10 Andrew Cagney + * Frame.java (printLibraryName(PrintWriter,PrintStackOptions)): New. + (toPrint(PrintWriter,PrintStackOptions)): Use. + * Frame.java (toPrint(PrintWriter,PrintStackOptions)): Replace toPrint(PrintWriter,boolean,boolean). (toPrint(PrintWriter)): Delete. diff --git a/frysk-core/frysk/stack/Frame.java b/frysk-core/frysk/stack/Frame.java index 11d3cf7..2ad9ea5 100644 --- a/frysk-core/frysk/stack/Frame.java +++ b/frysk-core/frysk/stack/Frame.java @@ -157,10 +157,17 @@ public abstract class Frame { writer.write(symbol.getDemangledName()); if (symbol != SymbolFactory.UNKNOWN) writer.write(" ()"); - if (options.printLibraryNames()){ + printLibraryName(writer, options); + } + + /** + * If requrested by the stack options, print the library name + * using the form " from LIBRARY". + */ + protected void printLibraryName(PrintWriter writer, PrintStackOptions options) { + if (options.printLibraryNames()) { // the library if known ... String library = getLibraryName(); - System.err.println("library: " + library); if (library != null) { writer.print(" from "); if (library.startsWith("[")) { @@ -177,7 +184,7 @@ public abstract class Frame { } } - } + } } public String getLibraryName() { hooks/post-receive -- frysk system monitor/debugger