简体   繁体   中英

C# and MASM dll library how to debug?

Description

I have a bit of a problem with my project, that being said - I cannot debug the dll (written in MASM) loaded to a program written in C#. I do leave breakpoints in various places of the procedure in dll but nothing happens. Program execution just goes through the procedure without stopping.

I use Visual Studio 2010 and have the following structure of the solution:

Solution
|
+--+ the masm dll project
|  |
|  +- *.asm 
|  |
|  +- *.def
|
+--+ C# dll library poject 
|  
+--+ my C# project

Therefore I have access to the source code of the dll, and its project is within the same solution as invoking project.

However when I set the breakpoint within the C# library project it works.

And still I cannot debug this bugger. Can anyone point me towards the solution of the problem?

Solution

Given by Camford

All you have to do in order to be able to debug unmanaged dll ( not only masm, nasm, etc. ) is to enable unamanged code debugging, that is done (in VS2010) by:

To enable debugging of unmanaged code

  1. With a project selected in Solution Explorer, on the Project menu, click Properties.
  2. Click the Debug tab.
  3. Select the Enable unmanaged code debugging check box.

(from here )

You need to enable unmanaged code debugging in your c# project's Debug setting. If that still doesn't work, since you have the asm code, you can insert int 3 in your asm as a hardcoded break instruction, and rebuild your dll.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM