3F / DllExport

.NET DllExport with .NET Core support (aka 3F/DllExport aka DllExport.bat)
MIT License
937 stars 131 forks source link

How to debug on x86 #216

Open Chussya opened 1 year ago

Chussya commented 1 year ago

Hi, I have an application which works on x86 only, and I want to ask about debug. When I was installing DllExport, I choose all options from your guid on README, but when I started my project it not work. Application know about my generated dll, but didn't start. BUT, when I chose x86 (instead of auto or x86+x64), application can sees mine dll. But when I put a breakpoint, when I run the extension dll, I see that I can't debug. The IDE just writes that there are no symbols loaded, or something like that. I have already used your extension, but for .NET 4.5.2 Framework. Now I have use 4.7.2 and I don't understand why I cannot debug. Could you give me more info about options? I read about similar problem on https://stackoverflow.com/questions/71195687/how-to-debug-a-project-using-unmanaged-exports-nuget-package but: 1: I've already used Any CPU and didn't help. 2: When I chose x86+x64 my breakpoints are alive, but dll extension didn't start. When I chose x86, dll can start, but cannot debug. Code are similar between 4.5.2 and 4.7.2, it's 100%, so it's not code problem. Maybe with my application outdated for this lib?

3F commented 1 year ago

Hello,

Please follow the steps requested in the issue template. Nobody knows which configuration is used in your case.

Also note the .line feature yet controlled by https://github.com/3F/coreclr/issues/3 in this way you can join to #23 conversation if you use my modified version of il assembler.

> Now I have use 4.7.2

But everything is easier if your project is based on netfx as it was mentioned; Then you just have to choose the MS original assembler where still generating a workable pdb.

You may also need to apply some patches for that original assembler by clicking the related things in the window. Just follow your needs in the setup wizard.

On 25.11.2022 0:14, Yaromir wrote:

Hi, I have an application which works on x86 only, and I want to ask about debug. When I was installing DllExport, I choose all options from your guid on README, but when I started my project it not work. Application know about my generated dll, but didn't start. BUT, when I chose x86 (instead of auto or x86+x64), application can sees mine dll. But when I put a breakpoint, when I run the extension dll, I see that I can't debug. The IDE just writes that there are no symbols loaded, or something like that. I have already used your extension, but for .NET 4.5.2 Framework. Now I have use 4.7.2 and I don't understand why I cannot debug. Could you give me more info about options? I read about similar problem on https://stackoverflow.com/questions/71195687/how-to-debug-a-project-using-unmanaged-exports-nuget-package

but: 1: I've already used Any CPU and didn't help. 2: When I chose x86+x64 my breakpoints are alive, but dll extension didn't start. When I chose x86, dll can start, but cannot debug. Code are similar between 4.5.2 and 4.7.2, it's 100%, so it's not code problem. Maybe with my application outdated for this lib? Message ID: ***@***.***>
3F commented 1 year ago

Also make sure .pdb is located near final modified assembly (not original). This should be $(TargetDir)/x86 and $(TargetDir)/x64 for x86+x64 option.