News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

WinDbg Symbol Problem

Started by raleep, January 25, 2014, 12:29:50 PM

Previous topic - Next topic

GoneFishing


MtheK

  F9 is also cool, tho I DO have to ALWAYS open the source window, even if it's already there, whether I use this F9 or BP xxx in the command window, to be
able to step thru my source.

raleep

Quote from: sinsi on January 25, 2014, 02:44:34 PM
Have you made ''svtpf" PUBLIC?
...

Never occurred to me.  But it seems to work.  Thank you!

raleep

Quote from: vertograd on January 25, 2014, 09:20:17 PM
Also you may make all symbols public by adding /Zf option to ML command line
Great to know.  But it does not work for me.  I'll work on it.
0:000> bpkey
Bp expression 'key' could not be resolved, adding deferred bp
0:000> bl
0 eu             0001 (0001) (key)


QuoteWhen at initial breakpoint try to dump all symbols to console:
Quotedt lfw!*
and post the output here .
We'll see what's wrong with them

ntdll!DbgBreakPoint:
7c90120e cc              int     3

0:000> dt lfw!*
          lfw!HDC
          lfw!HIGHCONTRASTA
          lfw!SV2CVW2_PARAMS
          lfw!USER_INFO_1006
          lfw!MDICREATESTRUCTA
          lfw!EMREOF
          lfw!LPBYTE
...

Huge list, 88k, includes at end [at least many of] my symbols in no discernable order, eg
0040f320   lfw!ktb
00410748   lfw!mwxx
0040f250   lfw!ctr
00413be0   lfw!obpl
004178de   lfw!smcap
00417444   lfw!fla0
0040dd0a   lfw!mvar78
0040dc81   lfw!mvar68
0040dc15   lfw!mvar58
0040db88   lfw!mvar48
0040db00   lfw!mvar38
0040da73   lfw!mvar28
0040d9ec   lfw!mvar18
0041345a   lfw!inpsrc
00413b78   lfw!clsr
004174ac   lfw!insp
00414102   lfw!omsc


They appear to be all data symbols.
Do you want me to post the whole list, or attach a zip?

GoneFishing

#19
...

jj2007

Quote from: MtheK on January 26, 2014, 01:11:06 AM
  I also use /Zi and /coff (latter required also) in the ml cmd-line to make the .pdb.

Can't speak for WinDbg but Olly needs only
ml /c /coff /Zi ...
link /debug ...

raleep

Quote from: vertograd on January 26, 2014, 06:10:35 AM
Quote from: raleep on January 26, 2014, 05:50:54 AM
...
Do you want me to post the whole list, or attach a zip?
No, thank you  :biggrin:
I just wanted to make sure that WinDbg loads the symbols . Sometimes I use 'dt' when I have troubles with setting breakpoints. BTW is "svtpf" listed by 'dt' or 'x' commands?
svtpf is not listed by 'dt'. I haven't tried 'x'.

Quote
Quote from: raleep on January 26, 2014, 05:13:48 AM
Quote from: sinsi on January 25, 2014, 02:44:34 PM
Have you made ''svtpf" PUBLIC?
...

Never occurred to me.  But it seems to work.  Thank you!

Is the problem solved now?


It is good enough for my present needs.  2 remaining problems, which I will not be working on immediately:
    Breakpoints set by this method are transient and have to be reset to appear in the next WinDbg session,
    /Zf does not work for me, so I know no way to make all symbols public.
Even if these problems were resolved, my recent experience has shown me how limited is the utility of accessing code symbols from the command window.

Thanks

nidud

#22
deleted

MtheK

  Ah: /Zi AND /Zf TOGETHER now works w/bp. I added SYMCHK (w/its' weird way I have to place my .pdb) to my .bat and when I keep /Zi out, SYMCHK fails as "mis-matched" (my cmd-line options) but says this:
       DBGHELP: DSNTODAY - public symbols 
and if I remove /Zf, it says this:
       DBGHELP: DSNTODAY - private symbols & lines
but I guess it's for .data only.  I've always used /Zi.

MtheK

...and an OOPS in SYMCHK itself:

[SYMCHK] Line nubmers: TRUE

;)

MtheK

  DUMPBIN seems to show my .code labels, for example:
SECTION HEADER #6
COFF SYMBOL TABLE
5F5 00005F43 SECT1  notype ()    Static       | ABENDINUSE
and what I assume is a displacement matches what's in .lst:
00005F43         ABENDINUSE:
so maybe somehow WinDbg could use them?

jj2007

I made some tests with Olly and JWasm, and they showed that
/Zi turns on symbols of local args (but no global jumps)
/Zf turns on jumps (but no local symbols)

Do not assume that ML does the same.

MtheK

 DUMPBIN runs quirky. DBH seems better; SRCH shows each of my labels in 1 of 32 groups:
     4                         0   SymTagLabel             : mainCRTStartup
    4d            100a3b8   SymTagData              : ACTSHORT
   268            100f000   SymTagData              : SECDESC
   d94                       0   SymTagLabel             : ABENDINUSE
tho it's from the .pdb. SymTagLabels seem to be my .code, and SymTagDatas my .data, labels. Perhaps all but 1 .code is N/A if the "displ" is 0 (all my SymTagLabels are 0)? All my SymTagDatas equal my displ if I subtract that x'100a000' from it.
  An  ENUM program!*  shows those other (EXTRN; addrs outside of my .code bounds? other "CSECTs"?) (WinAPI "commands") symbols.

MtheK

  FINALLY! I can NOW use my .code labels in a bp command in the command window. Kinda crappy, but if I do this right B 4 my ASM END directive:

     PUBLIC WRITEOUT

then I can do 'bp WRITEOUT' in the cmd window w/o it saying it can't resolve the symbol. x /v now also shows it. Then F5 (g) stops at it, just like when I use F9 in the source window.

  Of course, this means that every label u want to stop on must be coded.
Perhaps there is a way to use the PUBLIC directive to force all .code labels to work this way?