Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/agnosis pull request #840

Open
wants to merge 77 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
368f5ed
Add debugger stub function
krame505 Nov 10, 2023
e71f4d5
Add debug function
krame505 Nov 10, 2023
5692236
demo missing view
Dec 7, 2023
3b3e665
fixed going up on root
Dec 7, 2023
6843dcc
implemented view
Dec 14, 2023
7c107e1
downward navigation and viewing attributes is easier also added undo
Jan 24, 2024
0f518df
locals exist and added TODO comments
Feb 1, 2024
b37720f
node to context extraction logic added
Feb 1, 2024
6885e52
added local attributes to list and view, also toggleing full attribut…
Feb 15, 2024
087c039
Indent for user input, forwarding/bactraking is tested and attribute …
Feb 22, 2024
9647d88
Merge branch 'feature/agnosis' of https://github.com/melt-umn/silver …
Feb 22, 2024
076eade
Merge branch 'feature/agnosis' of https://github.com/melt-umn/silver …
Feb 22, 2024
ad9d0f4
first version of contextualization. Origin tracking needs to be done …
Feb 22, 2024
eec8861
apart from origin tracking, isMain() hack means contextualization wor…
Feb 27, 2024
65c3080
removed some comments
Feb 27, 2024
1531873
return logi fix
Feb 27, 2024
7755cf9
minor fixes + fixed indices decrement
Feb 27, 2024
a6e587a
hacky origin tracking now works for is-new
Feb 27, 2024
0a6102a
fixed a few bugs and found somemore, added toggle for cStack, started…
Feb 28, 2024
762c28a
help is more helpful, better comments, and choosing from a list funct…
Feb 28, 2024
6d5d8c6
printProductions changed to printName new comments and into has a sle…
Feb 29, 2024
a160e87
new comments to improve finding is-new
Feb 29, 2024
b9435c7
"comment changes"
Feb 29, 2024
e825829
fix isRoot hack. No longer hacky
Mar 12, 2024
24d6dc8
Merge branch 'feature/agnosis' of https://github.com/melt-umn/silver …
Mar 13, 2024
3075f44
down is not allowed on redex
Mar 13, 2024
48bd0bc
args ready, but file/html contextualization still not ready
Mar 14, 2024
8491361
added file context visualization
Mar 14, 2024
a9cd08d
started work on simplified context stack made from full stack (class …
Mar 18, 2024
c5abf38
removed redundant dependencies
Mar 18, 2024
2bc898b
fixed prod names. Must use entire prods array
Mar 18, 2024
eefd149
changed to dynamically be able to rebuild a simplified stack within t…
Mar 19, 2024
0188352
prototyped simplified context stack fully now
Mar 19, 2024
c552b65
added commented lines that need to be debugged
Mar 19, 2024
828443c
qMerge branch 'develop' into feature/agnosis
Mar 21, 2024
1a150f6
Get feature/agnosis building again
krame505 Mar 25, 2024
2003f3f
simplified stack works now
Apr 3, 2024
9d7c629
to String stuff done
Apr 4, 2024
c0cfde2
ready for file visualization
Apr 4, 2024
51631b5
added show to simple stack
Apr 4, 2024
8e1cda1
adding simple stack show
Apr 4, 2024
bf404c5
fixed to string on simple stack
Apr 7, 2024
fc15757
removed unncessary prints
Apr 9, 2024
2ca734b
html of productions and attributes
Apr 11, 2024
2d955cc
Merge branch 'feature/agnosis' of https://github.com/melt-umn/silver …
Apr 11, 2024
55a0b35
cleaned some comments, endline and jason added
Apr 11, 2024
37b081d
fixed json, stared alroithmic debugging
Apr 11, 2024
a9cbed0
fixed json again also alorithmic debugging is ded
Apr 11, 2024
2cf0a40
fixed json agin (this time for sure), algorithic debugging is less ded
Apr 11, 2024
9a8976c
update a client function to send message to vscode extention
tardism Apr 16, 2024
88519ad
Thunk map finally implemented, this solved many bugs, also you can ca…
Apr 16, 2024
c954cc0
should work Merge branch 'feature/agnosis' of https://github.com/melt…
Apr 16, 2024
64886c8
algorithimc debugger prototype
Apr 17, 2024
3e7ff13
now generate rudimentary HTML for contextualizations
Apr 17, 2024
3ecbab7
minor bug fix in algorithmicDebugg mostly just wanted to commit to pu…
Apr 18, 2024
2d84c0d
Merge branch 'feature/agnosis' of https://github.com/melt-umn/silver …
Apr 18, 2024
4aa209d
code styling started
Apr 19, 2024
791c372
commented my code
Apr 19, 2024
b9e598b
small formatting
Apr 22, 2024
70807c9
start of debugg cleanup
Apr 22, 2024
ee6ff39
Merge branch 'feature/agnosis' of https://github.com/melt-umn/silver …
Apr 22, 2024
fc24180
up and down now update the display also down is called by child names…
Apr 23, 2024
62538cd
more cleaning and commenting
Apr 23, 2024
646e360
comments and code style---all camel case now
Apr 23, 2024
1155d33
Merge branch 'feature/agnosis' of github.com:melt-umn/silver into fea…
Apr 23, 2024
16f46d4
Finsihed cleaning and commenting debugg, algrithmic debugg now shows …
Apr 25, 2024
b146654
Merge branch 'feature/agnosis' of https://github.com/melt-umn/silver …
Apr 25, 2024
f5bab76
update vscode extension support for agnosis debugger
tardism Apr 25, 2024
ae1f08e
clean some temperate files in agnosis vscode extension
tardism Apr 25, 2024
ad6983f
update command showSimpleDebugContext
tardism May 2, 2024
5650f01
moved everything added to decorated node into nodecontextmessage
May 2, 2024
fd7e985
Recognize the silver:langutil:pp/silver:langutil:unparse attrs
krame505 May 3, 2024
93df3a8
Bump up stack space in running test suites
krame505 May 4, 2024
d0cc1ce
comment changes
May 8, 2024
d27f563
Merge branch 'develop' into feature/agnosis
krame505 May 8, 2024
4ebcfb4
removed unused class
May 9, 2024
c7a2968
Merge branch 'feature/agnosis' of github.com:melt-umn/silver into fea…
May 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"silver.jvmArgs": "-Xmx10G -Xss40M",
"java.jdt.ls.vmargs": "-XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx2G -Xms100m -Xlog:disable",
"silver.compilerJar": "jars/silver.compiler.composed.Default.jar"
"silver.compilerJar": "jars/silver.compiler.composed.Default.jar",
"java.compile.nullAnalysis.mode": "automatic",
"liveServer.settings.port": 5501
}
12 changes: 12 additions & 0 deletions grammars/silver/core/Debug.sv
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
grammar silver:core;

@{-
- Launch an interactive debug session to explore a tree.
-}
function debug
Decorated a with i ::= tree::Decorated a with i
{
return error("foreign function");
} foreign {
"java" : return "common.Debug.runDebug(%tree%)";
}
2 changes: 1 addition & 1 deletion grammars/silver/testing/bin/TestSpecLang.sv
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ ts::Run ::= 'test' 'suite' jar::Jar_t
local testSuiteResults :: IOVal<Integer>
= systemT ("cd " ++ ts.testFileDir ++ ";" ++
"rm -f " ++ ts.testFileName ++ ".output ; " ++
" java -Xss6M -jar " ++ jar.lexeme ++
" java -Xss30M -jar " ++ jar.lexeme ++
" >& " ++ ts.testFileName ++ ".output" ,
msgBefore ) ;

Expand Down
4 changes: 2 additions & 2 deletions language-server/launcher/.settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
org.eclipse.jdt.core.compiler.annotation.nonnull=javax.annotation.Nonnull
org.eclipse.jdt.core.compiler.annotation.nonnull.secondary=
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=javax.annotation.ParametersAreNonnullByDefault
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary=
org.eclipse.jdt.core.compiler.annotation.nullable=javax.annotation.Nullable
org.eclipse.jdt.core.compiler.annotation.nullable.secondary=
Expand Down Expand Up @@ -110,7 +110,7 @@ org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=wa
org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=warning
org.eclipse.jdt.core.compiler.problem.nullReference=warning
org.eclipse.jdt.core.compiler.problem.nullSpecViolation=warning
org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=ignore
org.eclipse.jdt.core.compiler.problem.overridingMethodWithoutSuperInvocation=ignore
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
Expand Down
27 changes: 27 additions & 0 deletions runtime/java/src/common/CMDContextVisualization.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package common;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debugger-specific files should be moved to runtime/java/src/common/agnosis/


