Debugging printer driver

N

Nitin

Hi,
I am trying to setup the WinDbg debugger to debug the printer driver. I
followed the steps below-
1. Open MSPaint application.
2. In WinDbg, Select [Attach to process] menu option. Select MSPaint
process.
3. Set the symbol path to C:\Windows\Symbols(where I installed the symbols)
4. Set the source path.
5. Set the image file path.(where my driver is kept).

After doing the steps above when I try to set a breakpoint in the code it
gives an error message saying "code not found, breakpoint not set". The
following errors are also shown in the command window of WinDbg-
.....................*** ERROR: Symbol file could not be found. Defaulted to
export symbols for C:\WINDOWS\System32\ntdll.dll -

*** ERROR: Symbol file could not be found. Defaulted to export symbols for
C:\WINDOWS\system32\ole32.dll -

*** ERROR: Symbol file could not be found. Defaulted to export symbols for
C:\WINDOWS\system32\SHLWAPI.dll -

*** ERROR: Symbol file could not be found. Defaulted to export symbols for
C:\WINDOWS\WinSxS\x86_Microsoft.Windows.GdiPlus_6595b64144ccf1df_1.0.2600.13
60_x-ww_24a2ed47\gdiplus.dll -

*** ERROR: Symbol file could not be found. Defaulted to export symbols for
C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0
..2600.1612_x-ww_7c379b08\COMCTL32.dll -

*** ERROR: Symbol file could not be found. Defaulted to export symbols for
C:\WINDOWS\system32\USER32.dll -

*** ERROR: Symbol file could not be found. Defaulted to export symbols for
C:\WINDOWS\system32\kernel32.dll -

*** ERROR: Symbol file could not be found. Defaulted to export symbols for
C:\WINDOWS\system32\RPCRT4.dll -

*** ERROR: Symbol file could not be found. Defaulted to export symbols for
C:\WINDOWS\System32\CLBCATQ.DLL -

*** ERROR: Symbol file could not be found. Defaulted to export symbols for
C:\WINDOWS\system32\SHELL32.dll -

*** ERROR: Symbol file could not be found. Defaulted to export symbols for
C:\WINDOWS\system32\GDI32.dll -


My system configuration is -
OS - Windows - XP service pack 1
Debugger- WinDbg version 6.4.7.2
Symbol - Symbols for Windows XP sp1

If anybody have any idea what is wrong and why I am getting above errors,
please let me know.

Thanks,
Nitin
 
A

Alan Morris\(MSFT\)

verify that the symbols are correct. If you are running SP1, do you have
any security updates? Verify that the symbol file has a time/date stamp
close to the binary date.

I like to place symbols per binary type in their own directories

_NT_SYMBOL_PATH=g:\symbols

tree g:\symbols
Folder PATH listing for volume Local Disk
Volume serial number is 0006EE50 20AF:0E0F
G:\SYMBOLS
????acm
????ax
????cnv
????com
????cpl
????dll
????drv
????exe
????ime
????lhc
????ntd
????ocx
????scr
????sys
????tsp
????wpc


You should be able to set a breakpoint on your binary without any of the
system binary symbols. You driver file will not load until you invoke File
Print in mspaint and select the printer which uses your driver.

not sure how windbg works but set a load bp for your module. Here is an
example for ps5ui.dll

0:005> sxe ld ps5ui.dll
0:005> g
ModLoad: 73070000 73097000 C:\WINDOWS\system32\WINSPOOL.DRV
ModLoad: 5dff0000 5e015000
C:\WINDOWS\system32\spool\DRIVERS\W32X86\3\PS5UI.DL
L
eax=00000001 ebx=00000000 ecx=0007e401 edx=00000000 esi=7ffdf000
edi=20000000
eip=7c82c3dc esp=0007e3cc ebp=0007e410 iopl=0 nv up ei pl zr na po
nc
cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000
efl=00000246
ntdll!KiFastSystemCallRet:
7c82c3dc c3 ret
0:000> k
ChildEBP RetAddr



--
Alan Morris
Windows Printing Team
Search the Microsoft Knowledge Base here:
http://support.microsoft.com/default.aspx?scid=fh;[ln];kbhowto

This posting is provided "AS IS" with no warranties, and confers no rights.

Nitin said:
Hi,
I am trying to setup the WinDbg debugger to debug the printer driver. I
followed the steps below-
1. Open MSPaint application.
2. In WinDbg, Select [Attach to process] menu option. Select MSPaint
process.
3. Set the symbol path to C:\Windows\Symbols(where I installed the symbols)
4. Set the source path.
5. Set the image file path.(where my driver is kept).

After doing the steps above when I try to set a breakpoint in the code it
gives an error message saying "code not found, breakpoint not set". The
following errors are also shown in the command window of WinDbg-
....................*** ERROR: Symbol file could not be found. Defaulted to
export symbols for C:\WINDOWS\System32\ntdll.dll -

*** ERROR: Symbol file could not be found. Defaulted to export symbols for
C:\WINDOWS\system32\ole32.dll -

