public inbox for frysk-cvs@sourceware.org
help / color / mirror / Atom feed
* [SCM]  master: Fix for NullPointerException at frysk.gui.srcwin.SourceWindow patch by cagney
@ 2008-01-25 22:05 swagiaal
  0 siblings, 0 replies; only message in thread
From: swagiaal @ 2008-01-25 22:05 UTC (permalink / raw)
  To: frysk-cvs

The branch, master has been updated
       via  ee5cba36cbb15ff37b30293e1bd51d9ab7e1000d (commit)
      from  18dc1f26e74c45f1a2a00d617beb2eecf6689353 (commit)

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

- Log -----------------------------------------------------------------
commit ee5cba36cbb15ff37b30293e1bd51d9ab7e1000d
Author: Sami Wagiaalla <swagiaal@redhat.com>
Date:   Thu Jan 24 14:35:37 2008 -0500

    Fix for NullPointerException at frysk.gui.srcwin.SourceWindow patch by cagney
    
    frysk-core/frysk/debuginfo/ChangeLog
    +2008-01-24  swagiaal  <swagiaal@redhat.com>
    +
    +       * DebugInfoFrame.java: Fix for NullPointerException
    +        at frysk.gui.srcwin.SourceWindow.updateSourceLabel
    +        patch provided by Andrew Cagney  <cagney@redhat.com>.
    +
    
    frysk-core/frysk/rt/ChangeLog
    +2008-01-24  swagiaal  <swagiaal@toner.yyz.redhat.com>
    +
    +       * LineXXX.java: Fix for NullPointerException
    +        at frysk.gui.srcwin.SourceWindow.updateSourceLabel
    +        patch provided by Andrew Cagney  <cagney@redhat.com>.
    +
    
    frysk-gui/frysk/gui/srcwin/ChangeLog
    +2008-01-24  swagiaal  <swagiaal@toner.yyz.redhat.com>
    +
    +       * SourceWindow.java: Fix for NullPointerException
    +        at frysk.gui.srcwin.SourceWindow.updateSourceLabel
    +        patch provided by Andrew Cagney  <cagney@redhat.com>.
    +

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

Summary of changes:
 frysk-core/frysk/debuginfo/ChangeLog           |    6 ++++
 frysk-core/frysk/debuginfo/DebugInfoFrame.java |    9 +++--
 frysk-core/frysk/rt/ChangeLog                  |    6 ++++
 frysk-core/frysk/rt/LineXXX.java               |   37 ++++++++++++++++++------
 frysk-gui/frysk/gui/srcwin/ChangeLog           |    6 ++++
 frysk-gui/frysk/gui/srcwin/SourceWindow.java   |   10 +++---
 6 files changed, 56 insertions(+), 18 deletions(-)

First 500 lines of diff:
diff --git a/frysk-core/frysk/debuginfo/ChangeLog b/frysk-core/frysk/debuginfo/ChangeLog
index 44c27b3..0bf997c 100644
--- a/frysk-core/frysk/debuginfo/ChangeLog
+++ b/frysk-core/frysk/debuginfo/ChangeLog
@@ -1,3 +1,9 @@
+2008-01-24  swagiaal  <swagiaal@redhat.com>
+
+	* DebugInfoFrame.java: Fix for NullPointerException
+	 at frysk.gui.srcwin.SourceWindow.updateSourceLabel
+	 patch provided by Andrew Cagney  <cagney@redhat.com>.
+
 2008-01-24  Stan Cox  <scox@redhat.com>
 
 	* DebugInfoFrame.java (getLine): Get sysroot via DwflCache.getSysroot.
diff --git a/frysk-core/frysk/debuginfo/DebugInfoFrame.java b/frysk-core/frysk/debuginfo/DebugInfoFrame.java
index 1cd2430..7806be5 100644
--- a/frysk-core/frysk/debuginfo/DebugInfoFrame.java
+++ b/frysk-core/frysk/debuginfo/DebugInfoFrame.java
@@ -1,6 +1,6 @@
 // This file is part of the program FRYSK.
 //
-// Copyright 2007, Red Hat Inc.
+// Copyright 2007, 2008, Red Hat Inc.
 //
 // FRYSK is free software; you can redistribute it and/or modify it
 // under the terms of the GNU General Public License as published by