import java.util.Iterator;

public class CMDContextVisualization extends ContextVisualization {
private final String printFormat = "%s\n%s\n%s\n";
protected String border;

public CMDContextVisualization(String border) {
super();

this.border = border;
}

@Override
public void show() {
// for(NodeContextMessage nodeContextMessage : this.contextStack.iterator()) {
// System.out.printf(this.printFormat, this.border, nodeContextMessage.toString(), this.border);
// }

Iterator<NodeContextMessage> iterator = this.contextStack.iterator();
while (iterator.hasNext()) {
NodeContextMessage nodeContextMessage = iterator.next();
System.out.printf(this.printFormat, this.border, nodeContextMessage.toString(), this.border);
}
}
}
63 changes: 63 additions & 0 deletions runtime/java/src/common/ContextStack.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
package common;

// Key intermediate structure of debugging contextualization.
// We push/pop nodes while navigating in Debug.java into this stack.
// A ContextStack is then a member of a SimplifiedContextStack, which
// produces the actual contextualization.

// ContextStack is fundementally a stack of NodeContextMessage objects.
// Each of these objects represents a record of contextualization
// information we store about a single visited node (only maintain
// those on the path from root to the current node, like a DFS traversal).

// Wrapped around built-in Java Stack class
// No error handling in current version

import java.util.Iterator;
import java.util.Stack;

import javax.swing.plaf.basic.BasicInternalFrameTitlePane.SystemMenuBar;

public class ContextStack {

public void push(DecoratedNode n) {

this.height++;
NodeContextMessage ncm = new NodeContextMessage(n, this.nextIndex++);
this.stack.push(ncm);
}

public NodeContextMessage pop() {

this.height--;
this.nextIndex--;
return this.stack.pop();
}

public NodeContextMessage peak() {
return this.stack.peek();
}

public int getHeight() {
return this.height;
}

public Iterator<NodeContextMessage> iterator() {
return this.stack.iterator();
}

public NodeContextMessage get(int stackIndex) {

// Index 0 is the bottom of the stack
if (stackIndex >= 0 && stackIndex < this.stack.size()) {
return this.stack.get(stackIndex);
} else {
throw new IndexOutOfBoundsException("Index " + stackIndex + " is out of bounds.");
}
}

private Stack<NodeContextMessage> stack = new Stack<NodeContextMessage>();
private int height = 0;
// Used for indices
private int nextIndex = 1;
}
23 changes: 23 additions & 0 deletions runtime/java/src/common/ContextVisualization.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package common;

public abstract class ContextVisualization {
protected ContextStack contextStack;

public ContextVisualization() {
this.contextStack = new ContextStack();
}

public void push(DecoratedNode decoratedNode) {
this.contextStack.push(decoratedNode);
}

public NodeContextMessage pop() {
return this.contextStack.pop();
}

public abstract void show();

public ContextStack getContextStack() {
return this.contextStack;
}
}
Loading