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

Fix debug mode can't load dylib from work dir #78

Closed
wants to merge 1 commit into from

Conversation

daviyang35
Copy link

修复 macOS 使用 GoLand 调试模式启动时,无法从工作目录加载动态库
原因是 GoLand 调试启动,会把 可执行文件创建到临时文件夹

/private/var/folders/vc/5md5ch3s71513qk2dcn968_80000gn/T/___1go_build_gui

返回绝对路径前判断文件是否存在,如不存在,则返回 lib名字,后续 dlopen 时,会从当前工作目录搜索加载
此时只要配置好调试配置的工作目录,即可正确加载调试

修复 macOS 使用 GoLand 调试模式启动时,无法从工作目录加载动态库
原因是 GoLand 调试启动,会把 可执行文件创建到临时文件夹

```text
/private/var/folders/vc/5md5ch3s71513qk2dcn968_80000gn/T/___1go_build_gui
```

返回绝对路径前判断文件是否存在,如不存在,则返回 lib名字,后续 dlopen 时,会从当前工作目录搜索加载
此时只要配置好调试配置的工作目录,即可正确加载调试
@daviyang35 daviyang35 closed this Apr 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant