stepping inside a DLL

P

pinaki_m77

Hi, I am trying to debug a C++ program using Microsoft VC++ IDE. The
program loads a dynamic link library (dll) and later makes calls to
functions inside this dll. I want to step inside the code of this dll.
Is that possible to do? Because currently what is happening is, even if
I try to step inside the function in the dll (by F11 key), it is
stepping over the whole function (like F10 does).

How can I step inside the dll code? Am I doing something incorrectly
now? Please help.

Thank you.
 
F

Flash Gordon

Hi, I am trying to debug a C++ program using Microsoft VC++ IDE.

So why are you posting on a C group? C++ is a different language.
> The
program loads a dynamic link library (dll) and later makes calls to
functions inside this dll. I want to step inside the code of this dll.

<snip>

All this is implementation specific so would not be topical in
comp.lang.c++ (as I understand it) either. So either RTFM or go find a
group with microsoft or vc in the name.
 
C

CBFalconer

Hi, I am trying to debug a C++ program using Microsoft VC++ IDE.
The program loads a dynamic link library (dll) and later makes
calls to functions inside this dll. I want to step inside the
code of this dll. Is that possible to do? Because currently what
is happening is, even if I try to step inside the function in
the dll (by F11 key), it is stepping over the whole function
(like F10 does).

How can I step inside the dll code? Am I doing something
incorrectly now? Please help.

This has nothing to do with the C language, and is thus off-topic.
You want a newsgroup with "microsoft" in its name.

However a little elementary thought will show you why you can't do
this. dlls are shared dynamically linked libraries. More than one
process may be using it at once. Stepping through its code usually
requires altering that code to a trapping opcode. Any such
alteration will affect other users of the library. So it is not
allowed.
 
L

Lawrence Kirby

This has nothing to do with the C language, and is thus off-topic.
You want a newsgroup with "microsoft" in its name.

However a little elementary thought will show you why you can't do
this. dlls are shared dynamically linked libraries. More than one
process may be using it at once.

That is also true for non-DLL code.
Stepping through its code usually
requires altering that code to a trapping opcode. Any such
alteration will affect other users of the library. So it is not
allowed.

This could be implemented the same way for DLLs as for non-DLL code.
Copy-on-write is a common technique for this sort of thing.

There probably are characteristics of DLLs which would make this harder to
do, perhaps a lack of debugging information. I doubt whether code sharing
is a problem though.

Lawrence
 
M

Michael Wojcik

This has nothing to do with the C language, and is thus off-topic.
You want a newsgroup with "microsoft" in its name.
Indeed.

However a little elementary thought will show you why you can't do
this.

And a little research would show you that you can.
dlls are shared dynamically linked libraries. More than one
process may be using it at once. Stepping through its code usually
requires altering that code to a trapping opcode. Any such
alteration will affect other users of the library. So it is not
allowed.

This is a splendid example of why answering off-topic questions is
a bad idea. It is entirely possible to set breakpoints in shared
code in many modern OSes, including Windows. I don't know offhand
how this is implemented (though copy-on-write is a plausible
candidate), but code sharing is rarely an issue for debugging these
days. The only recent OS I've used where code sharing prevented
setting breakpoints was HP-UX, and that was only for some objects
and only under some circumstances, and there were work-arounds.
 
K

Kenny McCormack

Michael Wojcik said:
a bad idea. It is entirely possible to set breakpoints in shared
code in many modern OSes, including Windows.

ITYM, "many modern OSes and also Windows".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,169
Messages
2,570,915
Members
47,456
Latest member
JavierWalp

Latest Threads

Top