Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tools: fix source mapping #2429

Merged
merged 2 commits into from
Jul 18, 2022
Merged

tools: fix source mapping #2429

merged 2 commits into from
Jul 18, 2022

Conversation

Augustyniak
Copy link
Contributor

Description: Per our documentation, the following should be true "While breaking on a C++ function, Android Studio should present the source file and highlight the line where the breakpoint hit with all scope information". That feature did not work - I didn't confirm this but it's possible that the functionality was broken when #2184 was merged. Anyway, the issue was that

build:dbg --copt="-fdebug-compilation-dir" --copt="/proc/self/cwd"
config setting was not applied when Envoy Mobile was built for the runs of example apps. This has been fixed by making run configurations that are used by Envoy Mobile example apps specify --config=dbg setting explicitly.
Risk Level: None
Testing: Confirmed that Android Studio opens the right file (and highlights the right line) when EnvoyMobile breakpoint is hit.
Docs Changes: N/A
Release Notes: N/A

Signed-off-by: Rafal Augustyniak raugustyniak@lyft.com

Signed-off-by: Rafal Augustyniak <raugustyniak@lyft.com>
@Augustyniak Augustyniak requested review from jpsim and goaway July 18, 2022 20:40
keith
keith previously approved these changes Jul 18, 2022
.bazelrc Outdated
@@ -40,6 +40,7 @@ build --java_language_version=8
# Override PGV validation with NOP functions
build --@com_envoyproxy_protoc_gen_validate//bazel:template-flavor=nop

build:dbg --compilation_mode=debug
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't it --compilation_mode=dbg?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes... thank you for catching this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I think that for whatever reason both work since the change from debug -> dbg did not result in a rebuild of the project)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hrm don't think so:

--compilation_mode=daf
ERROR: While parsing option --compilation_mode=daf: Not a valid compilation mode: 'daf' (should be fastbuild, dbg or opt)

are you sure it's getting picked up?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mhm... looking into this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not picked up it seems. This is what I see in the console when I click "Debug" in Android Studio:

Command: /Users/raugustyniak/src/envoy-mobile/bazelw build --tool_tag=ijwb:AndroidStudio --output_groups=+android_deploy_info --curses=no --color=yes --progress_in_terminal_title=no --config=dbg --fat_apk_cpu=arm64-v8a --fission=no -c dbg --build_event_binary_file=/var/folders/0x/1rsd77td52188p67fnqhm36r0000gn/T/intellij-bep-482ec217-a27f-49c5-bfd5-3374b78b57ab --nobuild_event_binary_file_path_conversion -- //examples/kotlin/hello_world:hello_envoy_kt

-c dbg is there even if I explicitly set --compilation_mode to other value in my .bazelrc file.

Copy link
Contributor

@Reflejo Reflejo Jul 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea that's because android studio's bazel plugin is adding -c dbg when you hit the lil debug icon and is overriding your compilation mode, so I presume you can set any garbage and it won't fail because it'll get overriden

Copy link
Contributor Author

@Augustyniak Augustyniak Jul 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, got it - makes sense. Thank you for the context.

In that case, I am going to keep --compilation_mode=dbg for cases when we want to use --config=dbg from outside of the debugging flow in Android Studio UI.

Signed-off-by: Rafal Augustyniak <raugustyniak@lyft.com>
@Augustyniak Augustyniak merged commit 6eb67e6 into main Jul 18, 2022
@Augustyniak Augustyniak deleted the fix-source-map branch July 18, 2022 21:54
jpsim added a commit that referenced this pull request Jul 18, 2022
* main:
  tools: fix source mapping (#2429)
  Update Envoy (#2427)
  tools: add arm64 debug run configuration (#2424)
  Revert "docs: use sphinx githubpages extension (#2418)" (#2425)
  Remove Tulsi configuration & docs (#2421)
  Fix isCleartextTrafficPermitted (#2420)
  Squelch two JNI build warnings (#2426)
  dns: allow using the `getaddrinfo`-based system DNS resolver (#2419)
  docs: use sphinx githubpages extension (#2418)
  Update Envoy (#2417)
  Remove rules_cc uses
  Bump Lyft Support Rotation (#2414)
  iOS: fix retain cycles in `EnvoyNetworkMonitor` (#2415)
  Update Envoy (#2413)
  engine: remove outdated comment about `registerFactories()` (#2412)
  api: make RequestTrailersBuilder and ResponseHeadersBuilder constructors public (#2410)

Signed-off-by: JP Simard <jp@jpsim.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants