Discussion:
Debugging a C++ code which uses a .Net class
(too old to reply)
Ed
2010-01-21 22:29:31 UTC
Permalink
We have a VS 2005 C++ out-of-process automation server. It uses a a .Net
class using interop. It creates the .Net class (created in VS 2005)
early when the automation class is created by the client. It works
perfectly. The only problem is that we can debug it. After the
automation server exe starts, we attach to the process but not all the
symbols are loaded so we cannot set any breakpoint. When the process is
attached, we see these line and nothing else.

'server.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dll',
No symbols loaded.

'server.exe' (Managed): Loaded 'OUR .Net DLL PATH', Symbols loaded.

'server.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll',
No symbols loaded.

'server.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll',
No symbols loaded.

'server.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll',
No symbols loaded.


What can be done?

If we delay the creation of the .Net class so we can attach to the
automation process before the .Net class is created, then everything is
fine. We did this as a test and cannot leave this in the code.

Thanks
Willy Van den Driessche
2010-01-21 22:41:46 UTC
Permalink
Did you point yor debugger to the PDB files ?
Post by Ed
We have a VS 2005 C++ out-of-process automation server. It uses a a .Net
class using interop. It creates the .Net class (created in VS 2005) early
when the automation class is created by the client. It works perfectly.
The only problem is that we can debug it. After the automation server exe
starts, we attach to the process but not all the symbols are loaded so we
cannot set any breakpoint. When the process is attached, we see these line
and nothing else.
'server.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dll',
No symbols loaded.
'server.exe' (Managed): Loaded 'OUR .Net DLL PATH', Symbols loaded.
'server.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll',
No symbols loaded.
'server.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll',
No symbols loaded.
'server.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll',
No symbols loaded.
What can be done?
If we delay the creation of the .Net class so we can attach to the
automation process before the .Net class is created, then everything is
fine. We did this as a test and cannot leave this in the code.
Thanks
__________ Informatie van ESET NOD32 Antivirus, versie van database
viruskenmerken 4794 (20100121) __________
Het bericht is gecontroleerd door ESET NOD32 Antivirus.
http://www.eset.com
__________ Informatie van ESET NOD32 Antivirus, versie van database viruskenmerken 4794 (20100121) __________

Het bericht is gecontroleerd door ESET NOD32 Antivirus.

http://www.eset.com
Ed
2010-01-21 23:03:47 UTC
Permalink
Thanks for the reply.

What PDB files? The server.pdb and .Net PDB files are in the same folder
as the .Net DLL and server.exe. What other PDB files we have to point to
and how? By the way, we have been debugging this application for several
month without any trouble until we added the call to the .Net class a
few days ago.
Post by Willy Van den Driessche
Did you point yor debugger to the PDB files ?
Post by Ed
We have a VS 2005 C++ out-of-process automation server. It uses a a
.Net class using interop. It creates the .Net class (created in VS
2005) early when the automation class is created by the client. It
works perfectly. The only problem is that we can debug it. After the
automation server exe starts, we attach to the process but not all the
symbols are loaded so we cannot set any breakpoint. When the process
is attached, we see these line and nothing else.
'server.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dll',
No symbols loaded.
'server.exe' (Managed): Loaded 'OUR .Net DLL PATH', Symbols loaded.
'server.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll',
No symbols loaded.
'server.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll',
No symbols loaded.
'server.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll',
No symbols loaded.
What can be done?
If we delay the creation of the .Net class so we can attach to the
automation process before the .Net class is created, then everything
is fine. We did this as a test and cannot leave this in the code.
Thanks
__________ Informatie van ESET NOD32 Antivirus, versie van database
viruskenmerken 4794 (20100121) __________
Het bericht is gecontroleerd door ESET NOD32 Antivirus.
http://www.eset.com
__________ Informatie van ESET NOD32 Antivirus, versie van database
viruskenmerken 4794 (20100121) __________
Het bericht is gecontroleerd door ESET NOD32 Antivirus.
http://www.eset.com
Willy Van den Driessche
2010-01-21 23:16:42 UTC
Permalink
I thought you could not debug the server.
Apparently you can no longer debug the client, which, given the fact that
the PDB files are there is weird.

