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

Unable call optimized functions #1589

Closed
dlsniper opened this issue Jun 26, 2019 · 3 comments
Closed

Unable call optimized functions #1589

dlsniper opened this issue Jun 26, 2019 · 3 comments

Comments

@dlsniper
Copy link
Contributor

dlsniper commented Jun 26, 2019

For this issue, I'm using the following repository: https://github.com/dlsniper/debugging/tree/0cf1692cb8518c1ec982c72d71064ffba1d0ed1c
My apologies for not being able to further narrow it down.

  1. What version of Delve are you using (dlv version)?
    local:
    remote:

  2. What version of Go are you using? (go version)?
    Go 1.12.6

  3. What operating system and processor architecture are you using?
    Alpine 3.10 and Debian Stretch

  4. What did you do?

  • run the container
  • connect a delve instance to it
  • run the following commands:
b main.go:55
c
  • make an http request on curl http://127.0.0.1:8080/fact
  • when the debugger stops, run the following command call strconv.ParseInt("123", 10, 64)
  1. What did you expect to see?
    I expected to see the result of the function call.

  2. What did you see instead?
    The following error message;

could not get argument location of i: could not find loclist entry at 0x[...] for address 0x[...]

As this happens with both Alpine and Debian containers, I believe it's not an OS problem.
Also, this works when running from the Windows host (in my case I'm running Windows 10).

@aarzilli
Copy link
Member

How did you compile the program that you are debugging? This is probably because the strconv package is optimized.

@dlsniper
Copy link
Contributor Author

You are right, I forgot to add the `-gcflags="all=-N -l". Sorry for being silly. Should we keep this open still for the optimized part?

@aarzilli aarzilli changed the title Unable to run function call in remote environment Unable call optimized functions Jun 26, 2019
@aarzilli
Copy link
Member

yes.

aarzilli added a commit to aarzilli/delve that referenced this issue Sep 7, 2019
Trust argument order to determine argument frame layout when calling
functions, this allows calling optimized functions and removes the
special cases for runtime.mallocgc.

Fixes go-delve#1589
cgxxv pushed a commit to cgxxv/delve that referenced this issue Mar 25, 2022
Trust argument order to determine argument frame layout when calling
functions, this allows calling optimized functions and removes the
special cases for runtime.mallocgc.

Fixes go-delve#1589
abner-chenc pushed a commit to loongson/delve that referenced this issue Mar 1, 2024
Trust argument order to determine argument frame layout when calling
functions, this allows calling optimized functions and removes the
special cases for runtime.mallocgc.

Fixes go-delve#1589
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants