stepping inside a DLL

Discussion in 'C Programming' started by pinaki_m77@yahoo.com, Jul 30, 2005.

  1. Guest

    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.
     
    , Jul 30, 2005
    #1
    1. Advertising

  2. Flash Gordon Guest

    wrote:
    > 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.
    --
    Flash Gordon
    Living in interesting times.
    Although my email address says spam, it is real and I read it.
     
    Flash Gordon, Jul 30, 2005
    #2
    1. Advertising

  3. CBFalconer Guest

    Re: [OT] stepping inside a DLL

    wrote:
    >
    > 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.

    --
    "If you want to post a followup via groups.google.com, don't use
    the broken "Reply" link at the bottom of the article. Click on
    "show options" at the top of the article, then click on the
    "Reply" at the bottom of the article headers." - Keith Thompson
     
    CBFalconer, Jul 30, 2005
    #3
  4. Re: [OT] stepping inside a DLL

    On Sat, 30 Jul 2005 09:23:17 +0000, CBFalconer wrote:

    > wrote:
    >>
    >> 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.


    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
     
    Lawrence Kirby, Aug 1, 2005
    #4
  5. Re: [OT] stepping inside a DLL

    In article <>, CBFalconer <> writes:
    > wrote:
    > >
    > > 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.

    >
    > 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.

    --
    Michael Wojcik

    We are subdued to what we work in. (E M Forster)
     
    Michael Wojcik, Aug 1, 2005
    #5
  6. Re: [OT] stepping inside a DLL

    In article <>,
    Michael Wojcik <> wrote:
    ....
    >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".
     
    Kenny McCormack, Aug 1, 2005
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Stephen Noronha

    Stepping through Code in ASP.NET

    Stephen Noronha, Sep 13, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    409
    Hans Kesting
    Sep 14, 2005
  2. Steve Webb
    Replies:
    3
    Views:
    514
    winslave
    Apr 6, 2004
  3. John Black
    Replies:
    2
    Views:
    391
    Mike Wahler
    Jul 16, 2004
  4. Fernando Rodríguez

    Stepping through a multithreaded program

    Fernando Rodríguez, Sep 4, 2004, in forum: Python
    Replies:
    0
    Views:
    352
    Fernando Rodríguez
    Sep 4, 2004
  5. Replies:
    3
    Views:
    325
    adbarnet
    Jul 31, 2005
Loading...

Share This Page