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

Issue 866383004: Fix skydb --gdb to always have symbols (Closed)

Created:
5 years, 11 months ago by eseidel
Modified:
5 years, 11 months ago
CC:
mojo-reviews_chromium.org, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, esprehn, yzshen+watch_chromium.org, abarth-chromium, Aaron Boodman, darin (slow to review), ben+mojo_chromium.org, ojan
Base URL:
git@github.com:domokit/mojo.git@master
Target Ref:
refs/heads/master
Project:
mojo
Visibility:
Public.

Description

Fix skydb --gdb to always have symbols This replaces my previous --gdb work: https://codereview.chromium.org/848013004/ And obsoletes my build-id based attempt: https://codereview.chromium.org/788903011 Context: mojo_shell downloads arbitrary binaries from urls copying them to temp files before calling dlopen. Because the names it used were random this broke gdb, pprof, etc. tools which wanted to make address -> symbol translations based on the library load path. The major thing this change does is move away from the previous method of watching the logs of mojo_shell for 'Caching %url as %file...' messages or the /tmp/mojo_shell.%pid.map file to having mojo_shell use a priori knowable names for all of its library loads. Thus we can similarly build a directory of correctly named symboled binaries corresponding to the expected load names of libraries. This change does this in 3 pieces: 1. Introduces the concept of 'app ids' (which are currently just the md5 of the distributed app binary) and teaches dynamic_application_loader to rename all apps to APP_ID.mojo before loading them. This has the nice side-effect of always loading an app with a dlopen/library name which is both unique to the application as well as predictable. 2. Re-writes the mojo_cache_linker script to no longer watch stdin/adb logcat for 'caching...' messages and instead build a links directory based on pre-determined app_ids (md5s) linking back to the symboled binaries. 3. Remove a bunch of the former mojo_cache_linker calling code which is no longer needed now that the library_names of loaded application .so's are predictable before launching mojo_shell I'm happy to make app_ids fancier, originally I was going to use ELF's build-id's directly: https://codereview.chromium.org/788903011 but unfortunately gdbserver does not know how to do a build-id lookup on the serverside: https://groups.google.com/a/google.com/forum/#!topic/gdb-discuss/Fd0R-gFaqXk R=aa@chromium.org, abarth@chromium.org Committed: https://chromium.googlesource.com/external/mojo/+/fddf1753e008e13e990663b53e1864d4c027464a

Patch Set 1 #

Total comments: 20

Patch Set 2 : Updated per aa's review #

Patch Set 3 : More review fixes #

Patch Set 4 : Remove <fstream> and use base/files/file.h instead #

Total comments: 1

Patch Set 5 : Fix help text #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+133 lines, -75 lines) Patch
M shell/dynamic_application_loader.cc View 1 2 3 4 chunks +68 lines, -7 lines 3 comments Download
M sky/tools/mojo_cache_linker.py View 1 2 3 4 1 chunk +33 lines, -33 lines 0 comments Download
M sky/tools/skydb View 6 chunks +32 lines, -35 lines 0 comments Download

Messages

Total messages: 11 (1 generated)
eseidel
5 years, 11 months ago (2015-01-23 21:02:16 UTC) #1
Aaron Boodman
https://codereview.chromium.org/866383004/diff/1/shell/dynamic_application_loader.cc File shell/dynamic_application_loader.cc (right): https://codereview.chromium.org/866383004/diff/1/shell/dynamic_application_loader.cc#newcode7 shell/dynamic_application_loader.cc:7: #include <fstream> We don't typically use stl's stream support ...
5 years, 11 months ago (2015-01-23 21:56:41 UTC) #2
eseidel
https://codereview.chromium.org/866383004/diff/1/shell/dynamic_application_loader.cc File shell/dynamic_application_loader.cc (right): https://codereview.chromium.org/866383004/diff/1/shell/dynamic_application_loader.cc#newcode7 shell/dynamic_application_loader.cc:7: #include <fstream> On 2015/01/23 21:56:40, Aaron Boodman wrote: > ...
5 years, 11 months ago (2015-01-23 22:12:21 UTC) #3
Aaron Boodman
https://codereview.chromium.org/866383004/diff/1/shell/dynamic_application_loader.cc File shell/dynamic_application_loader.cc (right): https://codereview.chromium.org/866383004/diff/1/shell/dynamic_application_loader.cc#newcode7 shell/dynamic_application_loader.cc:7: #include <fstream> On 2015/01/23 22:12:21, eseidel wrote: > On ...
5 years, 11 months ago (2015-01-23 22:29:00 UTC) #4
eseidel
Making RenameToAppId (now CopyCompleted) fail-fast to the callback without using goto: was kinda awkward, but ...
5 years, 11 months ago (2015-01-23 22:53:05 UTC) #5
eseidel
PTAL, I believe I've addressed all your comments.
5 years, 11 months ago (2015-01-23 22:53:18 UTC) #6
Aaron Boodman
lgtm https://codereview.chromium.org/866383004/diff/60001/shell/dynamic_application_loader.cc File shell/dynamic_application_loader.cc (right): https://codereview.chromium.org/866383004/diff/60001/shell/dynamic_application_loader.cc#newcode309 shell/dynamic_application_loader.cc:309: // AppIds should be be both predictable and ...
5 years, 11 months ago (2015-01-23 22:56:01 UTC) #7
eseidel
Committed patchset #5 (id:80001) manually as fddf1753e008e13e990663b53e1864d4c027464a (presubmit successful).
5 years, 11 months ago (2015-01-23 23:18:25 UTC) #8
qsr
https://codereview.chromium.org/866383004/diff/80001/shell/dynamic_application_loader.cc File shell/dynamic_application_loader.cc (right): https://codereview.chromium.org/866383004/diff/80001/shell/dynamic_application_loader.cc#newcode312 shell/dynamic_application_loader.cc:312: static bool ComputeAppId(const base::FilePath& path, Do you need to ...
5 years, 11 months ago (2015-01-26 09:47:52 UTC) #10
qsr
5 years, 11 months ago (2015-01-26 09:49:10 UTC) #11
Message was sent while issue was closed.
https://codereview.chromium.org/866383004/diff/80001/shell/dynamic_applicatio...
File shell/dynamic_application_loader.cc (right):

https://codereview.chromium.org/866383004/diff/80001/shell/dynamic_applicatio...
shell/dynamic_application_loader.cc:297: base::FilePath map_path =
temp_dir.Append(map_name);
Now that you use md5, do you still need this? This file is currently leaking.

Powered by Google App Engine
This is Rietveld 408576698