mirror of https://github.com/contiki-ng/mspsim
added path argument to SourceViewer
git-svn-id: https://mspsim.svn.sourceforge.net/svnroot/mspsim/mspsim@47 23d1a52b-0c3c-0410-b72d-8f29ab48fe35
This commit is contained in:
parent
1fa14fd48e
commit
d3e902a067
|
|
@ -63,7 +63,7 @@ public class HighlightSourceViewer implements SourceViewer {
|
|||
private SyntaxHighlighter highlighter;
|
||||
private ArrayList<File> path = null;
|
||||
private JFileChooser fileChooser;
|
||||
|
||||
|
||||
public HighlightSourceViewer() {
|
||||
//
|
||||
}
|
||||
|
|
@ -94,7 +94,7 @@ public class HighlightSourceViewer implements SourceViewer {
|
|||
window.setVisible(isVisible);
|
||||
}
|
||||
|
||||
public void viewFile(final String filename) {
|
||||
public void viewFile(final String path, final String filename) {
|
||||
setup();
|
||||
SwingUtilities.invokeLater(new Runnable() {
|
||||
public void run() {
|
||||
|
|
@ -182,6 +182,6 @@ public class HighlightSourceViewer implements SourceViewer {
|
|||
public static void main(String[] args) {
|
||||
HighlightSourceViewer sv = new HighlightSourceViewer();
|
||||
sv.setVisible(true);
|
||||
sv.viewFile(args[0]);
|
||||
sv.viewFile(".", args[0]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -182,7 +182,7 @@ public class ControlUI extends JPanel implements ActionListener {
|
|||
DebugInfo dbg = elfData.getDebugInfo(pc);
|
||||
if (dbg != null) {
|
||||
if (sourceViewer != null) {
|
||||
sourceViewer.viewFile(dbg.getFile());
|
||||
sourceViewer.viewFile(dbg.getPath(), dbg.getFile());
|
||||
sourceViewer.viewLine(dbg.getLine());
|
||||
} else {
|
||||
System.out.println("File: " + dbg.getFile());
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ package se.sics.mspsim.util;
|
|||
|
||||
public interface SourceViewer {
|
||||
|
||||
public void viewFile(String file);
|
||||
public void viewFile(String path, String file);
|
||||
public void viewLine(int line);
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue