News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Symbolic code labels during debug

Started by true_ruf, September 25, 2006, 09:29:40 AM

Previous topic - Next topic

true_ruf

Hi, this is a question regarding masm, link and debugging. The problem I have is I am not able to see the symbolic code labels I use in the assembler programs. For example if I compile the following program:


.386
.model flat, stdcall
ExitProcess PROTO, dwExitCode:DWORD

.data
list DD 10, 2, 35, 4, 5, 6, 7

.code
_Init:
push offset list
call Dummy

push 0
call  ExitProcess

Dummy PROC
jmp Dummy_label
Dummy_label:
ret 4
Dummy ENDP

END _Init


The debuger (OllyDbg or IDA) shows the following:


00401010 >/$ 68 00404000    push    offset list
00401015  |. E8 07000000    call    Dummy
0040101A  |. 6A 00          push    0             
0040101C  \. E8 0B000000    call    ExitProcess
00401021 >/$ EB 00          jmp     short 00401023
00401023  \> C2 0400        ret     4

And as you can see Dummy_label is missing. I am using the following command line for the compilation and linking:

ml /Zi /c /Cp /Zd /coff /Cp /Fm /FR test.asm
link /debug /subsystem:console test.obj kernel32.lib

It would be great if anyone could help me. By the way, if I compile using tasm I am able to see symbolic code labels but would like to use masm.

Thx in advance.

PBrennick

true_ruf,
With TASM32, the Zi switch has a much different meaning than it does in MASM.

Paul
The GeneSys Project is available from:
The Repository or My crappy website

sinsi

If you are using ML 6+, declare the label PUBLIC and use a double colon, e.g.

PUBLIC Dummy_label  ;declare it
Dummy PROC
   jmp Dummy_label
Dummy_label::           ;note the ::
   ret   4
Dummy ENDP

Dummy_label shows up with WinDbg (not sure about Olly though.)

Light travels faster than sound, that's why some people seem bright until you hear them.

true_ruf

#3
Quote from: PBrennick on September 25, 2006, 10:09:35 AM
true_ruf,
With TASM32, the Zi switch has a much different meaning than it does in MASM.
Paul

Yes, the poing is using tasm i can see labels during debug but not when using masm (using different command line options of course)


Quote
If you are using ML 6+, declare the label PUBLIC and use a double colon, e.g.
Code:
PUBLIC Dummy_label  ;declare it
Dummy PROC
   jmp Dummy_label
Dummy_label::           ;note the ::
   ret   4
Dummy ENDP
Dummy_label shows up with WinDbg (not sure about Olly though.)

Yup, it works, any idea why? any command line option (for ml or for link) not to include that public declaration?

thx btw