debug chromium in linux

794 views
Skip to first unread message

all smooth

unread,
May 1, 2013, 8:19:15 PM5/1/13
to chromi...@chromium.org
Hi, Chromium developers!
I would like to know what' the convention for you guys, especially googlers to debug in linux? 
Is gdb a recommended way?

I tried to use eclipse 3.8 following the link in chromium wikki page for about a week, and so far have a very bad experience. it has several issues:
1. break point installation failed
2. cannot start debug session, even restart eclipse.  and just before i update indexer and it's working fine. meanwhile gdb still works.

My question is if it's practical to use eclipse in Chromium case?

But I really don't want to give up GUI debugger tool and think this is much more efficient way to work on large size code such as Chromium, especially as a newcomer in this area . Any thoughts?

Thanks!

Anton Vayvod

unread,
May 1, 2013, 8:29:59 PM5/1/13
to guangyuanli, chromium-dev
Never tried it myself with Chromium but DDD or KDbg should work over GDB?



--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
 
 
 

all smooth

unread,
May 1, 2013, 10:27:24 PM5/1/13
to chromi...@chromium.org
To make it clear:
most of time it works with eclipse debug, but in some point it will shows the two symptoms I mentioned. In addition, sometimes when debug chrome the whole system is frozen.

Paul Jensen

unread,
May 3, 2013, 9:50:09 AM5/3/13
to guang...@gmail.com, Chromium-dev
I use eclipse on linux to debug.  I also find the break-point installation frequently fails; I think I investigated it long ago and found it was related to using the component build and eclipse trying to insert the breakpoints before the shared libraries had been loaded.  If you enable "Stop on startup at: main" and insert your breakpoints once the debugger is stopped on main() then you might have more luck.


--

all smooth

unread,
May 3, 2013, 1:10:53 PM5/3/13
to chromi...@chromium.org, guang...@gmail.com, paulj...@chromium.org
thanks for sharing!
I am wondering how much percentage people to use raw gdb to debug chrome so complicated system especially for newcomer?
all smooth,

Julien Tinnes

unread,
May 3, 2013, 1:18:51 PM5/3/13
to guang...@gmail.com, Chromium-dev, paulj...@chromium.org
Also make sure that you take a look at
https://code.google.com/p/chromium/wiki/LinuxDebugging

Most notably, you'll almost always want to debug with --no-sandbox

Julien

all smooth

unread,
May 3, 2013, 1:28:09 PM5/3/13
to chromi...@chromium.org, guang...@gmail.com, paulj...@chromium.org
Yes, i did with no-sandbox. 
The debug command to use in eclipse is
./chrome --no-sandbox, to exclude the remaining command parameters from that link it works well. otherwise it will launch its own two gdb debug window.

Seems to me most of people use gdb to debug. I saw a survey 80% use gdb. I cannot get used to it when exploring new world. 

all smooth

unread,
May 3, 2013, 1:31:04 PM5/3/13
to chromi...@chromium.org, guang...@gmail.com, paulj...@chromium.org
I'd like to have some experienced guy working on Chromium in google to share their dev experience. Please ...

Christian Biesinger

unread,
May 3, 2013, 1:50:57 PM5/3/13
to guangyuan li, chromium-dev, paulj...@chromium.org
I suspect most people use raw gdb, but I don't really have data on
this. Of course there's also the printf style of debugging.

You might like this text-based frontend to gdb: http://cgdb.github.io/

-christian

On Fri, May 3, 2013 at 10:10 AM, all smooth <guang...@gmail.com> wrote:

Chris Bentzel

unread,
May 3, 2013, 1:52:04 PM5/3/13
to cbies...@chromium.org, guangyuan li, chromium-dev, Paul Jensen
I don't always debug on Linux, but when I do I use gdb inside of emacs
(gud-mode).

Gregg Tavares

unread,
May 3, 2013, 2:31:37 PM5/3/13
to cben...@chromium.org, cbies...@chromium.org, guangyuan li, chromium-dev, Paul Jensen
I use cgdb (gdb wrapped by curses) generally like this

  out/Debug/chrome --no-sandbox --renderer-cmd-prefix="xterm -e cgdb --args" http://path/to/test

For the GPU process

  out/Debug/chrome --no-sandbox --gpu-launcher="xterm -e cgdb --args" http://path/to/test

Same on OSX

all smooth

unread,
May 6, 2013, 1:19:55 PM5/6/13
to chromi...@chromium.org, cbies...@chromium.org, guangyuan li, Paul Jensen
Hi Chris,
Thanks for sharing, it's very valuable to me to work on different platform.
When you verify your code for network stack, do you need to unit test it on all platforms? 
all smooth,

all smooth

unread,
May 6, 2013, 1:21:32 PM5/6/13
to chromi...@chromium.org, cben...@chromium.org, cbies...@chromium.org, guangyuan li, Paul Jensen
Hi Gregg,
thanks for sharing. Finally I managed to use eclipse to debug chrome and though not very ideal, but acceptable. 
Cheers!
all smooth

all smooth

unread,
May 6, 2013, 1:22:30 PM5/6/13
to chromi...@chromium.org, guangyuan li, paulj...@chromium.org
Hi Christian,
thanks for sharing.

Chris Bentzel

unread,
May 7, 2013, 12:46:03 PM5/7/13
to guangyuan li, chromium-dev, cbies...@chromium.org, Paul Jensen
Yes, it needs to be tested on all platforms. This is pretty much a
requirement for all Chrome code. The automated bots will run it for
you, so you don't necessarily need to develop on all platforms.

rijubrata bhaumik

unread,
May 31, 2013, 8:53:20 AM5/31/13
to chromi...@chromium.org
Hi Chris,

out/Debug/content_shell --no-sandbox --renderer-cmd-prefix='xterm -title renderer -e gdb --args'

works fine for me and i can step into the renderer process , e.g. in Xterm, i do -> (gdb) b WebCore::Node::attach()  .... and gdb stops at breakpoint

But when using gdb inside Emacs (gud-mode) it seems i can't get into the renderer process. 

M-x gdb
gdb --annotate=3 --args out/Debug/content_shell "--no-sandbox --renderer-cmd-prefix=gdb --args" 

looks like another gdb is exec 'ed for the renderer 
because after C-c C-c , when i do info threads, i can not see the thread for the renderer  ( pstree -p | grep content_shell) 

Any idea how to "not leave Emacs" and still break into renderer process ? 

-Riju.

ava...@gmail.com

unread,
Mar 28, 2014, 2:40:24 AM3/28/14
to chromi...@chromium.org
Hi Riju,

I am facing the same problem on Emacs. How did u resolve it? can you post your findings?

Thanks

Pankaj Goyal

unread,
Aug 24, 2015, 6:29:43 AM8/24/15
to Chromium-dev
I found this really useful post which talks about how to setup build and debug environment in eclipse.

Reply all
Reply to author
Forward
0 new messages