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
cmd/link: debugging fails with -linkmode external on macOS #20568
Comments
Interestingly, it works with Delve in both cases. |
If it really was a regression on #8973 lldb would complain differently. One possibility is that debug_info is mangled somehow, that would explain why delve appears to work (delve is probably reading the entry point from gosymtab, which lldb doesn't know about and an external linker wouldn't mangle). If I'm correct I wouldn't trust delve with this binary, it's probably going to fail in other ways. IIRC things changed with regards to DWARF linking on macOS in go1.9, this could be already fixed. |
Sadly, reproduced with tip. |
I get a different error on tip:
however the binary has debug_info, debug_frame and debug_line and at a glance they all seem correct, I'm not sure what's lldb's problem here. |
For the record, I compiled lldb from master with
brew install llvm --with-lldb --HEAD
|
Alright, lldb compiled from HEAD behaves like you say:
and setting
So it's resolving the expression main.main to 0x00000000040500d0 which is (mostly) correct but then tries to set the breakpoint at 0xffffffffffffffff instead, for some reason. It looks like LLDB's bug. |
Okay, closing this since it looks like an LLDB bug. Let us know if that's wrong. |
For the record, I'm still getting this issue on LLDB shipped with Xcode 9:
It works correctly with |
I have some more information about this. In short, it seems the Also, I tried as far back as go 1.5 and could not get it to work. I do believe this never worked. I made a small test program, linked like this:
Some data:
The
The
|
|
I'm attaching both binaries in case people want to check. package main
func sayCoucou(name string) string {
return "coucou " + name
}
func main() {
println(sayCoucou("seutive"))
} |
Happened across this bug. It looks to me like it's still an issue, even with Go 1.10. Reopening. |
lldb HEAD works with linkmode internal on macOS Sierra:
But fails with linkmode external:
This appears to be a regression to #8973
The text was updated successfully, but these errors were encountered: