Bug 3622 - Strangeness with line highlighting
Summary: Strangeness with line highlighting
Status: RESOLVED FIXED
Alias: None
Product: frysk
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Mike Cvet
URL:
Keywords:
Depends on:
Blocks: 1633
  Show dependency treegraph
 
Reported: 2006-11-30 17:56 UTC by Mike Cvet
Modified: 2006-12-04 23:54 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
file #1 (1.31 KB, application/octet-stream)
2006-11-30 17:58 UTC, Mike Cvet
Details
file #2 (1020 bytes, application/octet-stream)
2006-11-30 17:58 UTC, Mike Cvet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Cvet 2006-11-30 17:56:39 UTC
Using the attached code, incorrect outer lines are highlighted in the source 
window, and the following is printed to console:

java.lang.ArrayIndexOutOfBoundsException: 0
   at frysk.gui.srcwin.SourceWindow.updateShownStackFrame(FryskGui)
   at 
frysk.gui.srcwin.SourceWindow$SourceWindowListener.currentStackChanged(FryskGui)
   at frysk.gui.srcwin.CurrentStackView.notifyObservers(FryskGui)
   at frysk.gui.srcwin.CurrentStackView.selectionChangedEvent(FryskGui)
   at org.gnu.gtk.TreeSelection.fireSelectionEvent(libgtkjava-2.8.so)
   at org.gnu.gtk.TreeSelection.handleChanged(libgtkjava-2.8.so)
   at org.gnu.gtk.Gtk.gtk_main(libgtkjava-2.8.so)
   at org.gnu.gtk.Gtk.main(libgtkjava-2.8.so)
   at frysk.gui.Gui.gui(FryskGui)
   at frysk.gui.FryskGui.main(FryskGui)
Comment 1 Mike Cvet 2006-11-30 17:58:29 UTC
Created attachment 1442 [details]
file #1
Comment 2 Mike Cvet 2006-11-30 17:58:43 UTC
Created attachment 1443 [details]
file #2
Comment 3 Mike Cvet 2006-12-04 18:26:18 UTC
Highlighting of lines in any file is being applied to the text from any other 
file in the window. Exception was caused by bad parsing, fixed by new DOM 
attributes in DOMFunction added by Rick.
Comment 4 Mike Cvet 2006-12-04 23:54:47 UTC
frysk-core/frysk/dom:
2006-12-04  Mike Cvet  <mcvet@redhat.com>

	* DOMFunction.java (createDOMFunction): Strip spaces out of
	incoming function_call String.
	* DOMTagTypes.java (DOMTagTypes): Added FUNCTION_CALL. 
	* cparser/CDTParser.java (enterFunctionBody): Dump function
	header information into FUNCTION_CALL.
	(enterMethodBody): Ditto.

frysk-gui/frysk/gui/srcwin:
2006-12-04  Mike Cvet  <mcvet@redhat.com>

	* SourceBuffer.java (setCurrentLine): Don't bother highlighting
	anything if the function from this frame is in the wrong file.
	(highlightLine): Check for filenames, only highlight in the 
	correct file.
	(createTags): Look for FUNCTION_CALL TagType for function declaration.
	* SourceView.java (scrollToFunction): Remove String parsing and handling
	code, already done by the parser.
	* SourceWindow.java (populateStackBrowser): Removed redundant view reset.
	(updateShownStackView): More intelligently handle null DOMSources and 
	DOMSources belonging to different files. Load DOMSource if the new frame
	is from different files. Set new currentFrame here.
	(currentStackChanged): Set new currentFrame later.