Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results

More Info on Driver Writing and Debugging


The free OSR Learning Library has more than 50 articles on a wide variety of topics about writing and debugging device drivers and Minifilters. From introductory level to advanced. All the articles have been recently reviewed and updated, and are written using the clear and definitive style you've come to expect from OSR over the years.


Check out The OSR Learning Library at: https://www.osr.com/osr-learning-library/


Before Posting...

Please check out the Community Guidelines in the Announcements and Administration Category.

How to debug using WinDbg??

OSR_Community_UserOSR_Community_User Member Posts: 110,217
Hello,

I am new to WinDbg. And I am facing some problem in debuging my driver on NT
system using WinDbg.

1. Created a driver, installed it on target system with demand start.

2. Enabled debugging on target system by modifying boot.ini.

3. Checked the COM port connection with HyperTerminal.

4. Installed symbol files on host computers. Also set proper enviornments.

5. Now, I launched WinDbg, Ctrl+K, gave path to symbol file, image file and
source code.

Here, I am stuck. I really want to take over the control when target comes to
DriverEntry. I am starting my driver from Device applet at target computer.
What should I do now?Hello,

I am new to WinDbg. And I am facing some problem in debuging my driver on NT
system using WinDbg.

1. Created a driver, installed it on target system with demand start.

2. Enabled debugging on target system by modifying boot.ini.

3. Checked the COM port connection with HyperTerminal.

4. Installed symbol files on host computers. Also set proper enviornments.

5. Now, I launched WinDbg, Ctrl+K, gave path to symbol file, image file and
source code.

Here, I am stuck. I really want the control to come at DriverEntry when I
start my driver from Device applet at target computer.

Do I need to install WinDbg on target system also or what?

Or is there any command, which will invoke driver on target machine from host?

Please advice..

Thanks,
Giri

------------------------------------------------------------
This e-mail has been sent to you courtesy of OperaMail, as a free service from
Opera Software, makers of the award-winning Web Browser, Opera. Visit us at
http://www.opera.com/ or our portal at: http://www.myopera.com/ Your free e-mail
account is waiting at: http://www.operamail.com/
------------------------------------------------------------


---
You are currently subscribed to windbg as: $subst('Recip.EmailAddr')
To unsubscribe send a blank email to leave-windbg-$subst('Recip.MemberIDChar')@lists.osr.com

