Skip to content

Commit 5291652

Browse files
author
Jaroslav Tulach
committed
[GR-21031] Making T-Trace sources debuggable.
PullRequest: graal/5509
2 parents b7c9669 + e91fad9 commit 5291652

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

tools/src/com.oracle.truffle.tools.agentscript/src/com/oracle/truffle/tools/agentscript/impl/AgentScriptInstrument.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ protected void onCreate(Env tmp) {
102102
if (lang == null) {
103103
throw AgentException.notRecognized(file);
104104
}
105-
return Source.newBuilder(lang, file).uri(file.toUri()).internal(true).name(file.getName()).build();
105+
return Source.newBuilder(lang, file).uri(file.toUri()).name(file.getName()).build();
106106
} catch (IOException ex) {
107107
throw AgentException.raise(ex);
108108
}

vm/tests/all/agentscript/agent-exception.test

+6
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@
22
Hello T-Trace.
33
How
44
great you are!
5+
.*at <js> checkLogging.agent-exception.js:.*
56
.*at <js> log.log.js:1-6:18-.*
67
.*at <js> howAreYou.log.js:11:.*.
78

89
>[7] js --experimental-options --agentscript=agent-exception.js -f log.js -e "howAreYou()"
910
Hello T-Trace.
1011
How
1112
great you are!
13+
.*at <js> checkLogging.agent-exception.js:.*
1214
.*at <js> log.log.js:1-6:18-.*
1315
.*at <js> howAreYou.log.js:11:.*
1416

@@ -17,13 +19,15 @@ Hello T-Trace!
1719
How
1820
do
1921
you feel?
22+
.*at <js> checkLogging.agent-exception.js:.*
2023
.*at <js> log.log.js:1-6:18-.*
2124
.*at <js> howDoYouDo.log.js:18:.*
2225
.*at <js> :program.<eval_script>:1:0-11.
2326
>[7] js --experimental-options --agentscript=agent-exception.js -f log.js -e "areYouBad()"
2427
Hello T-Trace!
2528
How
2629
good you are?
30+
.*at <js> checkLogging.agent-exception.js:.*
2731
.*at <js> log.log.js:1-6:.*
2832
.*at <js> areYouBad.log.js:26:.*
2933
.*at <js> :program.<eval_script>:1:0-10.
@@ -33,7 +37,9 @@ agentscript: Unknown attribute misnamedAttribute
3337
agentscript: Unknown event type 'enterOrLeave'.*
3438
>[7] js --jvm --experimental-options --agentscript=agent-error.js log.js
3539
Error while initializing {id: "agentscript", version: "0.4"}
40+
.*at <js> :anonymous.*agent-error.js.*
3641
.*at <js> .*Unknown.*
3742
>[7] js --experimental-options --agentscript=agent-error.js log.js
3843
Error while initializing {id: "agentscript", version: "0.4"}
44+
.*at <js> :anonymous.*agent-error.js.*
3945
.*at <js> .*Unknown.*

vm/tests/all/agentscript/agent-ping.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ var counter = 0;
22

33
function ping() {
44
console.log(`Ping ${++counter}`);
5-
setTimeout(ping, 1000);
5+
setTimeout(ping, 5000);
66
}
7-
setTimeout(ping, 1000);
7+
setTimeout(ping, 5000);
88

99
// define T-Trace script via curl anytime later:
1010
function connect() {
@@ -17,4 +17,4 @@ function connect() {
1717
const { exec } = require('child_process');
1818
exec(cmd);
1919
}
20-
setTimeout(connect, 2500);
20+
setTimeout(connect, 12500);

0 commit comments

Comments
 (0)