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

xmake-vscode问题 #276

Open
fengjinfuyl opened this issue Sep 29, 2024 · 7 comments
Open

xmake-vscode问题 #276

fengjinfuyl opened this issue Sep 29, 2024 · 7 comments
Labels

Comments

@fengjinfuyl
Copy link
Contributor

Xmake 版本

2.9.5

操作系统版本和架构

版本 Windows 10 专业版 版本号 22H2 安装日期 ‎2024/‎3/‎28 操作系统内部版本 19045.4894 体验 Windows Feature Experience Pack 1000.19060.1000.0

描述问题

需求:
一、项目的输出是一个dll,启动某exe时会自动加载此dll并命中加载事件。
目前问题:
一、如我将类型设为启动,则提示无法启动dll,无法调试。
输入图片说明
二、如我将配置类型设为附加,弹出选择进程界面后,点击或者手选进程,也无法成功,弹出下述提示。
输入图片说明
假定第二个问题可以解决,其实也不完全符合需要。如采用附加形式,则必须先启动主exe,启动时已执行加载事件。总之以附加形式来调试dll插件,不能命中加载事件的断点。
分析:
xmake-vscode插件对于启动的定义略窄,只理解为启动项目的生成exe。也应考虑到,会启动其他exe,其他exe调用此dll的场景。
参考:
如项目使用CMake来配置并生成,可这样来启动别的exe,并顺利在加载事件命中断点。
输入图片说明
环境:
vscode版本:1.93.1
xmake-vscode插件版本:2.3.7
操作系统:win10

期待的结果

可以以启动的方式,启动指定路径的exe,此exe如会加载项目生成的dll时,能命中断点。

工程配置

无需

附加信息和错误日志

见问题描述

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Title: xmake-vscode problem

Xmake version

2.9.5

Operating system version and architecture

Version Windows 10 Pro Build Number 22H2 Installation Date ‎2024/‎3/‎28 OS Build 19045.4894 Experience Windows Feature Experience Pack 1000.19060.1000.0

Describe the problem

need:

  1. The output of the project is a dll. When starting an exe, this dll will be automatically loaded and the loading event will be hit.
    Current issues:
  2. If I set the type to startup, it prompts that the dll cannot be started and cannot be debugged.
    Enter picture description
  3. If I set the configuration type to additional and the process selection interface pops up, even if I click or manually select the process, it will not succeed and the following prompt will pop up.
    Enter picture description
    Assuming that the second problem can be solved, it is not entirely in line with the needs. If the additional form is used, the main exe must be started first, and the loading event has been executed during startup. In short, when debugging the dll plug-in in additional form, the breakpoint of the loading event cannot be hit.
    analyze:
    The xmake-vscode plug-in has a slightly narrower definition of startup, and only understands it as the generated exe to start the project. It should also be considered that other exes will be started and other exes will call this dll.
    refer to:
    If the project is configured and generated using CMake, you can start other exe in this way and successfully hit the breakpoint in the loading event.
    Enter picture description
    environment:
    vscode version:1.93.1
    xmake-vscode plug-in version: 2.3.7
    Operating system: win10

Expected results

You can start the exe with the specified path in the startup mode. If the exe loads the dll generated by the project, it can hit the breakpoint.

Project configuration

No need

Additional information and error logs

See problem description

@waruqi waruqi transferred this issue from xmake-io/xmake Sep 30, 2024
@waruqi
Copy link
Member

waruqi commented Sep 30, 2024

你不需要设置任何 launch.json 。。都是自动的,插件内部会自动生成 launch.json ,自动调用。。

点底下工具栏的 运行和调试按钮,不要点侧边栏的。

@fengjinfuyl
Copy link
Contributor Author

fengjinfuyl commented Sep 30, 2024 via email

@waruqi
Copy link
Member

waruqi commented Sep 30, 2024

动态库调试,目前不支持。

@fengjinfuyl
Copy link
Contributor Author

fengjinfuyl commented Sep 30, 2024 via email

@fengjinfuyl
Copy link
Contributor Author

fengjinfuyl commented Dec 10, 2024 via email

@waruqi
Copy link
Member

waruqi commented Dec 10, 2024

最近没空 太忙了,你可以尝试自己提个 pr 过来

fengjinfuyl pushed a commit to fengjinfuyl/xmake-vscode that referenced this issue Dec 20, 2024
Detail:使Target字段可以输入完整的外部exe路径,此时调试时会启动此exe,此exe加载dll时,已验证可调试。
fengjinfuyl pushed a commit to fengjinfuyl/xmake-vscode that referenced this issue Dec 20, 2024
Detail:if target is a program full path,pass it.
so with the user debug configuration as follows, user can debug dll which
the target exe load.
{
    "version": "0.2.0",
    "configurations": [

        {
            "type": "xmake",
            "request": "launch",
            "name": "launch exe to debug dll",
            "target": "D:\\xxx.exe",
            "cwd": "${workspaceFolder}",
            "stopAtEntry": false,
        }
    ]
}
waruqi pushed a commit that referenced this issue Dec 20, 2024
Detail:if target is a program full path,pass it.
so with the user debug configuration as follows, user can debug dll which
the target exe load.
{
    "version": "0.2.0",
    "configurations": [

        {
            "type": "xmake",
            "request": "launch",
            "name": "launch exe to debug dll",
            "target": "D:\\xxx.exe",
            "cwd": "${workspaceFolder}",
            "stopAtEntry": false,
        }
    ]
}

Co-authored-by: 冯金福 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants