This is an archive of the discontinued LLVM Phabricator instance.

Rename human-readable name for DW_LANG_Mips_Assembler
ClosedPublic

Authored by aprantl on Apr 27 2021, 3:36 PM.

Details

Summary

The Mips in DW_LANG_Mips_Assembler is a vendor name not an architecture name and in lack of a proper generic DW_LANG_assembler, some assemblers emit DWARF using this tag. Due to a warning I recently introduced users will now be greeted with

This version of LLDB has no plugin for the mipsassem language. Inspection of frame variables will be limited.

What about renaming this to just assembler? Are there any risks in doing so?

rdar://77214764

Diff Detail

Event Timeline

aprantl created this revision.Apr 27 2021, 3:36 PM
aprantl requested review of this revision.Apr 27 2021, 3:36 PM
This revision is now accepted and ready to land.Apr 28 2021, 2:42 PM
clayborg accepted this revision.Apr 28 2021, 3:03 PM

If other architectures are emitting this language for assembly files, then this LGTM.

This revision was landed with ongoing or failed builds.May 12 2021, 7:14 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptMay 12 2021, 7:14 PM
dim added a subscriber: dim.Aug 14 2021, 12:41 PM

Hmm so now on FreeBSD, basically *every* program will cause this warning, as our C startup objects are compiled from .S files, e.g.:

% objdump --dwarf /bin/sleep|grep -B6 "MIPS assembler"
 <0><619>: Abbrev Number: 1 (DW_TAG_compile_unit)
    <61a>   DW_AT_stmt_list   : 0x3f1
    <61e>   DW_AT_ranges      : 0x30
    <622>   DW_AT_name        : /usr/src/lib/csu/amd64/crti.S
    <640>   DW_AT_comp_dir    : /usr/obj/usr/src/amd64.amd64/lib/csu/amd64
    <66b>   DW_AT_producer    : FreeBSD clang version 12.0.1 (git@github.com:llvm/llvm-project.git llvmorg-12.0.1-0-gfed41342a82f)
    <6ce>   DW_AT_language    : 32769   (MIPS assembler)
--
 <0><de8>: Abbrev Number: 1 (DW_TAG_compile_unit)
    <de9>   DW_AT_stmt_list   : 0x93a
    <ded>   DW_AT_ranges      : 0xb0
    <df1>   DW_AT_name        : /usr/src/lib/csu/amd64/crtn.S
    <e0f>   DW_AT_comp_dir    : /usr/obj/usr/src/amd64.amd64/lib/csu/amd64
    <e3a>   DW_AT_producer    : FreeBSD clang version 12.0.1 (git@github.com:llvm/llvm-project.git llvmorg-12.0.1-0-gfed41342a82f)
    <e9d>   DW_AT_language    : 32769   (MIPS assembler)

% lldb /bin/sleep 10
(lldb) target create "/bin/sleep"
Current executable set to '/bin/sleep' (x86_64).
(lldb) settings set -- target.run-args  "10"
(lldb) r
Process 11879 launched: '/bin/sleep' (x86_64)
This version of LLDB has no plugin for the mipsassem language. Inspection of frame variables will be limited.
Process 11879 stopped
* thread #1, name = 'sleep', stop reason = signal SIGSTOP
    frame #0: 0x00000008011a610a libc.so.7`__sys_nanosleep at _nanosleep.S:4

This can't have been the intention of this commit? As far as I can see, there *is* no plugin for plain assembler?

Everyone uses this for any assembly in their code. Should we get rid of this warning? I find it is useless and would like to see it go.

dim added a comment.Aug 17 2021, 12:01 AM

Everyone uses this for any assembly in their code. Should we get rid of this warning? I find it is useless and would like to see it go.

Well, for other languages it might be a helpful warning, but not for the special case of "mips" assembler. :)

This can't have been the intention of this commit? As far as I can see, there *is* no plugin for plain assembler?

This commit changes the warning from

This version of LLDB has no plugin for the mipsassem language.

to

This version of LLDB has no plugin for the language "assembler".

Yes, there is no plugin for the language assembler. But that hasn't chnaged with this commit.

dim added a comment.Aug 19 2021, 1:31 AM

This can't have been the intention of this commit? As far as I can see, there *is* no plugin for plain assembler?

...

Yes, there is no plugin for the language assembler. But that hasn't chnaged with this commit.

Sorry, that was rG220c17ffd4e1b127bcc02b25980b7934184ee1da ("Print a warning when stopped in a frame LLDB has no plugin for"), which is probably a good idea in general, but maybe there could be a specific exception for the DW_LANG_Mips_Assembler case then? It doesn't make sense to warn about that. :)

It doesn't make sense to warn about that. :)

Why not? LLDB doesn't have support for assembler as a source language, no assembler expression evaluator, etc..

I don't have much experience debugging assembler sources with LLDB, so I"m not sure about the expectations.