windbg -d or -b doesn't break early enough

I’m trying to debug my keyboard driver, but I can’t get the debugger to break early enough to see any initialization of my driver.

I’d be happy breaking on module load, or at DriverEntry, but by the time I can get the debugger to break, most the modules in the whole system have loaded.

Also, this means my .kdfiles list isn’t working either. Is this just a problem with using USB 3.0 for debugging?

I’m working on Win8 x64, but I could move to an 8.1 system if that’d help.

Add DbgBreak to your code, and debugger will cache it.
On Aug 20, 2013 10:46 PM, wrote:

I’m trying to debug my keyboard driver, but I can’t get the debugger to
break early enough to see any initialization of my driver.

I’d be happy breaking on module load, or at DriverEntry, but by the time I
can get the debugger to break, most the modules in the whole system have
loaded.

Also, this means my .kdfiles list isn’t working either. Is this just a
problem with using USB 3.0 for debugging?

I’m working on Win8 x64, but I could move to an 8.1 system if that’d help.


WINDBG is sponsored by OSR

OSR is hiring!! Info at http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

I’ve tried KdBreakPoint before but it locks up the target in a state I can’t connect to it, and I end up having to do a recovery to restore.

Since I can’t get .kdfiles to work either, I’m guessing I have a more fundamental issue with timing. I’ve looked that the Ctrl-Alt-D output to see what’s going on, but I only see the load requests for 2 or 3 things after doing a .reboot.

I think that I’m going to have to find a different target machine and maybe see if network debugging works better, or something. I’ve seen a number of odd things with USB 3.0 debugging. Shame, because USB 2.0 on ARM systems worked pretty well…

Try first to connect and use DbgBreakPoint(), it works for me.
On Aug 21, 2013 12:20 AM, wrote:

> I’ve tried KdBreakPoint before but it locks up the target in a state I
> can’t connect to it, and I end up having to do a recovery to restore.
>
> Since I can’t get .kdfiles to work either, I’m guessing I have a more
> fundamental issue with timing. I’ve looked that the Ctrl-Alt-D output to
> see what’s going on, but I only see the load requests for 2 or 3 things
> after doing a .reboot.
>
> I think that I’m going to have to find a different target machine and
> maybe see if network debugging works better, or something. I’ve seen a
> number of odd things with USB 3.0 debugging. Shame, because USB 2.0 on ARM
> systems worked pretty well…
>
> —
> WINDBG is sponsored by OSR
>
> OSR is hiring!! Info at http://www.osr.com/careers
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>

I added DbgBreakPoint(), connected windbg, copied the new driver to the target, and issued .reboot from windbg. The target freezes during boot before the debugger attaches if I do this.

If you debugging usb device you can connect it after the PC and debuger are
running.
On Aug 21, 2013 12:44 AM, wrote:

> I added DbgBreakPoint(), connected windbg, copied the new driver to the
> target, and issued .reboot from windbg. The target freezes during boot
> before the debugger attaches if I do this.
>
> —
> WINDBG is sponsored by OSR
>
> OSR is hiring!! Info at http://www.osr.com/careers
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>

sxe ibp; .reboot (set exception handler for initial breakin and
reboot the target)

should be the first break possible in normal kd session when resumed from reboot

the driver init should have not been executed when windbg breaks here

On 8/21/13, danny kozlov wrote:
> If you debugging usb device you can connect it after the PC and debuger are
> running.
> On Aug 21, 2013 12:44 AM, wrote:
>
>> I added DbgBreakPoint(), connected windbg, copied the new driver to the
>> target, and issued .reboot from windbg. The target freezes during boot
>> before the debugger attaches if I do this.
>>
>> —
>> WINDBG is sponsored by OSR
>>
>> OSR is hiring!! Info at http://www.osr.com/careers
>>
>> For our schedule of WDF, WDM, debugging and other seminars visit:
>> http://www.osr.com/seminars
>>
>> To unsubscribe, visit the List Server section of OSR Online at
>> http://www.osronline.com/page.cfm?name=ListServer
>>
>
> —
> WINDBG is sponsored by OSR
>
> OSR is hiring!! Info at http://www.osr.com/careers
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer