-
Notifications
You must be signed in to change notification settings - Fork 254
Use debug-prefix-map to avoid absolute paths in debug info #852
Conversation
gaaclarke
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know how to test this beforehand, but the idea that this fixes the linked issue is very credible.
|
@gaaclarke I'll probably land this either way so that we can be following the same best practices as in the Dart build, but since I'm not set up to fire up the vscode debugger, if you have time to patch this in and take it for a spin, that would be helpful. |
|
Can do, give me a minute. |
|
I was looking around how to verify the paths with commandline tools in macos. I was unable to find a way to reliably do it. Let me know if you know of a way. |
|
This didn't work for me. I still get Here's what I did: git apply 852.patch
gclient sync -D
rm -rf out/host_debug_unopt_arm64
./flutter/tools/gn --runtime-mode=debug --unoptimized --mac-cpu=arm64 --no-lto --use-glfw-swiftshader
./flutter/bin/et build -c host_debug_unopt_arm64 //flutter/impeller:impeller_unittests |
|
I figured out how one can verify if the paths are correct (or incorrect in this case, see /b/w/f/ paths below): |
|
I tried from command line lldb too to make sure it isn't just a vscode thing. The symbolic breakpoints will hit, but when issuing 'l' commands the source isn't listed. |
|
Hmm. With the patch, when I run that command in |
|
Wait, when I tried to test this, the gclient sync seems to have thrown away the change. With the change now I get So it worked in changing DW_AT_comp_dir, but I think we may need to use |
|
@zanderso make sure you are using macOS too. Jason has reported that it seems to work fine on linux without this patch. |
|
Yeah, I'm on my arm64 mac. |
|
Using |
|
I think maybe we can get this working by doing something like |
|
Right, we can't put an absolute path on the command line because it will either mess with the dependency scanner or the caching, probably both. |
|
@zanderso Can you verify that you are getting |
|
I created a local build to see what it's debugger symbols say, here are the results: I think that means we can do |
|
I ran with the following diff diff --git a/build/config/gcc/BUILD.gn b/build/config/gcc/BUILD.gn
index f4c1aa3..6aa2e7a 100644
--- a/build/config/gcc/BUILD.gn
+++ b/build/config/gcc/BUILD.gn
@@ -63,11 +63,11 @@ config("relative_paths") {
# option to keep all source file name references uniformly relative to
# a single root.
if (use_rbe) {
- absolute_path = "/b/f/w/"
+ absolute_path = "/b/f/w/set_by_reclient/a"
} else {
absolute_path = rebase_path("//")
}
- relative_path = ""
+ relative_path = "out/host_debug_unopt_arm64"
cflags = [
# This makes sure that the DW_AT_comp_dir string (the current
# directory while running the compiler, which is the basis for allwe get This looks identical to the local build, but doesn't work the same. VSCode doesn't work with it. |
|
I was able to get VSCode debugging to work with RBE-generated engine executables on macOS by using the CodeLLDB extension. That extension supports a setting for remapping source paths (see https://github.com/vadimcn/codelldb/blob/master/MANUAL.md#source-path-remapping) I used this |
For flutter/flutter#147750. Depends on flutter/buildroot#852. This PR rolls forward reclient, the buildroot, and our RBE configs. The new RBE configs do a few things. First they default the exec strategy to `racing`. Second, they add a local wrapper script that passes the correct value for `-fdebug-prefix-map` in both the local and remote cases. Finally, they remove the canonicalization of the build's working directory, so that the remote working directory will have the same name as the local working directory. This solves the issue where the build working directory contained a mysterious `set_by_reclient/a` component.

For flutter/flutter#147750