gdbserial/gdbserver: Dynamically resolve debugserver binary#1994
gdbserial/gdbserver: Dynamically resolve debugserver binary#1994derekparker merged 4 commits intogo-delve:masterfrom xyzst:master
Conversation
Instead of hardcoding the absolute path to the Command Line Tools (CLT) binary, will attempt to resolve the path at the $PATH, or at the Xcode bundle. If none are available, will fallback to the default CLT location. Fixes #986
|
I understand that unit tests are required before it's merged but I want to make sure I am on the right track before I am committed. If I am on the right track, what's the best approach for testing this type of change in go? My plan is to mock the fs by creating temporary files and directories at test runtime with the |
|
I think it would be better if this was done in LLDBLaunch and LLDBAttach rather than in a initializer. Also you should add a log line so that we can find out which program ends up being launched. |
|
@aarzilli thanks for reviewing my PR. Is this more of a style concern, or is there a behavioral difference when calling the helper function eagerly vs lazily? I am new to go, so I would appreciate an explanation or a pointer to related documentation. As for the logging, I will look into it after I finish up my daily work 😃 |
It's just going to add to the load time for delve, even if it doesn't get used at all. The test doesn't work because it doesn't have permission to go write in system folders, I don't think we need a test for this. |
|
@aarzilli thanks for the explanation. Entirely reasonable, will keep that in mind going forward. Will update the PR after work hours and remove the tests. |
Lazily obtain absolute path to avoid increasing load times. Remove flaky tests. Related to #986
…#1994) * gdbserial/gdbserver: Dynamically resolve debugserver binary Instead of hardcoding the absolute path to the Command Line Tools (CLT) binary, will attempt to resolve the path at the $PATH, or at the Xcode bundle. If none are available, will fallback to the default CLT location. Fixes go-delve#986 * gdbserial/gdbserver: Log outgoing executed commands Add logging to capture the executable and associated arguments used in LLDBLaunch and LLDBAttach Related to go-delve#986 * gdbserial/gdbserver: Add unit tests for helper function Define unit tests for helper function. Setup each test to temporarily make PATH variable, and file system changes, and subsequently revert them. Related to go-delve#986 * gdbserial/gdbserver: Lazily load function Lazily obtain absolute path to avoid increasing load times. Remove flaky tests. Related to go-delve#986
…#1994) * gdbserial/gdbserver: Dynamically resolve debugserver binary Instead of hardcoding the absolute path to the Command Line Tools (CLT) binary, will attempt to resolve the path at the $PATH, or at the Xcode bundle. If none are available, will fallback to the default CLT location. Fixes go-delve#986 * gdbserial/gdbserver: Log outgoing executed commands Add logging to capture the executable and associated arguments used in LLDBLaunch and LLDBAttach Related to go-delve#986 * gdbserial/gdbserver: Add unit tests for helper function Define unit tests for helper function. Setup each test to temporarily make PATH variable, and file system changes, and subsequently revert them. Related to go-delve#986 * gdbserial/gdbserver: Lazily load function Lazily obtain absolute path to avoid increasing load times. Remove flaky tests. Related to go-delve#986
Instead of hardcoding the absolute path to the Command Line
Tools (CLT) binary, will attempt to resolve the path at the
$PATH, or at the Xcode bundle. If none are available, will
fallback to the default CLT location.
Fixes #986