Re: [v8-users] __jit_debug_register_code was not invoked in debug build

2018-06-19 Thread Mingwei
No. it does not. Neither --gdbjit or --gdbjit_full works on d8.

One thing I noticed is that in this version of d8, I am not seeing any
RWX code pages. Obviously, V8 enforces W^X policy on JIT code pages.
But I am not sure if this is the reason for that.

Let me know. Thanks.

best

On Tue, Jun 19, 2018 at 2:45 AM, Ben Noordhuis  wrote:
> On Tue, Jun 19, 2018 at 4:11 AM, Mingwei Zhang  wrote:
>> Hi Ben,
>>
>> The problem is that I don't get any breakpoint hit notification in gdb. The
>> program just execute and exited normally, regardless of whether i set the
>> breakpoint or not in __jit_debug_register_code.
>>
>> I double checked in instructions that when I am using gm.py with target
>> x64.debug, it does use the option ENABLE_GDB_JIT_INTERFACE.
>>
>> So, then I am very confused why I don't get breakpoint hit in gdb.
>>
>> Appreciate your help.
>
> Do things go better when you also pass --gdbjit_full to d8?  If not,
> I'd say it's safe to assume the code has bitrotted (but fix-up CLs
> undoubtedly welcome in that case.)
>
> --
> --
> 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.



-- 
Mingwei Zhang

-- 
-- 
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] __jit_debug_register_code was not invoked in debug build

2018-06-19 Thread Ben Noordhuis
On Tue, Jun 19, 2018 at 4:11 AM, Mingwei Zhang  wrote:
> Hi Ben,
>
> The problem is that I don't get any breakpoint hit notification in gdb. The
> program just execute and exited normally, regardless of whether i set the
> breakpoint or not in __jit_debug_register_code.
>
> I double checked in instructions that when I am using gm.py with target
> x64.debug, it does use the option ENABLE_GDB_JIT_INTERFACE.
>
> So, then I am very confused why I don't get breakpoint hit in gdb.
>
> Appreciate your help.

Do things go better when you also pass --gdbjit_full to d8?  If not,
I'd say it's safe to assume the code has bitrotted (but fix-up CLs
undoubtedly welcome in that case.)

-- 
-- 
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] __jit_debug_register_code was not invoked in debug build

2018-06-18 Thread Mingwei Zhang
Hi Ben,

The problem is that I don't get any breakpoint hit notification in gdb. The 
program just execute and exited normally, regardless of whether i set the 
breakpoint or not in __jit_debug_register_code.

I double checked in instructions that when I am using gm.py with target 
x64.debug, it does use the option ENABLE_GDB_JIT_INTERFACE.

So, then I am very confused why I don't get breakpoint hit in gdb.

Appreciate your help.

On Monday, June 18, 2018 at 3:20:44 PM UTC-7, Ben Noordhuis wrote:
>
> On Sun, Jun 17, 2018 at 11:15 PM, Mingwei Zhang  > wrote: 
> > Dear V8 developer, 
> > 
> > I recently tried to use the debugging interface for gdb on JIT code. 
> When I 
> > tried building a debug build of V8 and following the instructions in: 
> > 
> > https://github.com/v8/v8/wiki/GDB-JIT-Interface 
> > 
> > I launched my program using the following command: 
> > 
> >> gdb --args ./d8 --gdbjit helloworld.js 
> > 
> > 
> > In the gdb prompt, I setup a breakpoint in __jit_debug_register_code 
> before 
> > launch my program, but looks like the hook was never invoked. 
> > 
> > I am using gdb 7.11 in Ubuntu 16.04. 
> > d8 version 6.7.0 (candidate) 
> > 
> > My helloworld.js is very simple like this: 
> >>> 
> >>> function func() { 
> >>> 
> >>> console.log('hello'); 
> >>> 
> >>> } 
> >>> 
> >>> 
> >>> func() 
> >> 
> >> 
> > 
> > Thanks. 
>
> You don't have to set a breakpoint in __jit_debug_register_code, gdb 
> does that for you.  It's a magic method that gdb recognizes, see 
> https://sourceware.org/gdb/onlinedocs/gdb/Declarations.html for 
> details. 
>
> That said, the gdbjit code is unmaintained - or at least not regularly 
> tested - and quite possibly broken.  YMMV. 
>

-- 
-- 
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] __jit_debug_register_code was not invoked in debug build

2018-06-18 Thread Ben Noordhuis
On Sun, Jun 17, 2018 at 11:15 PM, Mingwei Zhang  wrote:
> Dear V8 developer,
>
> I recently tried to use the debugging interface for gdb on JIT code. When I
> tried building a debug build of V8 and following the instructions in:
>
> https://github.com/v8/v8/wiki/GDB-JIT-Interface
>
> I launched my program using the following command:
>
>> gdb --args ./d8 --gdbjit helloworld.js
>
>
> In the gdb prompt, I setup a breakpoint in __jit_debug_register_code before
> launch my program, but looks like the hook was never invoked.
>
> I am using gdb 7.11 in Ubuntu 16.04.
> d8 version 6.7.0 (candidate)
>
> My helloworld.js is very simple like this:
>>>
>>> function func() {
>>>
>>> console.log('hello');
>>>
>>> }
>>>
>>>
>>> func()
>>
>>
>
> Thanks.

You don't have to set a breakpoint in __jit_debug_register_code, gdb
does that for you.  It's a magic method that gdb recognizes, see
https://sourceware.org/gdb/onlinedocs/gdb/Declarations.html for
details.

That said, the gdbjit code is unmaintained - or at least not regularly
tested - and quite possibly broken.  YMMV.

-- 
-- 
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.