@@ -203,12 +203,13 @@ public class DebugInfoFrame extends FrameDecorator {
      * @return
      */
     public LineXXX getLineXXX(){
-	if(this.lineXXX == null){
+	if (this.getLine() == SourceLocation.UNKNOWN)
+	    return null;
+	if (this.lineXXX == null)
 	    this.lineXXX = new LineXXX(this.getLine(), this.getTask().getProc());
-	}
 	return lineXXX;
     }
-    LineXXX lineXXX;
+    private LineXXX lineXXX;
     
     public void toPrint(PrintWriter writer, boolean printParameters,
 		 boolean fullpath){
diff --git a/frysk-core/frysk/rt/ChangeLog b/frysk-core/frysk/rt/ChangeLog
index 5562512..270730d 100644
--- a/frysk-core/frysk/rt/ChangeLog
+++ b/frysk-core/frysk/rt/ChangeLog
@@ -1,3 +1,9 @@
+2008-01-24  swagiaal  <swagiaal@toner.yyz.redhat.com>
+
+	* LineXXX.java: Fix for NullPointerException
+	 at frysk.gui.srcwin.SourceWindow.updateSourceLabel
+	 patch provided by Andrew Cagney  <cagney@redhat.com>.
+
 2008-01-24  Andrew Cagney  <cagney@redhat.com>
 
 	* ProcTaskIDManager.java: Update to match
diff --git a/frysk-core/frysk/rt/LineXXX.java b/frysk-core/frysk/rt/LineXXX.java
index 0e23c39..e7f7c06 100644
--- a/frysk-core/frysk/rt/LineXXX.java
+++ b/frysk-core/frysk/rt/LineXXX.java
@@ -1,6 +1,6 @@
 // This file is part of the program FRYSK.
 //
-// Copyright 2007, Red Hat Inc.
+// Copyright 2007, 2008, Red Hat Inc.
 //
 // FRYSK is free software; you can redistribute it and/or modify it
 // under the terms of the GNU General Public License as published by
@@ -40,7 +40,7 @@
 package frysk.rt;
 
 import java.io.IOException;
-
+import java.io.File;
 import frysk.dom.DOMFactory;
 import frysk.dom.DOMFrysk;
 import frysk.dom.DOMFunction;
@@ -49,17 +49,36 @@ import frysk.dom.DOMSource;
 import frysk.proc.Proc;
 import frysk.scopes.SourceLocation;
 
-public class LineXXX extends SourceLocation{
-
-  
+public class LineXXX {
+    private final SourceLocation sourceLocation;
     private final Proc proc;
-
     private DOMSource source;
-    
     private DOMFunction function;
+    private final File file;
+    private final int line;
+    private final int column;
+  
+    public File getFile () {
+	return file;
+    }
+    
+    public int getLine () {
+	return line;
+    }
+
+    public int getColumn () {
+	return column;
+    }
+
+    public SourceLocation getSourceLocation() {
+	return sourceLocation;
+    }
 
     public LineXXX(SourceLocation sourceLocation, Proc proc) {
-	super(sourceLocation.getFile(), sourceLocation.getLine(), sourceLocation.getColumn());
+	this.sourceLocation = sourceLocation;
+	this.file = sourceLocation.getFile();
+	this.line = sourceLocation.getLine();
+	this.column = sourceLocation.getColumn();
 	this.proc = proc;
     }
 
@@ -88,7 +107,7 @@ public class LineXXX extends SourceLocation{
 		// source has not been parsed, go put it in the DOM and
 		// parse it
 		try {
-		    this.source = image.addSource(this.proc, this,
+		    this.source = image.addSource(this.proc, this.sourceLocation,
 						  DOMFactory.getDOM(this.proc));
 		} catch (IOException ioe) {
 		    System.err.println(ioe.getMessage());
diff --git a/frysk-gui/frysk/gui/srcwin/ChangeLog b/frysk-gui/frysk/gui/srcwin/ChangeLog
index 8d7b3b9..fa6d19c 100644
--- a/frysk-gui/frysk/gui/srcwin/ChangeLog
+++ b/frysk-gui/frysk/gui/srcwin/ChangeLog
@@ -1,3 +1,9 @@
+2008-01-24  swagiaal  <swagiaal@toner.yyz.redhat.com>
+
+	* SourceWindow.java: Fix for NullPointerException
+	 at frysk.gui.srcwin.SourceWindow.updateSourceLabel
+	 patch provided by Andrew Cagney  <cagney@redhat.com>.
+
 2008-01-08  Tim Moore  <timoore@redhat.com>
 
 	* SourceWindowFactory.java (attachToPID): Change requestFindProc
diff --git a/frysk-gui/frysk/gui/srcwin/SourceWindow.java b/frysk-gui/frysk/gui/srcwin/SourceWindow.java
index 610130f..8c124dd 100644
--- a/frysk-gui/frysk/gui/srcwin/SourceWindow.java
+++ b/frysk-gui/frysk/gui/srcwin/SourceWindow.java
@@ -2254,7 +2254,7 @@ public class SourceWindow extends Window {
 	DOMSource source = null;
 	LineXXX line = sf.getLineXXX();
 
-	if (line != SourceLocation.UNKNOWN) {
+	if (sf.getLine() != SourceLocation.UNKNOWN) {
 	    if (line.getDOMFunction() == null)
 	        noDOMFunction = true;
 	    source = line.getDOMSource();
@@ -2267,9 +2267,9 @@ public class SourceWindow extends Window {
 		}
 	}
 
-	if (line == SourceLocation.UNKNOWN)
+	if (sf.getLine() == SourceLocation.UNKNOWN)
 	    setSourceLabel("Unknown File for: ", task_name, proc_id, task_id, noDOMFunction, source);
-	else if (source == null && line != SourceLocation.UNKNOWN)
+	else if (source == null && sf.getLine() != SourceLocation.UNKNOWN)
 	    setSourceLabel(sf.getLine().getFile().getPath() + " for: ",
 		    task_name, proc_id, task_id, noDOMFunction, source);
 	else
@@ -2306,7 +2306,7 @@ public class SourceWindow extends Window {
 
 	updateSourceLabel(selected);
 
-	if (line != SourceLocation.UNKNOWN) {
+	if (selected.getLine() != SourceLocation.UNKNOWN) {
 	    source = line.getDOMSource();
 	    if (source == null)
 		try {
@@ -2318,7 +2318,7 @@ public class SourceWindow extends Window {
 		}
 	}
 
-	if (line == SourceLocation.UNKNOWN) {
+	if (selected.getLine() == SourceLocation.UNKNOWN) {
 	    SourceBuffer b = null;
 
 	    if (mode == 2)


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


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

only message in thread, other threads:[~2008-01-25 22:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-25 22:05 [SCM] master: Fix for NullPointerException at frysk.gui.srcwin.SourceWindow patch by cagney swagiaal

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