Issues with dlv debug tiup

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: dlv debug tiup 的问题

| username: Raymond

Dear teachers, I would like to ask a question. Recently, I have been trying to study the source code of tiup. I compiled the tiup source code into a tiup file using go build. I used dlv exec ./tiup cluster list to debug tiup and set breakpoints. However, sometimes the breakpoints do not work. The error message indicates that the file does not exist, but the file does exist. What could be the reason for this error?

[tidb@mysql01 tiup-1.11.0]$ dlv exec ./tiup cluster list
Type 'help' for list of commands.
(dlv) b components/cluster/command/list.go:24
Command failed: location "components/cluster/command/list.go:24" not found
(dlv) q
[tidb@mysql01 tiup-1.11.0]$ ls components/cluster/command/list.go
components/cluster/command/list.go

However, sometimes the breakpoints do work.

| username: onlyacat | Original post link

tiup cluster is a component, remember to go to components or somewhere to compile an additional binary.

You can understand it as tiup bin specifically executing the cluster bin.

| username: Raymond | Original post link

Indeed, that’s the case. Thank you very much for your reply, really appreciate it.

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.