-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
CPP gdb lldb no debugging symbols found #2537
Comments
dSYM is generated,but is is empty, even when add
|
RobotLocomotion/drake developers who use OS X are experiencing this also. We are actively investigating workarounds. If we find something, I'll update this thread, but any guidance from the Bazel team would be hugely appreciated! |
Related: #327. I'm having some preliminary success running |
Here's an outline of a workaround we've prototyped locally:
We have binary/library/test wrapper macros that simplify insertion of this genrule across the board.
This has a bunch of deficiencies. It disables sandboxing, it declares a directory output from a genrule (which is unsound), it clutters the build with extra targets, and it doesn't actually build the debug symbols on |
This generates .dSYM files for cc_binary and cc_test rules. See bazelbuild/bazel#2537
This generates .dSYM files for cc_binary and cc_test rules. See bazelbuild/bazel#2537
This generates .dSYM files for cc_binary and cc_test rules. See bazelbuild/bazel#2537
Is the workaround above still the one we should use ? |
@david-german-tri Would it be possible to give some more explanation on how to use the workaround ? I added a |
I use the workaround and can generate the dSYM required to step through the executable with lldb. When we run in sandbox mode, is it possible to access the object files required by dsymutil? |
What is the status of this? When will we get debug symbols without hacks? Thanks! :) |
+1 -- I had the misfortune of introducing a problem that could be repro'd only on Mac and the question was whether to deal with this hack, or just use printfs. I used printfs, but I next time I can just debug on mac. |
Description: bombela/backward-cpp now has some support for backtraces on OS X. Bump backward-cpp to a revision that contains the change. Modify stack trace output on OS X since addr2line (via homebrew's binutils package) doesn't seem to be able to resolve addresses from the stack trace (or lldb for that matter). Instead, print as much information as possible directly in the stack trace (which is equivalent to lldb's output given bazelbuild/bazel#2537). Risk Level: Low Testing: Manually tested stack traces by forcing division by zero. Signed-off-by: Stephan Zuercher [email protected]
+1. This is a major pain point for me. Thanks to everyone who's working to fix it. |
+1. BTW, will this issue be fixed/upgrade officially or we have to take a hack described above to enable generate debugging symbols? |
rules_apple supports building dSYMs inside the linking action itself (like @haberman mentioned), although this means slowing down your critical path. If you ever build remotely you'll need dSYMs in order to debug unless your machine's paths matches the builders' paths exactly. If you don't use dSYMs you'll need to disable sandboxing for the linking step, e.g. setting |
Hi @hlopko , even with setting |
@wesleyw72 I'm afraid 'll need a repro case for that, it should work AFAIK. Pls include Bazel version and all Bazel options you pass (don't forget the .bazelrc). |
@hlopko I think the issue I was hitting is that the cache was being hit, so changing the |
Trying to understand exactly what the deficiency here is, because it seems the
will not produce a dsym (nor will dwarf debug info be preserved in the dylib itself) but
when built with bazel/tools/osx/crosstool/cc_toolchain_config.bzl Line 5710 in fa1740d
|
@nikhilm I am concern about the statically-linked binary case, not dylib. In my view, this bug is fixed when I can:
When I do this today, I get no debugging symbols available. |
dSYMs are the solution for both of those cases. A workaround on macOS could actually even be to build a |
Expands the targeted actions to allow stripping the absolute build path for debug symbols from all libraries. The support in wrapped_clang is indifferent to whether we are linking a true objc or regular cpp library. When used in concert with `--features=oso_prefix_is_pwd --remote_download_outputs=all`, allows successful local debugging of executables/libraries built remotely. Probably also helps with sandboxed actions. Helps mitigate #6327 and kinda sorta #2537? See also #11671 Closes #13311. PiperOrigin-RevId: 404262861
As of right now I can confirm that when you build using "bazel build -c dbg --spawn_strategy=local" on Apple M1 ("darwin"), after clean, you can not find debug symbols in the binary. |
Since my previous comment the dSYM logic also applies to cc_binary targets now, can you pass |
My bad. It does put the debug symbols in binary with the --spawn_strategy=local on Apple M1 Sillicon
And search the actual code in places like
This at least has the lowest guarantee on completion time which can be huge and has always improving learning curve. Although it can be much faster then try-balling from issues/SO for the particular complicated build which production bazel builds normally are. I don't really find that available documentation currently helps such issues much. |
I can see debug symbols (including line numbers) when building with Full command:
|
I meet thie problem in my archlinux too. |
On windows also facing same issue: (No debugging symbols found in bazel-bin/examples/application/application). Any solution to this? |
Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 1+ years. It will be closed in the next 90 days unless any other activity occurs or one of the following labels is added: "not stale", "awaiting-bazeler". Please reach out to the triage team ( |
Trying @bazelbuild/triage -- this is definitely still relevant and should be resolved. It is quite easy to reproduce. |
And as I suspected, I can't actually follow the steps described here: typing |
@bazelbuild/triage I remember someone from the team saying that secret teams can still be mentioned even if autocomplete doesn't work for them. |
Please provide the following information. The more we know about your system and use case, the more easily and likely we can help.
Description of the problem / feature request / question:
i build CPP with bazel on my mac, when i debug it
it came out:
If possible, provide a minimal example to reproduce the problem:
Environment info
Operating System:
mac 10.12.3
Bazel version (output of
bazel info release
):release 0.4.0-homebrew
If
bazel info release
returns "development version" or "(@non-git)", please tell us what source tree you compiled Bazel from; git commit hash is appreciated (git rev-parse HEAD
):Have you found anything relevant by searching the web? (e.g. GitHub issues, email threads in the [email protected] archive)
no
Anything else, information or logs or outputs that would be helpful?
(If they are large, please upload as attachment or provide link).
FYI:
on ubuntu, gdb work is fine, but lldb still can't find debugging symbols
The text was updated successfully, but these errors were encountered: