[v8-users] Re: V8 JSON Debugging Protocol, Breakpoints not being set

2016-10-20 Thread Yang Guo
I would urge you to use the DevTools protocol instead, used for example in 
test/inspector/inspector-test.cc

The old JSON debug API is deprecated and going to be removed soon.

Cheers,

Yang

On Monday, October 17, 2016 at 11:00:30 PM UTC+2, WIlliam Taylor wrote:
>
>
> 
>
> Hi Thanks for that,
>
> I already have something like that in my C++ application, basically I 
> print incoming json from VSCode and also outgoing json from V8.
>
> When I connect using a remote debugger I get the following message. This 
> is the only command to fail. I filter out commands where success == true.
>
>
> 
>
>
> Any ideas?
>
> Thanks
>
>
> On Sunday, 16 October 2016 23:32:51 UTC+1, WIlliam Taylor wrote:
>>
>>
>> Hi,
>>
>> Apologies if this is a trivial thing. I've been embedding V8 inside my 
>> own C++ application and have been working to get the JSON debugging 
>> protocol working.
>>
>> I have a background thread which listens to debugging JSON commands from 
>> Visual Studio Code and I forward them to V8 and I send them via 
>> v8::Debug::SendCommand. I also then send back JSON responses from V8 by 
>> listening for it then sending it to VSCode. Of course I also 
>> call v8::Debug::ProcessDebugMessages from time to time to make sure 
>> messages are being dealt with. 
>>
>> Everything works apart from setting breakpoints. VSCode says they are 
>> registered however when I call Debug.showAllBreakpoints(FunctionName) via 
>> JavaScript no breakpoint has been bound to the JavaScript function even 
>> though the JSON V8 sends back to VSCode says it has. There are also no 
>> exceptions and no error messages.
>>
>> I imagine I'm missing something big, anyone got an ideas?.
>>
>> Thanks in advance, hope I didn't drag on too much :)
>>
>> V8 version: 5.1.281.84
>> OS: Windows 10
>>
>> I was also using this tutorial for a starting point. Specifically the 
>> remote debugging section.
>>
>>
>> http://www.equals-forty-two.com/2015/03/04/v8-integration-in-a-game-engine/
>>
>>
>>
>>
>>
>>

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
"v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[v8-users] Re: Debugging Javascript in V8

2016-10-20 Thread Yang Guo
The old debugger protocol is no longer supported. We do support the 
devtools protocol though. You could take a look at how 
v8/test/inspector-test.cc works. In your project, you could open a socket 
to pass devtools protocol messages through to V8, and use Chrome DevTools 
to debug. If everything works out, we will publish some documentation on 
this in the coming weeks.

On Wednesday, October 19, 2016 at 11:20:19 PM UTC+2, Dan ny wrote:
>
> Hello,
>
>
> I am currently integrating V8 with my project, and would like to hook a
> conventional Javascript debugger (eg. Netbeans) to it.
>
> The documentation says that the message protocol is no longer supported and
> that I should email this group for info on how to accomplish my debugging.
>
> Searching this group for old posts related to debugging unearthed some 
> mention of a new debugging feature, but no specifics.
>
> Do you have any pointers to documentation that will enable me to figure out
> this challenge? Even if I have to write my own debugger UI  ;)
>
>
> All the best,
>
> Dan
>

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
"v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [v8-users] Breaking On Native Function Calls

2016-10-20 Thread PhistucK
Yes, I am. I already noticed it is blocking the Chromium issue.
Thank you!


☆*PhistucK*

On Thu, Oct 20, 2016 at 9:33 AM, Yang Guo  wrote:

> I guess you are looking for https://bugs.chromium.org/
> p/v8/issues/detail?id=178
>
> This is a long standing feature request that has not been addressed yet.
> I'll add it to our backlog.
>
> On Thursday, October 20, 2016 at 7:55:38 AM UTC+2, PhistucK wrote:
>>
>> File ​crbug.com/657697​ (and crbug.com/657700 for a related bug I found
>> as a result :(). But it is really a duplicate of crbug.com/49 (so I
>> closed mine). I guess it will not be in progress soon. :(
>>
>>
>> ☆*PhistucK*
>>
>> On Thu, Oct 20, 2016 at 8:19 AM, Jochen Eisinger 
>> wrote:
>>
>>> As far as I know that's not possible. Could you file a feature request
>>> for this (probably on crbug.com if you also want to cover DOM functions)
>>>
>>> On Wed, Oct 19, 2016 at 7:38 PM PhistucK  wrote:
>>>
 I wanted to know whether there is a V8 (or Chrome) flag of some sort
 that will let me add breakpoints on native function calls.
 I do not mean C++ functions, I mean built in web platform (or
 ECMAScript) functions.
 My issue is that I click on a link and suddenly some code is apparently
 calling document.location.replace("foo") or something and the page
 redirects (maliciously). In order to find the calling code, I want to set a
 breakpoint on calling document.location.replace, which is a native web
 platform function, that is not writable (so I cannot override it with my
 own function using Object.defineProperty, or use a proxy).
 (The code is apparently elusive and obfuscated somewhat, so it is not
 just a search and replace)
 I tried using the Developer Tools API - debug(function), but it did not
 break (even when I call it with setTimeout).

 A V8 flag (or a Chrome flag) that either lets me break on calling that
 function, or that overrides the security feature that makes it
 non-writable, or something like that, would let me see the code that calls
 it and find the malicious way it does so.

 So, is there something like that?

 Thank you!

 --
 --
 v8-users mailing list
 v8-u...@googlegroups.com
 http://groups.google.com/group/v8-users
 ---
 You received this message because you are subscribed to the Google
 Groups "v8-users" group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to v8-users+u...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.

>>> --
>>> --
>>> v8-users mailing list
>>> v8-u...@googlegroups.com
>>> http://groups.google.com/group/v8-users
>>> ---
>>> You received this message because you are subscribed to a topic in the
>>> Google Groups "v8-users" group.
>>> To unsubscribe from this topic, visit https://groups.google.com/d/to
>>> pic/v8-users/j2CPHefGEmQ/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to
>>> v8-users+u...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
> --
> v8-users mailing list
> v8-users@googlegroups.com
> http://groups.google.com/group/v8-users
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "v8-users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/v8-users/j2CPHefGEmQ/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> v8-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
"v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [v8-users] Breaking On Native Function Calls

2016-10-20 Thread PhistucK
Yeah, I wish. I do not have a strong machine yet. :(

I wanted to try an old version of Chromium (which does not have
[Unforgeable] yet), but my corporate proxy is blocking me from using the
site in question. I will try again when I am home.


☆*PhistucK*

On Thu, Oct 20, 2016 at 9:31 AM, Krzysztof Olczyk  wrote:

> If making your own build of Chromium for your investigation purposes makes
> sense to you,
> it should work for you to remove "Unforgeable" here:
> https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/frame/
> Window.idl?l=41
>
> Then, you could defineProperty window.location to your "proxy" object.
>
>
>
> --
> Best regards,
> *Krzysztof Olczyk*
> Software Developer & Architect
> TVSDK Core team
>
> Opera TV
> Pl. Teatralny 8, 50-051 Wroclaw, Poland
>
> On Thu, Oct 20, 2016 at 7:54 AM, PhistucK  wrote:
>
>> File ​crbug.com/657697​ (and crbug.com/657700 for a related bug I found
>> as a result :(). But it is really a duplicate of crbug.com/49 (so I
>> closed mine). I guess it will not be in progress soon. :(
>>
>>
>> ☆*PhistucK*
>>
>> On Thu, Oct 20, 2016 at 8:19 AM, Jochen Eisinger 
>> wrote:
>>
>>> As far as I know that's not possible. Could you file a feature request
>>> for this (probably on crbug.com if you also want to cover DOM functions)
>>>
>>> On Wed, Oct 19, 2016 at 7:38 PM PhistucK  wrote:
>>>
 I wanted to know whether there is a V8 (or Chrome) flag of some sort
 that will let me add breakpoints on native function calls.
 I do not mean C++ functions, I mean built in web platform (or
 ECMAScript) functions.
 My issue is that I click on a link and suddenly some code is apparently
 calling document.location.replace("foo") or something and the page
 redirects (maliciously). In order to find the calling code, I want to set a
 breakpoint on calling document.location.replace, which is a native web
 platform function, that is not writable (so I cannot override it with my
 own function using Object.defineProperty, or use a proxy).
 (The code is apparently elusive and obfuscated somewhat, so it is not
 just a search and replace)
 I tried using the Developer Tools API - debug(function), but it did not
 break (even when I call it with setTimeout).

 A V8 flag (or a Chrome flag) that either lets me break on calling that
 function, or that overrides the security feature that makes it
 non-writable, or something like that, would let me see the code that calls
 it and find the malicious way it does so.

 So, is there something like that?

 Thank you!

 --
 --
 v8-users mailing list
 v8-users@googlegroups.com
 http://groups.google.com/group/v8-users
 ---
 You received this message because you are subscribed to the Google
 Groups "v8-users" group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to v8-users+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.

>>> --
>>> --
>>> v8-users mailing list
>>> v8-users@googlegroups.com
>>> http://groups.google.com/group/v8-users
>>> ---
>>> You received this message because you are subscribed to a topic in the
>>> Google Groups "v8-users" group.
>>> To unsubscribe from this topic, visit https://groups.google.com/d/to
>>> pic/v8-users/j2CPHefGEmQ/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to
>>> v8-users+unsubscr...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
>> --
>> v8-users mailing list
>> v8-users@googlegroups.com
>> http://groups.google.com/group/v8-users
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "v8-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to v8-users+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> --
> v8-users mailing list
> v8-users@googlegroups.com
> http://groups.google.com/group/v8-users
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "v8-users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/v8-users/j2CPHefGEmQ/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> v8-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
"v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [v8-users] Breaking On Native Function Calls

2016-10-20 Thread Yang Guo
I guess you are looking 
for https://bugs.chromium.org/p/v8/issues/detail?id=178

This is a long standing feature request that has not been addressed yet. 
I'll add it to our backlog.

On Thursday, October 20, 2016 at 7:55:38 AM UTC+2, PhistucK wrote:
>
> File ​crbug.com/657697​ (and crbug.com/657700 for a related bug I found 
> as a result :(). But it is really a duplicate of crbug.com/49 (so I 
> closed mine). I guess it will not be in progress soon. :(
>
>
> ☆*PhistucK*
>
> On Thu, Oct 20, 2016 at 8:19 AM, Jochen Eisinger  > wrote:
>
>> As far as I know that's not possible. Could you file a feature request 
>> for this (probably on crbug.com if you also want to cover DOM functions)
>>
>> On Wed, Oct 19, 2016 at 7:38 PM PhistucK  
>> wrote:
>>
>>> I wanted to know whether there is a V8 (or Chrome) flag of some sort 
>>> that will let me add breakpoints on native function calls.
>>> I do not mean C++ functions, I mean built in web platform (or 
>>> ECMAScript) functions.
>>> My issue is that I click on a link and suddenly some code is apparently 
>>> calling document.location.replace("foo") or something and the page 
>>> redirects (maliciously). In order to find the calling code, I want to set a 
>>> breakpoint on calling document.location.replace, which is a native web 
>>> platform function, that is not writable (so I cannot override it with my 
>>> own function using Object.defineProperty, or use a proxy).
>>> (The code is apparently elusive and obfuscated somewhat, so it is not 
>>> just a search and replace)
>>> I tried using the Developer Tools API - debug(function), but it did not 
>>> break (even when I call it with setTimeout).
>>>
>>> A V8 flag (or a Chrome flag) that either lets me break on calling that 
>>> function, or that overrides the security feature that makes it 
>>> non-writable, or something like that, would let me see the code that calls 
>>> it and find the malicious way it does so.
>>>
>>> So, is there something like that?
>>>
>>> Thank you!
>>>
>>> -- 
>>> -- 
>>> v8-users mailing list
>>> v8-u...@googlegroups.com 
>>> http://groups.google.com/group/v8-users
>>> --- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "v8-users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to v8-users+u...@googlegroups.com .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> -- 
>> -- 
>> v8-users mailing list
>> v8-u...@googlegroups.com 
>> http://groups.google.com/group/v8-users
>> --- 
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "v8-users" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/v8-users/j2CPHefGEmQ/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> v8-users+u...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
"v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [v8-users] Breaking On Native Function Calls

2016-10-20 Thread Krzysztof Olczyk
If making your own build of Chromium for your investigation purposes makes
sense to you,
it should work for you to remove "Unforgeable" here:
https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/frame/Window.idl?l=41

Then, you could defineProperty window.location to your "proxy" object.



-- 
Best regards,
*Krzysztof Olczyk*
Software Developer & Architect
TVSDK Core team

Opera TV
Pl. Teatralny 8, 50-051 Wroclaw, Poland

On Thu, Oct 20, 2016 at 7:54 AM, PhistucK  wrote:

> File ​crbug.com/657697​ (and crbug.com/657700 for a related bug I found
> as a result :(). But it is really a duplicate of crbug.com/49 (so I
> closed mine). I guess it will not be in progress soon. :(
>
>
> ☆*PhistucK*
>
> On Thu, Oct 20, 2016 at 8:19 AM, Jochen Eisinger 
> wrote:
>
>> As far as I know that's not possible. Could you file a feature request
>> for this (probably on crbug.com if you also want to cover DOM functions)
>>
>> On Wed, Oct 19, 2016 at 7:38 PM PhistucK  wrote:
>>
>>> I wanted to know whether there is a V8 (or Chrome) flag of some sort
>>> that will let me add breakpoints on native function calls.
>>> I do not mean C++ functions, I mean built in web platform (or
>>> ECMAScript) functions.
>>> My issue is that I click on a link and suddenly some code is apparently
>>> calling document.location.replace("foo") or something and the page
>>> redirects (maliciously). In order to find the calling code, I want to set a
>>> breakpoint on calling document.location.replace, which is a native web
>>> platform function, that is not writable (so I cannot override it with my
>>> own function using Object.defineProperty, or use a proxy).
>>> (The code is apparently elusive and obfuscated somewhat, so it is not
>>> just a search and replace)
>>> I tried using the Developer Tools API - debug(function), but it did not
>>> break (even when I call it with setTimeout).
>>>
>>> A V8 flag (or a Chrome flag) that either lets me break on calling that
>>> function, or that overrides the security feature that makes it
>>> non-writable, or something like that, would let me see the code that calls
>>> it and find the malicious way it does so.
>>>
>>> So, is there something like that?
>>>
>>> Thank you!
>>>
>>> --
>>> --
>>> v8-users mailing list
>>> v8-users@googlegroups.com
>>> http://groups.google.com/group/v8-users
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "v8-users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to v8-users+unsubscr...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
>> --
>> v8-users mailing list
>> v8-users@googlegroups.com
>> http://groups.google.com/group/v8-users
>> ---
>> You received this message because you are subscribed to a topic in the
>> Google Groups "v8-users" group.
>> To unsubscribe from this topic, visit https://groups.google.com/d/to
>> pic/v8-users/j2CPHefGEmQ/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> v8-users+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> --
> v8-users mailing list
> v8-users@googlegroups.com
> http://groups.google.com/group/v8-users
> ---
> You received this message because you are subscribed to the Google Groups
> "v8-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to v8-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
"v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.