This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi,
I would like to ask about some symbols found in generated assembly file.
.asm file said:$C$DW$5 .dwtag DW_TAG_TI_loop.dwattr $C$DW$5, DW_AT_name("D:\workspace\examples\led\main.asm:$C$L1:1:1308433675").dwattr $C$DW$5, DW_AT_TI_begin_file("main.c").dwattr $C$DW$5, DW_AT_TI_begin_line(0x1a).dwattr $C$DW$5, DW_AT_TI_end_line(0x20)$C$DW$6 .dwtag DW_TAG_TI_loop_range.dwattr $C$DW$6, DW_AT_low_pc($C$DW$L$_main$3$B).dwattr $C$DW$6, DW_AT_high_pc($C$DW$L$_main$3$E)$C$DW$7 .dwtag DW_TAG_TI_loop_range.dwattr $C$DW$7, DW_AT_low_pc($C$DW$L$_main$4$B).dwattr $C$DW$7, DW_AT_high_pc($C$DW$L$_main$4$E)$C$DW$8 .dwtag DW_TAG_TI_loop_range.dwattr $C$DW$8, DW_AT_low_pc($C$DW$L$_main$5$B).dwattr $C$DW$8, DW_AT_high_pc($C$DW$L$_main$5$E).dwendtag $C$DW$5
What are these various symbols? They are obviously not assembly instructions, so are they also like Archaeologist said in Miscellaneous assembly labels in a program, strictly for compiler use?
Are used by assembler or not? If the role of assembler is simply to translate assembly code into binary opcode, then the above symbol are irrelevant. So in syntax analysis phase (I assume assembler also has syntax analysis phase (?) , which is generic), assembler need to somehow handle them, for example, discarding (?).
But why are these symbols at all here? How does assembler actually treat them?
Thanks,
Zheng
Yes, they are strictly for compiler use. The .dw* assembly directives represent DWARF debugging information.
Archaeologist and Aarti,
From A Brief History of TI Object File Formats, I read that the object file could also contain information for debugging, which is in the "DWARF" format.
However, even if I deleted all .obj files under the /debug directory, I could still debug with software breakpoints (I haven't tested hardware breakpoint, but in principle it is not or much less related file format). Why?
Zheng
All of the debugging information in the object files was copied by the linker into the executable file, which is itself an object file.
Archaeologist,
The output of linker is .out, so may I understand their relationship as:
?
Zheng
Technically the .obj files are "relocatable" object files, and the .out file is a "non-relocatable executable" object file. However, usually when someone says "object file" they mean the relocatable object files.
The file name suffixes are arbitrary. From the compiler and linker point of view, the suffixes of the relocatable object files and the non-relocatable executable object file need not be .obj or .out, but yes, they are named so by convention to avoid confusion.