Hi,

*--trace *was a great hint. Thanks! Unfortunately *--trace* does not log 
'native' methods as the example below shows (*concat *and *print *are not 
logged). Is there a way to modify the tracing algorithm to add the native 
methods? I could not find the C++ code responsible for teh tracing. 

Code:
function foo(var0){
  bar(var0.concat(" World!"));
}

function bar(var1){
  print(var1);
}

foo("Hello");

Output:
   1: ~+0(this=0x1407e1103521 <JSGlobal Object>) {
   2:  ~foo+0(this=0x1407e1103521 <JSGlobal Object>, 0x313b061a8b79 <String[
5]: Hello>) {
   3:   ~bar+0(this=0x1407e1103521 <JSGlobal Object>, 0x1407e110cd99 <String
[12]: Hello World!>) {
Hello World!
   3:   } -> 0x2169365022e1 <undefined>
   2:  } -> 0x2169365022e1 <undefined>
   1: } -> 0x2169365022e1 <undefined>

Cheers,
Tobias


Am Donnerstag, 26. Oktober 2017 16:24:21 UTC+2 schrieb Rodolph Perfetta:
>
> What you are looking for sounds similar to the --trace flag, have you 
> tried it?
>
> On Thu, 26 Oct 2017 at 07:36 Tobias <[email protected] <javascript:>> 
> wrote:
>
>> Hello,
>>
>>  
>>
>> I am fairly new to V8 and need some help or hints how to start on my 
>> problem.
>>
>>  
>>
>> I want to log all function calls of any given script (i.e. the Stack 
>> trace of the script – see the example below).
>>
>> Can you give me please a hint or advice where to start?
>>
>> I took a look at the “V8 Inspector 
>> <https://github.com/v8/v8/wiki/Debugging-over-the-V8-Inspector-API>” but 
>> I did not find a way to log the JavaScript function calls.
>>
>> The “StackTrace API <https://github.com/v8/v8/wiki/Stack-Trace-API>” 
>> seems to work but only for exceptions not all function calls.
>>
>>  
>>
>> Any help is appreciated!
>>
>>  
>>
>> Cheers,
>>
>> Tobias
>>
>>  
>>
>> *Example: *
>>
>> For the script
>> <script>
>>   var c = document.getElementById("myCanvas"); 
>>   var ctx = c.getContext("2d"); 
>>   ctx.font = "30px Arial"; 
>>   ctx.fillText("Hello World",10,50); 
>> </script>
>>
>>
>> I want something like:
>>
>> Script foo:
>>
>>   getElementById
>>
>>   getContext
>>
>>   fillText
>>
>> -- 
>> -- 
>> 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.

Reply via email to