*** ERROR: Symbol file could not be found. Defaulted to export symbols for
C:\WINDOWS\system32\SHLWAPI.dll -

*** ERROR: Symbol file could not be found. Defaulted to export symbols for
C:\WINDOWS\WinSxS\x86_Microsoft.Windows.GdiPlus_6595b64144ccf1df_1.0.2600.13
60_x-ww_24a2ed47\gdiplus.dll -

*** ERROR: Symbol file could not be found. Defaulted to export symbols for
C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0
.2600.1612_x-ww_7c379b08\COMCTL32.dll -

*** ERROR: Symbol file could not be found. Defaulted to export symbols for
C:\WINDOWS\system32\USER32.dll -

*** ERROR: Symbol file could not be found. Defaulted to export symbols for
C:\WINDOWS\system32\kernel32.dll -

*** ERROR: Symbol file could not be found. Defaulted to export symbols for
C:\WINDOWS\system32\RPCRT4.dll -

*** ERROR: Symbol file could not be found. Defaulted to export symbols for
C:\WINDOWS\System32\CLBCATQ.DLL -

*** ERROR: Symbol file could not be found. Defaulted to export symbols for
C:\WINDOWS\system32\SHELL32.dll -

*** ERROR: Symbol file could not be found. Defaulted to export symbols for
C:\WINDOWS\system32\GDI32.dll -


My system configuration is -
OS - Windows - XP service pack 1
Debugger- WinDbg version 6.4.7.2
Symbol - Symbols for Windows XP sp1

If anybody have any idea what is wrong and why I am getting above errors,
please let me know.

Thanks,
Nitin
 
S

Shrinidhi.Kulkarni

Hi Nitin,

From your mail, looks like you are dubugging the USER mode
(XP) printer driver.

I feel it is easy to use user mode debugger like Visual
studio IDE.
hth,
--
/*With Thanks & Regards,*/main(){char*s="-..0.*2*-
2.*#&.*.*.**&.*"
/*-Shrinidhi.Kulkarni-*/"**..*#&6.*.******.*.*#-
4&0.*****.0&*#2*."
/*25732293/96 X 5215*/"**.*****.*.*#&.*.**.*1***..*#-
...*.**2*-2.*#"
,_;while(_=*s/4)_-=8,printf("\n%*s"+!!_,_<<!!
*s,"_/_/_/"+*s++%4*2);}

__(_,i){return putchar(!i?_:' '),i?__(_,--i):(putchar
('\r'),_);}main(_){return _
==' '?_:__(main(_+_/_),_)^_["]!!!!!\224\\;<((.-\"h\/\227
\231\/\214_:(+4=(h/KK"]-'!';}



-----Original Message-----
Hi,
I am trying to setup the WinDbg debugger to debug the printer driver. I
followed the steps below-
1. Open MSPaint application.
2. In WinDbg, Select [Attach to process] menu option. Select MSPaint
process.
3. Set the symbol path to C:\Windows\Symbols(where I installed the symbols)
4. Set the source path.
5. Set the image file path.(where my driver is kept).

After doing the steps above when I try to set a breakpoint in the code it
gives an error message saying "code not found, breakpoint not set". The
following errors are also shown in the command window of WinDbg-
.....................*** ERROR: Symbol file could not be found. Defaulted to
export symbols for C:\WINDOWS\System32\ntdll.dll -

*** ERROR: Symbol file could not be found. Defaulted to export symbols for
C:\WINDOWS\system32\ole32.dll -

*** ERROR: Symbol file could not be found. Defaulted to export symbols for
C:\WINDOWS\system32\SHLWAPI.dll -

*** ERROR: Symbol file could not be found. Defaulted to export symbols for
C:\WINDOWS\WinSxS\x86_Microsoft.Windows.GdiPlus_6595b64144 ccf1df_1.0.2600.13
60_x-ww_24a2ed47\gdiplus.dll -

*** ERROR: Symbol file could not be found. Defaulted to export symbols for
C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common- Controls_6595b64144ccf1df_6.0
..2600.1612_x-ww_7c379b08\COMCTL32.dll -

*** ERROR: Symbol file could not be found. Defaulted to export symbols for
C:\WINDOWS\system32\USER32.dll -

*** ERROR: Symbol file could not be found. Defaulted to export symbols for
C:\WINDOWS\system32\kernel32.dll -

*** ERROR: Symbol file could not be found. Defaulted to export symbols for
C:\WINDOWS\system32\RPCRT4.dll -

*** ERROR: Symbol file could not be found. Defaulted to export symbols for
C:\WINDOWS\System32\CLBCATQ.DLL -

*** ERROR: Symbol file could not be found. Defaulted to export symbols for
C:\WINDOWS\system32\SHELL32.dll -

*** ERROR: Symbol file could not be found. Defaulted to export symbols for
C:\WINDOWS\system32\GDI32.dll -


My system configuration is -
OS - Windows - XP service pack 1
Debugger- WinDbg version 6.4.7.2
Symbol - Symbols for Windows XP sp1

If anybody have any idea what is wrong and why I am getting above errors,
please let me know.

Thanks,
Nitin



.
 

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

Top