简体   繁体   中英

Replacing V8 version of Chrome with a Debug Build

I would like to see the assembly and byte code generated by v8, when it's embedded in chrome. The standalone version of d8 does not have DOM support, so it's not sufficient in this case.

Running './chrome --js-flags="--help"' shows that "--print-bytecode" option is supported in this v8 version, but "--print-code" is not. More precisely, I would like to run chrome like this:

'./chrome -js-flags="--print-code"'

How can I replace the v8 version in google-chrome with a debug version that supports "--print-code"? I'm using a 64bit linux os.

Thanks.

Google Chrome builds are linked statically, which means you can't easily replace V8 or any other component.

One option is to compile Chromium from scratch (which will take a few hours). When you do so, simply add v8_enable_disassembler = true to your GN args to enable disassembler support in V8 (which includes --print-code support). See the instructions at https://chromium.googlesource.com/chromium/src/+/master/docs/linux_build_instructions.md .

Another option is to download a Debug build of Chromium (which has disassembler support by default) from the continuous integration infrastructure. This isn't officially supported, but it's possible: go to https://ci.chromium.org/p/chromium/g/main/console , click the latest green box in the chromium.linux > debug > builder > 64 column, scroll down to the "package build" step and click the "download" link.

Warning : What both approaches have in common is that the resulting builds may be very buggy, they don't auto-update, and the sandbox probably isn't working out of the box. You should only use these builds for targeted testing, not for regular browsing.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM