|
You have to install the symbols which you can find in Microsoft WinDbg site.
Maxwell Chen
|
|
|
|
|
Thank you for your reply. Symbols from MS sysmbol server are installed and loaded.
|
|
|
|
|
You can download the symbol files for the OS in one hit. Another option is to select "File->Symbol File Path ..." and enter "SRV*C:\Symbols*http://msdl.microsoft.com/download/symbols". This sets up WinDBG to use Microsoft's symbol server. Symbols that can't be found in your local symbol cache ("C:\Symbols") are downloaded from Microsoft and placed in the cache. Microsoft makes sure their symbol server is updated and it contains symbols for some of their products and not just system DLLs. Initially things may be a little slow while your symbol cache is filled (as it will be empty to begin with). Symbols are downloaded as needed and you don't have to worry about which version of Windows you're using or which Service Packs and Hotfixes have been applied.
Steve
|
|
|
|
|
Thank you for your reply. But as I said symbols are installed and loaded correctly. I can verify this by issuing lm command:
0:000> lm
start end module name
01000000 01014000 notepad (pdb symbols) C:\WINDOWS\Symbols\notepad.pdb\F679AEF8BE1F44CAB4CBC4B52D77241B1\notepad.pdb
73000000 73026000 WINSPOOL (pdb symbols) C:\WINDOWS\Symbols\winspool.pdb\97A6ECC94EA7450CA7D375BD9DFFCA5E2\winspool.pdb
763b0000 763f9000 comdlg32 (pdb symbols) C:\WINDOWS\Symbols\comdlg32.pdb\4FCBEAD63D7345998C1F92D8DBB0DC272\comdlg32.pdb
773d0000 774d2000 COMCTL32 (pdb symbols) C:\WINDOWS\Symbols\MicrosoftWindowsCommon-Controls-6.0.2600.2180-comctl32.pdb\C454919C031643618F4CAC675CBC64401\MicrosoftWindowsCommon-Controls-6.0.2600.2180-comctl32.pdb
77c10000 77c68000 msvcrt (pdb symbols) C:\WINDOWS\Symbols\msvcrt.pdb\A678F3C30DED426B839032B996987E381\msvcrt.pdb
77d40000 77dd0000 USER32 (pdb symbols) C:\WINDOWS\Symbols\user32.pdb\EE2B714D83A34C9D88027621272F83262\user32.pdb
77dd0000 77e6b000 ADVAPI32 (pdb symbols) C:\WINDOWS\Symbols\advapi32.pdb\455D6C5F184D45BBB5C5F30F829751142\advapi32.pdb
77e70000 77f01000 RPCRT4 (pdb symbols) C:\WINDOWS\Symbols\rpcrt4.pdb\BEA45A721DA141DAA3BA86B3A20311532\rpcrt4.pdb
77f10000 77f57000 GDI32 (pdb symbols) C:\WINDOWS\Symbols\gdi32.pdb\C0EA66BE00A64BD7AEF79E443A91869C2\gdi32.pdb
77f60000 77fd6000 SHLWAPI (pdb symbols) C:\WINDOWS\Symbols\shlwapi.pdb\A773F8CDBBAD4604ABA33EF708F123882\shlwapi.pdb
7c800000 7c8f4000 kernel32 (pdb symbols) C:\WINDOWS\Symbols\kernel32.pdb\FB334FB28FA34128BDE9229285BE4C2F2\kernel32.pdb
7c900000 7c9b0000 ntdll (pdb symbols) C:\WINDOWS\Symbols\ntdll.pdb\36515FB5D04345E491F672FA2E2878C02\ntdll.pdb
7c9c0000 7d1d5000 SHELL32 (pdb symbols) C:\WINDOWS\Symbols\shell32.pdb\6744E3D041704F519BD5D4D56E5388A72\shell32.pdb
These symbols are downloaded from MS symbol server (as you suggested in your post).
As you can see symbols are loaded for kernel32.dll but still WinDbg does not allow me to set breakpoints on its exports.
|
|
|
|
|
I issued the following command in WinDBG while debugging notepad:
0:000> bp user32!GetMessageW
*** ERROR: Symbol file could not be found. Defaulted to export symbols for C:\WINDOWS\system32\USER32.dll -
0:000> bl
0 e 77d491c6 0001 (0001) 0:**** USER32!GetMessageW
0:000> lm
start end module name
01000000 01014000 notepad (pdb symbols) C:\Symbols\notepad.pdb\F679AEF8BE1F44CAB4CBC4B52D77241B1\notepad.pdb
5ad70000 5ada8000 UxTheme (deferred)
5cb70000 5cb96000 ShimEng (deferred)
6f880000 6fa4a000 AcGenral (deferred)
73000000 73026000 WINSPOOL (deferred)
74720000 7476b000 MSCTF (deferred)
763b0000 763f9000 comdlg32 (deferred)
769c0000 76a73000 USERENV (deferred)
76b40000 76b6d000 WINMM (deferred)
77120000 771ac000 OLEAUT32 (deferred)
773d0000 774d2000 COMCTL32 (deferred)
774e0000 7761d000 ole32 (deferred)
77be0000 77bf5000 MSACM32 (deferred)
77c00000 77c08000 VERSION (deferred)
77c10000 77c68000 msvcrt (deferred)
77d40000 77dd0000 USER32 (export symbols) C:\WINDOWS\system32\USER32.dll
77dd0000 77e6b000 ADVAPI32 (deferred)
77e70000 77f01000 RPCRT4 (deferred)
77f10000 77f57000 GDI32 (deferred)
77f60000 77fd6000 SHLWAPI (deferred)
7c800000 7c8f4000 kernel32 (pdb symbols) C:\Symbols\kernel32.pdb\FB334FB28FA34128BDE9229285BE4C2F2\kernel32.pdb
7c900000 7c9b0000 ntdll (pdb symbols) C:\Symbols\ntdll.pdb\36515FB5D04345E491F672FA2E2878C02\ntdll.pdb
7c9c0000 7d1d5000 SHELL32 (deferred)
Breakpoint 0 hit
eax=0007fefc ebx=03cc07df ecx=0000625c edx=7c90eb94 esi=00000000 edi=77d491c6
eip=77d491c6 esp=0007fedc ebp=0007ff1c iopl=0 nv up ei pl zr na po nc
cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00000246
USER32!GetMessageW:
77d491c6 8bff mov edi,edi
0:000> k 1000
ChildEBP RetAddr
WARNING: Stack unwind information not available. Following frames may be wrong.
0007fed8 01002a1b USER32!GetMessageW
0007ff1c 01007511 notepad!WinMain+0xe5
0007ffc0 7c816d4f notepad!WinMainCRTStartup+0x174
0007fff0 00000000 kernel32!BaseProcessStart+0x23
As you can see I was able to place a breakpoint even though the symbols for user32.dll are only export symbols. Does this work for you?
Steve
|
|
|
|
|
Found source of my problem. Some time ago I set _NT_EXPR_EVAL=c++ to experiment with C++ expression evaluator and forgot to disable it after.
|
|
|
|
|
Great tip
I don't use winDbg much, how good is it, where can i find more info about winDbg?
Master.. Master.. where are the dreams that i've been after...
|
|
|
|
|
I'm not sure of any WinDBG "how to" - Probably a good idea for an article for someone. The reason I started using it is that produces good stack traces and can analyse crash dumps.
Steve
|
|
|
|
|
Hi all,
I found that there is some margin in the left side of the EditCtrl and the text inside it. It depends upon the font that set to the EditCtrl. Do anybody know how to calculate that margin?
Thank you.
- NS -
|
|
|
|
|
Use WM_NCCALCSIZE and WM_NCPAINT to trigger a WM_NCCALCSIZE .
Nibu thomas
Software Developer
|
|
|
|
|
I just want to read that margin size.
- NS -
|
|
|
|
|
Use GetWindowRect to get window dimensions
and
Use GetClientRect to get client area dimensions. The difference is the NC area or the border.
GetWindowRect returns screen coordinates. So you may have to convert any of them to either form.
Nibu thomas
Software Developer
|
|
|
|
|
I did the following.
CRect WndRect, ClientRect;
m_Edit.GetWindowRect( &WndRect );
m_Edit.GetClientRect( &ClientRect );
m_Edit.ClientToScreen( &ClientRect );
int nMargin = ClientRect.left - WndRect.left;
I got nMargin as 2. I know that is the border width. But actually there is a space Inside the client left and text. I mentioned that as the margin. I set the font as Arial 14, and from screen shot of the control I can measure this margin is about 8 pixels wide.
- NS -
|
|
|
|
|
Look up CEdit::GetMargins() and the EM_GETMARGINS message. Also CEdit::SetMargins() and EM_SETMARGINS.
You may be right
I may be crazy
-- Billy Joel --
Within you lies the power for good - Use it!
|
|
|
|
|
Wow...! It is working fine. Thank you.
One more question,
Can I guess it without having an EditCtrl. But the font is with me.
What I need is I have to make an static text control to be same as edit ctrl.
Hope you got what I meant.
- NS -
|
|
|
|
|
NS17 wrote: What I need is I have to make an static text control to be same as edit ctrl.
Why do you want to do this? A readonly edit control should suffice!
Nibu thomas
Software Developer
|
|
|
|
|
But I dont need the text caret and text selection.
- NS -
|
|
|
|
|
NS17 wrote: But I dont need the text caret and text selection.
Then CBS_DROPDOWNLIST should be it.
From the docs:
CBS_DROPDOWNLIST: Similar to CBS_DROPDOWN , except that the edit control is replaced by a static-text item that displays the current selection in the list box.
Nibu thomas
Software Developer
|
|
|
|
|
Exactly pal...
But the problem they are not the same.
- NS -
|
|
|
|
|
NS17 wrote: But the problem they are not the same.
Why do you think they are not the same? It what way do they differ!
Nibu thomas
Software Developer
|
|
|
|
|
Just a simple example can show the difference. If we place two ComboBoxes, one CBS_DROPDOWN and other CBS_DROPDOWNLIST, and the font to be Arial 14, we can see the difference in margin.
- NS -
|
|
|
|
|
NS17 wrote: If we place two ComboBoxes, one CBS_DROPDOWN and other CBS_DROPDOWNLIST, and the font to be Arial 14, we can see the difference in margin.
I am still confused as to what you want to achieve? Lol.
Nibu thomas
Software Developer
|
|
|
|
|
I have created a custom combo box from CComboBox. It should fully ownerdrawn. So I have to make all colors configurable. For DropDown ComboBox there is no problem yet. But in DropList this is not the case. When this combo is disabled the colors cannot be configured. So I put a static text control above the text area of that combo as child programatically. Now I need to give a margin in the left side.
- NS -
|
|
|
|
|
NS17 wrote: So I put a static text control above the text area of that combo as child programatically. Now I need to give a margin in the left side.
Instead of putting another static control why don't you use the existing one!
Nibu thomas
Software Developer
|
|
|
|
|
Actually there is not such a one. ComboBox is painting the text itself.
- NS -
|
|
|
|