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

no debugging symbols found on mac #2573

Closed
is03wlei opened this issue Feb 23, 2017 · 7 comments
Closed

no debugging symbols found on mac #2573

is03wlei opened this issue Feb 23, 2017 · 7 comments
Assignees
Labels
P3 We're not considering working on this, but happy to review a PR. (No assignee) platform: other type: bug

Comments

@is03wlei
Copy link
Contributor

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:

#ggdb main
GNU gdb (GDB) 7.9.1
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin15.3.0".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/.
Find the GDB manual and other documentation resources online at:
http://www.gnu.org/software/gdb/documentation/.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from main...(no debugging symbols found)...done.

If possible, provide a minimal example to reproduce the problem:

###BUILD
cc_binary(
name = "main",
srcs = glob([".cpp", ".h", "*.hpp"]),
copts = [
"-c",
"-w",
"-fPIC",
],
visibility = ["//visibility:public"],
)

bazel build --copt="-g" source:all
I also tried to add -g to copts in BUILD. But it didn't work either.

Environment info

  • Operating System:
    OS X EI Capitan
    version 10.11.6

  • Bazel version (output of bazel info release):
    [bazel release 0.4.4]

  • 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 bazel-discuss@googlegroups.com archive)

#2537

Anything else, information or logs or outputs that would be helpful?

(If they are large, please upload as attachment or provide link).

@is03wlei is03wlei changed the title no debugging symbols found no debugging symbols found on mac Feb 23, 2017
@iirina
Copy link
Contributor

iirina commented Feb 23, 2017

What is the output of bazel build --copt="-g" source:all?

@is03wlei
Copy link
Contributor Author

Previously, it reported as following:
WARNING: Stripping enabled, but '--copt=-g' (or --per_file_copt=...@-g) specified. Debug information will be generated and then stripped away. This is probably not what you want! Use '-c dbg' for debug mode, or use '--strip=never' to disable stripping.

Then I tried both "bazel build -c dbg source:all" and "bazel build --strip=never --copt="-g" source:all", but it didn't work either.

@unship
Copy link

unship commented Feb 24, 2017

as #2537

bazel do generate dSYM file but it ls empty, #2537 (comment) hava a init sollution

and
bazel do not generate debug info for lldb for mac and linux

@hlopko
Copy link
Member

hlopko commented Feb 24, 2017

Just to be sure it is #2537, the correct command to build target with debugging symbols is bazel build -c dbg source:all, is it still broken for you?

@iirina iirina added platform: other category: rules > C++ P3 We're not considering working on this, but happy to review a PR. (No assignee) type: bug and removed under investigation labels Feb 24, 2017
@iirina
Copy link
Contributor

iirina commented Feb 24, 2017

@is03wlei Can you please also paste the output of the other command you mentioned?

@mhlopko Can you take a look at this? Thanks!

@is03wlei
Copy link
Contributor Author

build -c dbg source:all
.................
INFO: Found 2 targets...
INFO: From Compiling xxx.cpp:

...bunch of warnings...

74 warnings generated.
INFO: Elapsed time: 17.249s, Critical Path: 6.37s

bazel build --strip=never --copt="-g" source:all
INFO: Found 2 targets...
INFO: From Compiling xx.cpp:

...bouch of warning...

21 warnings generated.
INFO: Elapsed time: 6.128s, Critical Path: 5.67s

@hlopko
Copy link
Member

hlopko commented Mar 10, 2017

Let me close this one as it is a duplicate of #2537, let's continue the discussion there

@hlopko hlopko closed this as completed Mar 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 We're not considering working on this, but happy to review a PR. (No assignee) platform: other type: bug
Projects
None yet
Development

No branches or pull requests

4 participants