v8windbg is mostly focused on making the Locals pane show the fields in 
V8's heap objects. It also includes a few things you can use in `dx` 
commands: `dx @$v8object(0x4589af445d)` prints an object, and `dx 
@$jsstack()` prints some info about the JavaScript frames on the stack. 
Unfortunately, it doesn't know anything about CSA code comments. The 
strategy I've used in the past is to invoke `mksnapshot --print-code 
--code-comments <and the rest of the normal arguments>` and redirect its 
output to a file, so then I have a complete listing of all builtins.

Best,
Seth

On Monday, September 23, 2024 at 9:11:18 AM UTC-7 Jakob Kummerow wrote:

> I'm only familiar with tools/gdbinit, which is GDB-specific.
> There is tools/v8windbg/ though, which is presumably helpful for windbg.
>
>
> On Mon, Sep 23, 2024 at 5:59 PM 18楼梦想改造家 <[email protected]> wrote:
>
>> BTW, is it only worked for gdb, could it worked for windbg?
>>
>> 在2024年9月23日星期一 UTC+8 23:40:25<Jakob Kummerow> 写道:
>>
>>> These are "code comments". You'll need to enable both the GN arg 
>>> v8_code_comments 
>>> = true and the command-line flag --code-comments; since CSA is used 
>>> only in mksnapshot you need to either:
>>> - pass the latter flag to a manual invocation of mksnapshot, 
>>> - or enable it by default in flag-definitions.h and recompile normally,
>>> - or, most conveniently, set the GN arg v8_enable_snapshot_code_comments 
>>> = true (which implies the other GN arg and the command-line flag).
>>> You can then see these comments when disassembling builtins (with the 
>>> jco GDB macro). You may also want to use --nodebug-code to skip a large 
>>> number of generated checks that tend to be confusing when reading code.
>>>
>>> Code comments cannot be used for tracing control flow at runtime, 
>>> they're only helpful for making sense of the disassembly of generated code. 
>>> Control flow can be traced with the various Print(...) overloads in 
>>> CSA, which will print to stdout.
>>>
>>>
>>> On Mon, Sep 23, 2024 at 5:23 PM 18楼梦想改造家 <[email protected]> wrote:
>>>
>>>> Hi, anyone. 
>>>>
>>>> In v8 CSA subsystem, there are some code like this:
>>>>
>>>> ``` c++
>>>> void AccessorAssembler::GenericPropertyLoad(
>>>>     TNode<HeapObject> lookup_start_object, TNode<Map> 
>>>> lookup_start_object_map,
>>>>     TNode<Int32T> lookup_start_object_instance_type, const 
>>>> LoadICParameters* p,
>>>>     Label* slow, UseStubCache use_stub_cache) {
>>>>   DCHECK_EQ(lookup_start_object, p->lookup_start_object());
>>>>   ExitPoint direct_exit(this);
>>>>
>>>>   Comment("key is unique name");   // [+] @a  
>>>>   Label if_found_on_lookup_start_object(this), 
>>>> if_property_dictionary(this),
>>>>       lookup_prototype_chain(this), special_receiver(this);
>>>> }
>>>> ```
>>>>
>>>> At @a, we have a comment , I want to use it to trace the flow. But I 
>>>> don't know how to use it? So I have 2 question.
>>>>
>>>> 1. How to enable the Comment, is it worked in release version?
>>>> 2. If we enable it, where the comment will Print to?
>>>>
>>>> Thanks! 
>>>
>>>

-- 
-- 
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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/v8-dev/7956ab86-04b7-43ad-88be-df78b1a1a31cn%40googlegroups.com.

Reply via email to