Comments

  • OSR_Community_User-174OSR_Community_User-174 Member Posts: 60
    For starters, ensure you can talk to the target system: Do control-break in
    the command window. You should interrupt the target. If that happens, hit
    F5 to let the system proceed as usual.

    With connectivity established, I would add this to DriverEntry (thanks to
    Mark Roddy's suggestion):

    _try
    {
    DbgBreakPoint();
    }
    _except(EXCEPTION_EXECUTE_HANDLER)
    {
    }

    This will cause a debug breakpoint, and if your debugger is attached, you
    should get control. In fact, if your symbols and other paths are correct,
    you'll be stopped in the source window.


    James Antognini
    IBM Research

    Internet address -- [email protected]
    Notes address -- James Antognini/Watson/[email protected]

    Phone -- external: 914-784-7258; tieline: 863-7258


    ---
    You are currently subscribed to windbg as: $subst('Recip.EmailAddr')
    To unsubscribe send a blank email to leave-windbg-$subst('Recip.MemberIDChar')@lists.osr.com
  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    Or even simpler, insert KdBreakPoint() somewhere in DriverEntry.

    -----Original Message-----
    From: James Antognini [mailto:[email protected]]
    Sent: Monday, April 30, 2001 11:35 PM
    To: Kernel Debugging Interest List
    Subject: [windbg] Re: How to debug using WinDbg??



    For starters, ensure you can talk to the target system: Do control-break in
    the command window. You should interrupt the target. If that happens, hit
    F5 to let the system proceed as usual.

    With connectivity established, I would add this to DriverEntry (thanks to
    Mark Roddy's suggestion):

    _try
    {
    DbgBreakPoint();
    }
    _except(EXCEPTION_EXECUTE_HANDLER)
    {
    }

    This will cause a debug breakpoint, and if your debugger is attached, you
    should get control. In fact, if your symbols and other paths are correct,
    you'll be stopped in the source window.


    James Antognini
    IBM Research

    Internet address -- [email protected]
    Notes address -- James Antognini/Watson/[email protected]

    Phone -- external: 914-784-7258; tieline: 863-7258


    ---
    You are currently subscribed to windbg as: [email protected]
    To unsubscribe send a blank email to leave-windbg-$subst('Recip.MemberIDChar')@lists.osr.com

    ---
    You are currently subscribed to windbg as: $subst('Recip.EmailAddr')
    To unsubscribe send a blank email to leave-windbg-$subst('Recip.MemberIDChar')@lists.osr.com
  • Gary_G._LittleGary_G._Little Member Posts: 508
    Girish,

    Well you did all that, but did you change the boot.ini file to add one of
    the debugger switches? Any one of these switches will kick the target into
    debug. You can tell by looking at the boot menu and seeing [DEBUG ENABLED]
    next to the system you want to boot. Well you did all that, but did you
    change the boot.ini file to add one of the debugger switches? Any one of
    these switches will kick the target into debug. You can tell by looking at
    the boot menu and seeing [DEBUG ENABLED] next to the system you want to
    boot.

    Gary

    -----Original Message-----
    From: [email protected]
    [mailto:[email protected]] On Behalf Of Girish Desai
    Sent: Monday, April 30, 2001 8:41 PM
    To: Kernel Debugging Interest List
    Subject: [windbg] How to debug using WinDbg??

    Hello,

    I am new to WinDbg. And I am facing some problem in debugging my driver on
    NT
    system using WinDbg.

    1. Created a driver, installed it on target system with demand start.

    2. Enabled debugging on target system by modifying boot.ini.

    3. Checked the COM port connection with HyperTerminal.

    4. Installed symbol files on host computers. Also set proper environments.

    5. Now, I launched WinDbg, Ctrl+K, gave path to symbol file, image file and
    source code.

    Here, I am stuck. I really want to take over the control when target comes
    to
    DriverEntry. I am starting my driver from Device applet at target computer.
    What should I do now? Hello,

    I am new to WinDbg. And I am facing some problem in debugging my driver on
    NT
    system using WinDbg.

    1. Created a driver, installed it on target system with demand start.

    2. Enabled debugging on target system by modifying boot.ini.

    3. Checked the COM port connection with HyperTerminal.

    4. Installed symbol files on host computers. Also set proper environments.

    5. Now, I launched WinDbg, Ctrl+K, gave path to symbol file, image file and
    source code.

    Here, I am stuck. I really want the control to come at DriverEntry when I
    start my driver from Device applet at target computer.

    Do I need to install WinDbg on target system also or what?

    Or is there any command, which will invoke driver on target machine from
    host?

    Please advice..

    Thanks,
    Giri

    ------------------------------------------------------------
    This e-mail has been sent to you courtesy of OperaMail, as a free
    service from
    Opera Software, makers of the award-winning Web Browser, Opera. Visit us
    at
    http://www.opera.com/ or our portal at: http://www.myopera.com/ Your free
    e-mail
    account is waiting at: http://www.operamail.com/
    ------------------------------------------------------------


    ---
    You are currently subscribed to windbg as: [email protected]
    To unsubscribe send a blank email to leave-windbg-$subst('Recip.MemberIDChar')@lists.osr.com


    ---
    You are currently subscribed to windbg as: $subst('Recip.EmailAddr')
    To unsubscribe send a blank email to leave-windbg-$subst('Recip.MemberIDChar')@lists.osr.com
  • OSR_Community_User-48OSR_Community_User-48 Member Posts: 74
    Or just type

    bp <driver name>!DriverEntry

    in the debugger

    -----Original Message-----
    From: Jerry Kelley [mailto:[email protected]]
    Sent: Tuesday, May 01, 2001 6:49 AM
    To: Kernel Debugging Interest List
    Subject: [windbg] Re: How to debug using WinDbg??


    Or even simpler, insert KdBreakPoint() somewhere in DriverEntry.

    -----Original Message-----
    From: James Antognini [mailto:[email protected]]
    Sent: Monday, April 30, 2001 11:35 PM
    To: Kernel Debugging Interest List
    Subject: [windbg] Re: How to debug using WinDbg??



    For starters, ensure you can talk to the target system: Do control-break
    in
    the command window. You should interrupt the target. If that happens,
    hit
    F5 to let the system proceed as usual.

    With connectivity established, I would add this to DriverEntry (thanks
    to
    Mark Roddy's suggestion):

    _try
    {
    DbgBreakPoint();
    }
    _except(EXCEPTION_EXECUTE_HANDLER)
    {
    }

    This will cause a debug breakpoint, and if your debugger is attached,
    you
    should get control. In fact, if your symbols and other paths are
    correct,
    you'll be stopped in the source window.


    James Antognini
    IBM Research

    Internet address -- [email protected]
    Notes address -- James Antognini/Watson/[email protected]

    Phone -- external: 914-784-7258; tieline: 863-7258


    ---
    You are currently subscribed to windbg as: [email protected]
    To unsubscribe send a blank email to leave-windbg-$subst('Recip.MemberIDChar')@lists.osr.com

    ---
    You are currently subscribed to windbg as: [email protected]
    To unsubscribe send a blank email to leave-windbg-$subst('Recip.MemberIDChar')@lists.osr.com

    ---
    You are currently subscribed to windbg as: $subst('Recip.EmailAddr')
    To unsubscribe send a blank email to leave-windbg-$subst('Recip.MemberIDChar')@lists.osr.com
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. Sign in or register to get started.

Upcoming OSR Seminars
OSR has suspended in-person seminars due to the Covid-19 outbreak. But, don't miss your training! Attend via the internet instead!
Writing WDF Drivers 24 January 2022 Live, Online
Internals & Software Drivers 7 February 2022 Live, Online
Kernel Debugging 21 March 2022 Live, Online
Developing Minifilters 23 May 2022 Live, Online