Adds details on setting up eclipse to build chromium
Updates the instructions for setting up eclipse to include: - Newer version of eclipse that is known for these instructions to work - Instructions on how to run inside eclipse - A note on warning/errors and how to supplant them - Instructions on how to set breakpoints while running multiple process binaries (e.g. chrome or content_shell) adds more information on setting up eclipse to build chromium Change-Id: If6dd60d2032b8adce3c993684d5125c82da5e80c Reviewed-on: https://chromium-review.googlesource.com/c/1332727 Reviewed-by: James Cook <jamescook@chromium.org> Commit-Queue: Sam Goto <goto@chromium.org> Cr-Commit-Position: refs/heads/master@{#628844}
This commit is contained in:
@ -20,7 +20,7 @@ developing Chromium. It's unpolished, but here's what works:
|
||||
|
||||
### Get & Configure Eclipse
|
||||
|
||||
Eclipse 4.3 (Kepler) is known to work with Chromium for Linux.
|
||||
Eclipse 4.6.1 (Neon) is known to work with Chromium for Linux.
|
||||
|
||||
* [Download](http://www.eclipse.org/downloads/) the distribution appropriate
|
||||
for your OS. For example, for Linux 64-bit/Java 64-bit, use the Linux 64 bit
|
||||
@ -166,6 +166,15 @@ most header files, however. Give it more help finding them:
|
||||
Now the indexer will find many more include files, regardless of which approach
|
||||
you take below.
|
||||
|
||||
Eclipse will still complain about unresolved includes or invalid declarations
|
||||
(semantic errors or code analysis errors in the ```Problems``` tab),
|
||||
which you can set eclipse to ignore:
|
||||
|
||||
1. Right-click on "src" and select "Properties..."
|
||||
* Open C++ General > Code Analysis
|
||||
* Change the severity from ```Error``` to ```Warning``` for each of the
|
||||
settings that you want eclipse to ignore.
|
||||
|
||||
#### Optional: Manual header paths and symbols
|
||||
|
||||
You can manually tell Eclipse where to find header files, which will allow it to
|
||||
@ -255,6 +264,18 @@ If you want to build multiple different targets in Eclipse (`chrome`,
|
||||
You can also drag the toolbar to the bottom of your window to save vertical
|
||||
space.
|
||||
|
||||
### Optional: Running inside eclipse
|
||||
|
||||
Running inside eclipse is fairly straightforward:
|
||||
|
||||
1. Create a ```C/C++ Application```:
|
||||
1. ```Run``` > ```Run configurations```
|
||||
2. Double click on ```C/C++ Application```
|
||||
3. Pick a name (e.g. ```shell```)
|
||||
4. Point to ```C/C++ Application```
|
||||
(e.g. ```src/out/Default/content_shell```)
|
||||
6. Click ```Debug``` to run the program.
|
||||
|
||||
### Optional: Debugging
|
||||
|
||||
1. From the toolbar at the top, click the arrow next to the debug icon and
|
||||
@ -269,6 +290,46 @@ space.
|
||||
1. Set a breakpoint somewhere in your code and click the debug icon to start
|
||||
debugging.
|
||||
|
||||
#### Multi-process debugging
|
||||
|
||||
If you set breakpoints and your debugger session doesn't stop it is because
|
||||
both ```chrome``` and ```content_shell ``` spawn sub-processes.
|
||||
To debug, you need to attach a debugger to one of those sub-processes.
|
||||
|
||||
Eclipse can attach automatically to forked processes
|
||||
(Run -> Debug configurations -> Debugger tab), but that doesn't seem to
|
||||
work well.
|
||||
|
||||
The overall idea is described [here](https://www.chromium.org/blink/getting-started-with-blink-debugging)
|
||||
, but one way to accomplish this in eclipse is to run two ```Debug configurations```:
|
||||
|
||||
1. Create a ```C/C++ Application```:
|
||||
1. ```Run``` > ```Debug configurations```
|
||||
2. Double click on ```C/C++ Application```
|
||||
3. Pick a name (e.g. ```shell```)
|
||||
4. Point to ```C/C++ Application```
|
||||
(e.g. ```src/out/Default/content_shell```)
|
||||
5. In the arguments tab, add the following the to program arguments:
|
||||
```--no-sandbox --renderer-startup-dialog test.html```
|
||||
6. Click ```Debug``` to run the program.
|
||||
7. That will run the application and it will stop with a message like the
|
||||
following:
|
||||
```Renderer (239930) paused waiting for debugger to attach. Send SIGUSR1 to unpause.```
|
||||
9. ```239930``` is the number of the process running waiting for the ```signal```.
|
||||
2. Create a ```C/C++ Attach to Application```:
|
||||
1. ```Run``` > ```Debug configurations```
|
||||
2. Double click on ```C/C++ Attach to Application```
|
||||
2. Pick a name (e.g. ```shell proc```)
|
||||
3. Click ```Debug``` to run the configuration.
|
||||
4. In the ```Select Processes``` dialog, pick the process that was
|
||||
spawned above (if you type ```content_shell``` it will filter by
|
||||
name)
|
||||
5. Click on ```Debugger console``` to access the ```gdb``` console.
|
||||
6. Send the original process a signal
|
||||
```signal SIGUSR1```
|
||||
7. That should unblock the original process and you should now be able to
|
||||
set breakpoints.
|
||||
|
||||
### Optional: Accurate symbol information
|
||||
|
||||
If setup properly, Eclipse can do a great job of semantic navigation of C++ code
|
||||
@ -391,3 +452,5 @@ in practice than the simpler (and less bug-prone) approach above.
|
||||
is helpful:
|
||||
1. For improved performance, I use medium-granularity projects (eg. one for
|
||||
WebKit/Source) instead of putting all of 'src/' in one project.
|
||||
1. Running [```content_shell```](https://www.chromium.org/developers/content-module)
|
||||
as opposed to all of ```chrome``` is a lot faster/smaller.
|
||||
|
Reference in New Issue
Block a user