I was looking over what you suggested. The bytecodes would be lower level
then I would like to go. Though I was able to find this in the
`--print-bytecode` call.
The output below is close to what I'm looking for I think. The flow is
still a little hard to understand but its getting there.
Constant pool (size = 8)
0x2c4c31ba25c1: [FixedArray] in OldSpace
- map: 0x230c9fb02881 <Map>
- length: 8
0: 0x2c4c31ba2561 <FixedArray[8]>
1: 0x2c4c31ba24b1 <String[3]: 1 +>
2: 0x008740f13559 <String[4]: test>
3: 0x230c9fb3d831 <String[4]: eval>
4: 0x2c4c31ba24c9 <String[2]: 2>
5: 0x230c9fb3d2e1 <String[6]: String>
6: 0x008740f10c21 <String[12]: fromCharCode>
7: 0x008740f06969 <String[1]: y>
On Thursday, October 4, 2018 at 12:52:51 AM UTC-7, Ross McIlroy wrote:
>
> Hi,
>
> A couple of possible alternatives:
> - if you are only interested at function level tracing, then --trace does
> this
> - It might be a bit low-level, but you can trace every bytecode that gets
> executed using --trace-ignition (you also need to enable a GN build arg
> v8_enable_trace_ignition for this to work)
> - You could use the debugger and flood the code with breakpoints at every
> JS statement.
>
> Hope this help.
>
> Cheers
> Rissy
>
>
> On Thu, 4 Oct 2018, 00:01 SudoKid, <[email protected] <javascript:>>
> wrote:
>
>> I'm looking to trace the JS as it executes and I think I'm looking in the
>> wrong places.
>>
>> I have read over the embedding documentation and spent a sometime both
>> playing around and reading over the source code to better understand the
>> project. I'm starting to understand parts of the code at this point though
>> still not most of it yet.
>>
>> What I'm trying to do is turn code like this.
>>
>> ```
>> var x = "1 + ";
>>
>> var y eval(x + " 2");
>>
>> var z = String.fromCharCode(189, 43, 190, 61);
>> ```
>>
>> into something like this.
>>
>> ```
>> var x = "1 + ";
>>
>> eval("1 + 2");
>> var y = 3;
>>
>> String.fromCharCode(189, 43, 190, 61);
>> z = "½+¾=";
>> ```
>>
>> With what I currently know of V8 this would require adding some kind of
>> print statement to every function that can be called which would in turn be
>> rather long and drawn out. I'm also wondering if there is some kind of
>> tracing system that is already part of V8 for this.
>>
>> Any suggestions or guidance would be greatly appreciated.
>>
>> --
>> --
>> v8-dev mailing list
>> [email protected] <javascript:>
>> http://groups.google.com/group/v8-dev
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "v8-dev" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected] <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups
"v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.