简体   繁体   English

使用调试版本替换Chrome V8版本

[英]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. 我希望看到v8嵌入chrome中时生成的程序集和字节代码。 The standalone version of d8 does not have DOM support, so it's not sufficient in this case. d8的独立版本不支持DOM,因此在这种情况下还不够。

Running './chrome --js-flags="--help"' shows that "--print-bytecode" option is supported in this v8 version, but "--print-code" is not. 运行'./chrome --js-flags =“-help”'表明此v8版本支持“ --print-bytecode”选项,但不支持“ --print-code”。 More precisely, I would like to run chrome like this: 更确切地说,我想像这样运行chrome:

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

How can I replace the v8 version in google-chrome with a debug version that supports "--print-code"? 如何使用支持“ --print-code”的调试版本替换google-chrome中的v8版本? I'm using a 64bit linux os. 我正在使用64位linux操作系统。

Thanks. 谢谢。

Google Chrome builds are linked statically, which means you can't easily replace V8 or any other component. Google Chrome浏览器的内部版本是静态链接的,这意味着您无法轻松替换V8或任何其他组件。

One option is to compile Chromium from scratch (which will take a few hours). 一种选择是从头开始编译Chromium(这将花费几个小时)。 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). 这样做时,只需在GN args中添加v8_enable_disassembler = true即可在V8中启用反汇编程序支持(包括--print-code支持)。 See the instructions at https://chromium.googlesource.com/chromium/src/+/master/docs/linux_build_instructions.md . 请参阅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. 另一个选择是从持续集成基础结构中下载Chromium的Debug版本(默认情况下具有反汇编程序支持)。 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. 官方不支持此功能,但是有可能:转到https://ci.chromium.org/p/chromium/g/main/console ,单击chromium中的最新绿色框。linux> debug> builder> 64列,向下滚动到“程序包构建”步骤,然后单击“下载”链接。

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. 您仅应将这些构建用于目标测试,而不应用于常规浏览。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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