How to easily and quickly debug a tall Google browser

Source: Internet
Author: User

In the previous article, we simply compiled chromium,android content_shell_apk on Ubuntu , and everything went well to build the APK. But we just copy someone else's Google open source, as a developer we should take the spirit of exploration, said it is stable, fast. Why is it so fast and stable? With this series of questions, we learn to understand it, to understand its principles and structure.

So......

All the finer things finally come down to the source until we know it is familiar. How quick to get acquainted with it? It's 2.

1, a lot of code reading

2. Tracking Debug code

Today we will simply learn the simple debugging chromium code under Ubuntu

First of all we have to get debug debug version on Ubuntu to run debugging.

Compile steps:

1.Build/Install-Build-Deps.SH

2.Build/Gyp_chromium-Dflag1=value1-Dflag2=value2

export  gyp_defines = "flag1=value1 Flag2=value2"

4.Ninja-v-C out/DebugChrome

After successful compilation, 300 or so files are generated under Src/out/debug, including chrome executables and libraries.

Debugging:

The simplest way to debug multiple processes is to use the Attach PID

Under Shell: gdb src/out/debug/chrome boot to gdb input with R-no-sandbox (sandbox mode does not work, needs to be researched)

PS-AX View Process ID


or with Pstree-p|grep Chrome.


Re-open the shell input sudo gdb (with permission restrictions must be rooted)

After GdB starts , enter the Attach PID and add the breakpoint you want to debug.

We debug the RenderImage.cpp layout function to call the stack in the drawing process

With the function call stack order, you have no understanding of the place to add a breakpoint, look at the stack everything is so simple.

Debug debugging can only play an auxiliary role, learning or we need to understand the framework, a lot of reading source code.


If you have questions about this series of articles, you can directly in the public message, the first time to contact the original author to help you patiently answer.

Technicians have their own feelings, deep in which they are not understood, welcome to the personal public platform: the Programmer Interaction Alliance (Coder_online), a developer's home, to tell their story.


How to easily and quickly debug a tall Google browser

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.