How to debug v8 snapshot?

120 views
Skip to first unread message

18楼梦想改造家

unread,
Aug 29, 2024, 9:33:59 AM8/29/24
to v8-dev
Hi, anyone.

I have a little question. When I read the v8 code, I found a file named `out\book\gen\embedded.S|`. there are some code like this:

``` c++
.def Builtins_DeoptimizationEntry_Eager; .scl 2; .type 32; .endef;
  .octa 0x4c110ff22404110ff200000080ec8148,0xff218245c110ff2102454110ff20824
```

at here , octa is `0x4c110ff`... I want to know why it is this value. So I guess if I could debug the process which generate `|embedded.s|`, it will help me understand it.

I found this function( embedded-file-writer.h - Chromium Code Search  )
``` c++
void MaybeWriteEmbeddedFile(const i::EmbeddedData* blob) const {
if (embedded_src_path_ == nullptr) return;
base::Fclose(fp);
}
```

which related to this process?

So how to debug it, is there are a document for it? Thanks!

Jakob Gruber

unread,
Sep 3, 2024, 5:23:49 PM9/3/24
to v8-...@googlegroups.com
These are bytestreams of the compiled builtins. The --print-builtin-code d8 flag will show you the disassembled version. Hope that helps!

--
--
v8-dev mailing list
v8-...@googlegroups.com
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 v8-dev+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/v8-dev/387e4b62-bccc-4973-a85f-df3091641d3cn%40googlegroups.com.

Jakob Gruber

Software Engineer

jgr...@google.com

Google Germany GmbH

Erika-Mann-Straße 33

80636 München


Geschäftsführer: Paul Manicle, Halimah DeLaine Prado

Registergericht und -nummer: Hamburg, HRB 86891

Sitz der Gesellschaft: Hamburg


Diese E-Mail ist vertraulich. Falls sie diese fälschlicherweise erhalten haben sollten, leiten Sie diese bitte nicht an jemand anderes weiter, löschen Sie alle Kopien und Anhänge davon und lassen Sie mich bitte wissen, dass die E-Mail an die falsche Person gesendet wurde.

    

This e-mail is confidential. If you received this communication by mistake, please don't forward it to anyone else, please erase all copies and attachments, and please let me know that it has gone to the wrong person.

Wenqin Yang

unread,
Sep 4, 2024, 10:52:01 AM9/4/24
to v8-dev
embeded.S file was generated by a program called mksnapshot, if you're still want to debug it, you could try to build d8 with "ninja -C /your-path -v", and then you will see a command line which start with mksnapshot near the end of the build process. then you could debug mksnapshot with this command line.

Hope it helps you.

Reply all
Reply to author
Forward
0 new messages