473,804 Members | 4,153 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Debugging an unmanaged DLL

I have a managed .Net assembly (C#) that invokes code in an unmanaged DLL
written in C++ 6 via an unsafe assembly that invokes the C++ routines and
marshals the data. The interface is not working properly.

Is there a way to have the C++ 6 debugger running on the unmanaged DLL when
it is invoked from the .Net debugger? I cannot step into the DLL, but can I
access it via a separate debugger?

Or am I left with instrumentation as the only debugging tool?

-Ken
Nov 16 '05 #1
2 1802
If I remember correctly, with VS.NET you should be able to step into the
unmanaged code from the .NET code if you set "Native" as well as the managed
setting.

--
----------------------------------
Sam Gentile
MVP - C#/.NET
INETA Speaker http://www.ineta.org/DesktopDefault.aspx
Read my blog at http://samgentile.com/blog/
------------------------------------------------------
"Ken Allen" <ke******@sympa tico.ca> wrote in message
news:%2******** ********@TK2MSF TNGP11.phx.gbl. ..
I have a managed .Net assembly (C#) that invokes code in an unmanaged DLL
written in C++ 6 via an unsafe assembly that invokes the C++ routines and
marshals the data. The interface is not working properly.

Is there a way to have the C++ 6 debugger running on the unmanaged DLL when it is invoked from the .Net debugger? I cannot step into the DLL, but can I access it via a separate debugger?

Or am I left with instrumentation as the only debugging tool?

-Ken

Nov 16 '05 #2
If this works at all, I am certain that it only works with unmanaged DLLs
developed with .Net studio!

In my case the DLL is still being compiled with Developer Studio 6 while I
am doing new development in .Net, and it does not seem to permit me to cross
the DLL boundary in the debugger.

-Ken

"Sam Gentile [MVP - C#/.NET]" <no****@nomail. com> wrote in message
news:u7******** ******@TK2MSFTN GP12.phx.gbl...
If I remember correctly, with VS.NET you should be able to step into the
unmanaged code from the .NET code if you set "Native" as well as the managed setting.

--
----------------------------------
Sam Gentile
MVP - C#/.NET
INETA Speaker http://www.ineta.org/DesktopDefault.aspx
Read my blog at http://samgentile.com/blog/
------------------------------------------------------
"Ken Allen" <ke******@sympa tico.ca> wrote in message
news:%2******** ********@TK2MSF TNGP11.phx.gbl. ..
I have a managed .Net assembly (C#) that invokes code in an unmanaged DLL written in C++ 6 via an unsafe assembly that invokes the C++ routines and marshals the data. The interface is not working properly.

Is there a way to have the C++ 6 debugger running on the unmanaged DLL when
it is invoked from the .Net debugger? I cannot step into the DLL, but

can I
access it via a separate debugger?

Or am I left with instrumentation as the only debugging tool?

-Ken


Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1508
by: Lee Crabtree | last post by:
I have a managed C++ DLL wrapping some unmanaged C++ code. I'm using this DLL in a C# program, and I need to watch some of the buffers being used. When I try to use the memory debugger window in Studio, the pointers are all pointed to 0x0000, and that space is filled with question marks, instead of the more common hex. I'm assuming there's something I'm missing here, but I cannot for the life of me figure out what it is. Any ideas?
3
3154
by: Mark Jerde | last post by:
I googled and found a half-dozen good threads on debugging C# / VCPP on a machine with both tools installed. But my co-worker and I haven't figured out how she can debug her C++ code on her computer when her DLL is called from my C# GUI .exe program. I have the full MSDN Universal toolset, but she just has VCPP 2003 Standard. (This is probably very easy and well documented somewhere in MSDN... ;-) But neither of us is very expert yet...
2
4121
by: jpuopolo | last post by:
All: I have developed an ActiveX control using unmanaged C++ (MFC). I have also developed a C# application to server as a test harness. Both ActiveX and test harness application are built in Debug mode. The VS.NET (2005) project is configured for native debugging. In the debugger, when I try to "step into" the ActiveX method, the debugger executes the code but does not enable me to "step into" - it behaves just like a "step over."
0
1472
by: Sericinus hunter | last post by:
This post is mostly for picking up by Google and information purposes. The problem itself is solved for me. Generally, debugging .Net COM dll should not pose any problems, but you will be experiencing difficulties when debugging with VS2003 while there is .Net 2.0 installed. .Net 2.0 execution engine (mscoree.dll) will not allow VS2003 debbuger through, and problems which occur in this scenario may range from IDE crash to "unable to...
3
11502
by: dvestal | last post by:
Sorry if this double-posts, google just crashed on me. I'm trying to debug an unmanaged C++ DLL from a C# application. The C# app references the DLL using DLLImport attributes. They are in the same solution. Here's what I've done so far: 1) Enabled unmanaged debugging in the C# application's property pages. 2) Set the DLL's output folder to the same location as the C# app's output folder. 3) Enabled debug info in the C++ DLL, and...
5
1961
by: Howard Swope | last post by:
I have a series of third party libraries for which we have licensed the source code. These are unmanaged libraries written in C++ which I am able to build without any trouble. I am trying to setup my environment so that I can step into their code form my managed .dll written in managed C++ (.Net 1.1). I just can't seem to get my code to step into their source file. What Am I missing? What files are required to make this happen? Is there a...
2
4029
by: Ed | last post by:
Hello, dear all, I have a solution that contain the managed project and unmanaged project source code, and managed project will use the unmanaged project as a library. The debugging in the managed code is fine. But when the instruction run into unmanaged function, it can not step into the unmanaged code. Is this a fault of the VS2005?
3
2426
by: Pixel.to.life | last post by:
All, A question on JIT debugging with VS2005. I have a managed app that builds great on one machine (Vista Home basic, VS2005, JIT enabled for managed/unmanaged code). I can also debug it on this machine with breakpoints and all.
1
2439
by: Ole | last post by:
I have added a C++ dll to my solution where my main program (C#) is calling the dll using DllImports but I got the message ""The breakpoint will not currently be hit" when trying to debug my dll code - what should I do to debug the dll? Thanks Ole
0
9707
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10586
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10338
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10082
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9161
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5525
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5658
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3823
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2997
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.