For the five cents left to me, you can point your Visual STudio to the
mcirosoft symbol servers so you can view calls in the .NET framework and the
Windows DLL. (VS 2008 does this automatically but VS2005 requires the
address, if I recall correctly http://msdl.microsoft.com/download/symbols )
Post by Ed
Thanks for the reply.
What PDB files? The server.pdb and .Net PDB files are in the same folder
as the .Net DLL and server.exe. What other PDB files we have to point to
and how? By the way, we have been debugging this application for several
month without any trouble until we added the call to the .Net class a few
days ago.
Post by Willy Van den Driessche
Did you point yor debugger to the PDB files ?
Post by Ed
We have a VS 2005 C++ out-of-process automation server. It uses a a .Net
class using interop. It creates the .Net class (created in VS 2005)
early when the automation class is created by the client. It works
perfectly. The only problem is that we can debug it. After the
automation server exe starts, we attach to the process but not all the
symbols are loaded so we cannot set any breakpoint. When the process is
attached, we see these line and nothing else.
'server.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dll',
No symbols loaded.
'server.exe' (Managed): Loaded 'OUR .Net DLL PATH', Symbols loaded.
'server.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll',
No symbols loaded.
'server.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll',
No symbols loaded.
'server.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll',
No symbols loaded.
What can be done?
If we delay the creation of the .Net class so we can attach to the
automation process before the .Net class is created, then everything is
fine. We did this as a test and cannot leave this in the code.
Thanks
__________ Informatie van ESET NOD32 Antivirus, versie van database
viruskenmerken 4794 (20100121) __________
Het bericht is gecontroleerd door ESET NOD32 Antivirus.
http://www.eset.com
__________ Informatie van ESET NOD32 Antivirus, versie van database
viruskenmerken 4794 (20100121) __________
Het bericht is gecontroleerd door ESET NOD32 Antivirus.
http://www.eset.com
__________ Informatie van ESET NOD32 Antivirus, versie van database
viruskenmerken 4794 (20100121) __________
Het bericht is gecontroleerd door ESET NOD32 Antivirus.
http://www.eset.com
__________ Informatie van ESET NOD32 Antivirus, versie van database viruskenmerken 4794 (20100121) __________

Het bericht is gecontroleerd door ESET NOD32 Antivirus.

http://www.eset.com
Ed
2010-01-22 02:17:21 UTC
Permalink
I am talking about the server. This is the one we could debug before the
addition of .Net class but cannot anymore. Clients are a few VB exe that
all work fine.
Post by Willy Van den Driessche
I thought you could not debug the server.
Apparently you can no longer debug the client, which, given the fact
that the PDB files are there is weird.
For the five cents left to me, you can point your Visual STudio to the
mcirosoft symbol servers so you can view calls in the .NET framework and
the Windows DLL. (VS 2008 does this automatically but VS2005 requires
the address, if I recall correctly
http://msdl.microsoft.com/download/symbols )
Post by Ed
Thanks for the reply.
What PDB files? The server.pdb and .Net PDB files are in the same
folder as the .Net DLL and server.exe. What other PDB files we have to
point to and how? By the way, we have been debugging this application
for several month without any trouble until we added the call to the
.Net class a few days ago.
Post by Willy Van den Driessche
Did you point yor debugger to the PDB files ?
Post by Ed
We have a VS 2005 C++ out-of-process automation server. It uses a a
.Net class using interop. It creates the .Net class (created in VS
2005) early when the automation class is created by the client. It
works perfectly. The only problem is that we can debug it. After the
automation server exe starts, we attach to the process but not all
the symbols are loaded so we cannot set any breakpoint. When the
process is attached, we see these line and nothing else.
'server.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dll',
No symbols loaded.
'server.exe' (Managed): Loaded 'OUR .Net DLL PATH', Symbols loaded.
'server.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll',
No symbols loaded.
'server.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll',
No symbols loaded.
'server.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll',
No symbols loaded.
What can be done?
If we delay the creation of the .Net class so we can attach to the
automation process before the .Net class is created, then everything
is fine. We did this as a test and cannot leave this in the code.
Thanks
__________ Informatie van ESET NOD32 Antivirus, versie van database
viruskenmerken 4794 (20100121) __________
Het bericht is gecontroleerd door ESET NOD32 Antivirus.
http://www.eset.com
__________ Informatie van ESET NOD32 Antivirus, versie van database
viruskenmerken 4794 (20100121) __________
Het bericht is gecontroleerd door ESET NOD32 Antivirus.
http://www.eset.com
__________ Informatie van ESET NOD32 Antivirus, versie van database
viruskenmerken 4794 (20100121) __________
Het bericht is gecontroleerd door ESET NOD32 Antivirus.
http://www.eset.com
__________ Informatie van ESET NOD32 Antivirus, versie van database
viruskenmerken 4794 (20100121) __________
Het bericht is gecontroleerd door ESET NOD32 Antivirus.
http://www.eset.com
Loading...