Skip to content

Commit d083bd1

Browse files
committed
Fix solc imports. Increase viz memory for large graphs. Source mapping bugfix
1 parent 2a4e5b8 commit d083bd1

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ There are already tools that allow you to debug Ethereum transactions (Solidity)
4747

4848
For now there are many limitations since this is a very early release of the debugger
4949

50-
* The control flow graph is drawn from the static bytecode, so there can be nodes without edges, a symbolic execution would be needed. Maybe added in future releases
50+
* The control flow graph is drawn from the static bytecode, so there can be nodes without edges, a symbolic execution would be needed. Maybe will be added in future releases
5151
* Transactions executed in the runtime bytecode are supported (for example, the constructor execution of a contract cannot be debugged right now)
5252
* You must provide a node URL that supports `debug_traceTransaction`, like Geth or Ganache, therefore, Infura is not supported
5353
* It only supports Solidity for now, but planning to make it more modular to support different languages (if the compiler gives source mappings)

src/main/java/net/nandgr/debugger/node/NodeService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
public class NodeService {
2323

24-
private static final List<String> callingOps = new ArrayList<>(Arrays.asList(Opcodes.CALL.toString()));
24+
private static final List<String> callingOps = new ArrayList<>(Arrays.asList(Opcodes.CALL.toString(), Opcodes.DELEGATECALL.toString()));
2525
public static final String EMPTY_ADDRESS = "0x0000000000000000000000000000000000000000";
2626

2727
private final String nodeUrl;

src/main/java/net/nandgr/debugger/solc/Solc.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public SolcOutput compile() throws IOException, InterruptedException {
2828
}
2929

3030
private String compileSource() throws InterruptedException, IOException {
31-
ProcessBuilder builder = new ProcessBuilder("solc", "--pretty-json", "--combined-json","asm,bin-runtime", fileName);
31+
ProcessBuilder builder = new ProcessBuilder("solc", "--allow-paths", "../,./,.", "--pretty-json", "--combined-json","asm,bin-runtime", fileName);
3232

3333
builder.inheritIO().redirectOutput(ProcessBuilder.Redirect.PIPE);
3434
Process p = builder.start();

src/main/resources/template/graph_template.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@
155155
`;
156156

157157
window["graphviz-$contract.contractName"] = d3.select("#graph-$contract.contractName").graphviz();
158+
window["graphviz-$contract.contractName"].totalMemory(537395200);
158159
#end
159160

160161
function render(dotSrc, gViz, contractName) {
@@ -304,9 +305,10 @@
304305
var startFound = false;
305306
var endFound = false;
306307
if (begin >= end) {
307-
console.log("ERROR! : Start : " + begin + "is higher or equals than end: " + end);
308-
editor.session.selection.setSelectionRange(new Range(0, 0, 0, 0), false);
309-
return;
308+
console.log("Swapping begin and end");
309+
var temp = begin;
310+
begin = end;
311+
end = temp;
310312
}
311313
var lines = editor.session.doc.getAllLines();
312314
for(var i = 0; i < lines.length; i++) {

0 commit comments

Comments
 (0)