aykevl updated this revision to Diff 240857. aykevl added a comment. Herald added subscribers: MaskRay, emaste. Herald added a reviewer: espindola.
@labath Thank you for the quick review! I have added a test per your suggestions. I'm not very familiar with lldb but this passes the tests. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73539/new/ https://reviews.llvm.org/D73539 Files: lldb/include/lldb/Utility/ArchSpec.h lldb/source/Utility/ArchSpec.cpp lldb/test/Shell/ObjectFile/ELF/avr-basic-info.yaml Index: lldb/test/Shell/ObjectFile/ELF/avr-basic-info.yaml =================================================================== --- /dev/null +++ lldb/test/Shell/ObjectFile/ELF/avr-basic-info.yaml @@ -0,0 +1,30 @@ +# RUN: yaml2obj %s > %t +# RUN: lldb-test object-file %t | FileCheck %s +# CHECK: Plugin name: elf +# CHECK: Architecture: avr-- +# CHECK: Executable: true +# CHECK: Stripped: false +# CHECK: Type: executable +# CHECK: Strata: user +# CHECK: Name: .text +# CHECK-NEXT: Type: code +# CHECK-NEXT: Permissions: r-x +# CHECK-NEXT: Thread specific: no +# CHECK-NEXT: VM address: 0x0 +# CHECK-NEXT: VM size: 4 +# CHECK-NEXT: File size: 4 + +--- !ELF +FileHeader: + Class: ELFCLASS32 + Data: ELFDATA2LSB + Type: ET_EXEC + Machine: EM_AVR + Flags: [ EF_AVR_ARCH_AVR1, EF_AVR_ARCH_AVR4 ] +Sections: + - Name: .text + Type: SHT_PROGBITS + Flags: [ SHF_ALLOC, SHF_EXECINSTR ] + AddressAlign: 0x0000000000000001 + Content: '0000FECF' +... Index: lldb/source/Utility/ArchSpec.cpp =================================================================== --- lldb/source/Utility/ArchSpec.cpp +++ lldb/source/Utility/ArchSpec.cpp @@ -218,6 +218,8 @@ ArchSpec::eCore_uknownMach64, "unknown-mach-64"}, {eByteOrderLittle, 4, 2, 4, llvm::Triple::arc, ArchSpec::eCore_arc, "arc"}, + {eByteOrderLittle, 2, 2, 4, llvm::Triple::avr, ArchSpec::eCore_avr, "avr"}, + {eByteOrderLittle, 4, 1, 4, llvm::Triple::wasm32, ArchSpec::eCore_wasm32, "wasm32"}, }; @@ -448,6 +450,8 @@ LLDB_INVALID_CPUTYPE, 0xFFFFFFFFu, 0xFFFFFFFFu}, // HEXAGON {ArchSpec::eCore_arc, llvm::ELF::EM_ARC_COMPACT2, LLDB_INVALID_CPUTYPE, 0xFFFFFFFFu, 0xFFFFFFFFu}, // ARC + {ArchSpec::eCore_avr, llvm::ELF::EM_AVR, LLDB_INVALID_CPUTYPE, + 0xFFFFFFFFu, 0xFFFFFFFFu}, // AVR }; static const ArchDefinition g_elf_arch_def = { Index: lldb/include/lldb/Utility/ArchSpec.h =================================================================== --- lldb/include/lldb/Utility/ArchSpec.h +++ lldb/include/lldb/Utility/ArchSpec.h @@ -188,6 +188,8 @@ eCore_arc, // little endian ARC + eCore_avr, + eCore_wasm32, kNumCores,
Index: lldb/test/Shell/ObjectFile/ELF/avr-basic-info.yaml =================================================================== --- /dev/null +++ lldb/test/Shell/ObjectFile/ELF/avr-basic-info.yaml @@ -0,0 +1,30 @@ +# RUN: yaml2obj %s > %t +# RUN: lldb-test object-file %t | FileCheck %s +# CHECK: Plugin name: elf +# CHECK: Architecture: avr-- +# CHECK: Executable: true +# CHECK: Stripped: false +# CHECK: Type: executable +# CHECK: Strata: user +# CHECK: Name: .text +# CHECK-NEXT: Type: code +# CHECK-NEXT: Permissions: r-x +# CHECK-NEXT: Thread specific: no +# CHECK-NEXT: VM address: 0x0 +# CHECK-NEXT: VM size: 4 +# CHECK-NEXT: File size: 4 + +--- !ELF +FileHeader: + Class: ELFCLASS32 + Data: ELFDATA2LSB + Type: ET_EXEC + Machine: EM_AVR + Flags: [ EF_AVR_ARCH_AVR1, EF_AVR_ARCH_AVR4 ] +Sections: + - Name: .text + Type: SHT_PROGBITS + Flags: [ SHF_ALLOC, SHF_EXECINSTR ] + AddressAlign: 0x0000000000000001 + Content: '0000FECF' +... Index: lldb/source/Utility/ArchSpec.cpp =================================================================== --- lldb/source/Utility/ArchSpec.cpp +++ lldb/source/Utility/ArchSpec.cpp @@ -218,6 +218,8 @@ ArchSpec::eCore_uknownMach64, "unknown-mach-64"}, {eByteOrderLittle, 4, 2, 4, llvm::Triple::arc, ArchSpec::eCore_arc, "arc"}, + {eByteOrderLittle, 2, 2, 4, llvm::Triple::avr, ArchSpec::eCore_avr, "avr"}, + {eByteOrderLittle, 4, 1, 4, llvm::Triple::wasm32, ArchSpec::eCore_wasm32, "wasm32"}, }; @@ -448,6 +450,8 @@ LLDB_INVALID_CPUTYPE, 0xFFFFFFFFu, 0xFFFFFFFFu}, // HEXAGON {ArchSpec::eCore_arc, llvm::ELF::EM_ARC_COMPACT2, LLDB_INVALID_CPUTYPE, 0xFFFFFFFFu, 0xFFFFFFFFu}, // ARC + {ArchSpec::eCore_avr, llvm::ELF::EM_AVR, LLDB_INVALID_CPUTYPE, + 0xFFFFFFFFu, 0xFFFFFFFFu}, // AVR }; static const ArchDefinition g_elf_arch_def = { Index: lldb/include/lldb/Utility/ArchSpec.h =================================================================== --- lldb/include/lldb/Utility/ArchSpec.h +++ lldb/include/lldb/Utility/ArchSpec.h @@ -188,6 +188,8 @@ eCore_arc, // little endian ARC + eCore_avr, + eCore_wasm32, kNumCores,
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits