duanlisha2335 2017-08-24 08:26
浏览 116

Golang深入探讨,如何启动调试器并启动正在调试的应用程序?

I am trying to setup a headless delve debugger that I can attach to remotely.

I am unable to find a way to launch a debugging server that doesn't pause the application I am debugging.

I have been using dlv attach --headless=true --listen=:2345 attach 32 but this pauses the process.
Alternatively I could use dlv --headless=true --listen=:2345 exec app if this allowed the app binary to run.

I don't know if the init file can do something like this? I cannot find any documentation on what that actually is.

  • 写回答

1条回答 默认 最新

  • dtest84004 2017-09-20 21:11
    关注

    If you consider delve issue 145, that might be a feature, not a bug:

    I can't see the value of starting an actual debug session without pausing unless you're simply relying on providing an init file (to load breakpoints / tracepoints) and then want to immediately continue execution, which you could do by writing a continue command at the end of the init file.

    You can already set tracepoints without stopping the program indefinitely with the trace subcommand, which takes a pid flag.


    That being said, with Delve 1.3.0 (August 2019, 2 years later):

    go-delve/delve issue 245 is resolved by PR 1585

    cmd/dlv: add --continue to continue process on launch/attach

    Add --continue option for attach, debug, exec, and trace, to issue a continue on start.

    The main use case for this feature would be to start a headless delve server (for example within a container)

    评论

报告相同问题?

悬赏问题

  • ¥15 python的qt5界面
  • ¥15 无线电能传输系统MATLAB仿真问题
  • ¥50 如何用脚本实现输入法的热键设置
  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100