Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(408)

Issue 8491060: Make nacl_helper easily debuggable (Closed)

Created:
9 years, 1 month ago by Roland McGrath
Modified:
9 years, 1 month ago
CC:
chromium-reviews, native-client-reviews_googlegroups.com, eaeltsin
Visibility:
Public.

Description

Make nacl_helper easily debuggable This makes it so that attaching gdb to a nacl_helper process, or using gdb on a core dump from such a process, automatically finds the symbols of the nacl_helper executable and all the shared libraries it uses. The theory of operation and the details are explained in comments in the code. BUG= http://code.google.com/p/chromium/issues/detail?id=103436 TEST= nacl still works, gdb attach on nacl_helper process, or gdb on core file from one, find symbols R=mseaborn@chromium.org,bradchen@google.com Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=110120

Patch Set 1 #

Total comments: 8

Patch Set 2 : cosmetic trivia per review #

Unified diffs Side-by-side diffs Delta from patch set Stats (+127 lines, -0 lines) Patch
M chrome/app/nacl_fork_delegate_linux.cc View 2 chunks +6 lines, -0 lines 0 comments Download
M chrome/nacl/nacl_helper_bootstrap_linux.c View 1 4 chunks +61 lines, -0 lines 0 comments Download
M chrome/nacl/nacl_helper_bootstrap_linux.x View 2 chunks +10 lines, -0 lines 0 comments Download
M chrome/nacl/nacl_helper_linux.cc View 3 chunks +50 lines, -0 lines 0 comments Download

Messages

Total messages: 8 (0 generated)
Roland McGrath
9 years, 1 month ago (2011-11-12 00:19:31 UTC) #1
eaeltsin
http://codereview.chromium.org/8491060/diff/1/chrome/nacl/nacl_helper_linux.cc File chrome/nacl/nacl_helper_linux.cc (right): http://codereview.chromium.org/8491060/diff/1/chrome/nacl/nacl_helper_linux.cc#newcode151 chrome/nacl/nacl_helper_linux.cc:151: *bootstrap_r_debug = _r_debug; Neat. A very useful complement would ...
9 years, 1 month ago (2011-11-12 01:35:23 UTC) #2
eaeltsin
http://codereview.chromium.org/8491060/diff/1/chrome/nacl/nacl_helper_linux.cc File chrome/nacl/nacl_helper_linux.cc (right): http://codereview.chromium.org/8491060/diff/1/chrome/nacl/nacl_helper_linux.cc#newcode151 chrome/nacl/nacl_helper_linux.cc:151: *bootstrap_r_debug = _r_debug; Related note: if we want to ...
9 years, 1 month ago (2011-11-12 01:52:18 UTC) #3
Roland McGrath
On 2011/11/12 01:52:18, eaeltsin wrote: > http://codereview.chromium.org/8491060/diff/1/chrome/nacl/nacl_helper_linux.cc#newcode151 > chrome/nacl/nacl_helper_linux.cc:151: *bootstrap_r_debug = _r_debug; > Related note: ...
9 years, 1 month ago (2011-11-14 19:21:22 UTC) #4
Mark Seaborn
http://codereview.chromium.org/8491060/diff/1/chrome/app/nacl_fork_delegate_linux.cc File chrome/app/nacl_fork_delegate_linux.cc (right): http://codereview.chromium.org/8491060/diff/1/chrome/app/nacl_fork_delegate_linux.cc#newcode34 chrome/app/nacl_fork_delegate_linux.cc:34: const char kNaClHelperRDebug[] = "--r_debug=0xXXXXXXXXXXXXXXXX"; Maybe comment: passing this ...
9 years, 1 month ago (2011-11-14 20:15:40 UTC) #5
Roland McGrath
On 2011/11/14 20:15:40, Mark Seaborn wrote: > http://codereview.chromium.org/8491060/diff/1/chrome/app/nacl_fork_delegate_linux.cc#newcode34 > chrome/app/nacl_fork_delegate_linux.cc:34: const char kNaClHelperRDebug[] = > ...
9 years, 1 month ago (2011-11-14 21:32:09 UTC) #6
Mark Seaborn
LGTM. It's a shame hacks like this are required to make debugging work. On 14 ...
9 years, 1 month ago (2011-11-14 21:57:12 UTC) #7
Mark Seaborn
9 years, 1 month ago (2011-11-14 21:57:14 UTC) #8
LGTM.  It's a shame hacks like this are required to make debugging work.

On 14 November 2011 13:32, <mcgrathr@chromium.org> wrote:

> http://codereview.chromium.**org/8491060/diff/1/chrome/**
>
nacl/nacl_helper_linux.cc#**newcode165<http://codereview.chromium.org/8491060/diff/1/chrome/nacl/nacl_helper_linux.cc#newcode165>
>
>> chrome/nacl/nacl_helper_linux.**cc:165: l->l_name = argv0;
>> I find modifying the dynamic linker's data structures like this more
>> scary than
>>
> just copying them to a location that gdb is expected to look at. :-(
>>
>
> Copying all those data structures is infeasibly fragile and ill-advised.
> This is the only practical solution.
>

I wasn't suggesting copying it recursively, just saying that modifying
ld.so's data structures is dodgy.

Mark

Powered by Google App Engine
This is Rietveld 408576698