[Lldb-commits] [PATCH] D70847: [lldb] Set executable module when adding modules to the Target

Anton Kolesov via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Jan 31 04:41:56 PST 2020


anton.kolesov added inline comments.


================
Comment at: lldb/packages/Python/lldbsuite/test/commands/target/set-exec/TestSetExecutable.py:16
+        """Test adding images to the target."""
+        self.build()
+
----------------
labath wrote:
> anton.kolesov wrote:
> > clayborg wrote:
> > > Create a yaml file and put it in the same directory as this file. Change this line to be:
> > > ```
> > >         src_dir = self.getSourceDir()
> > >         yaml_path = os.path.join(src_dir, "a.yaml")
> > >         obj_path = self.getBuildArtifact("a.out")
> > >         self.yaml2obj(yaml_path, obj_path)
> > > ```
> > > Make an ELF file that that is for a remote platform where the triple and platform won't match typical hosts.
> > Do you have any specific suggestions that also have freely available toolchain? I have immediate access only to Windows/Linux x86 and Synopsys ARC, and ARC elf files don't change the platform - it remains as "host" even when connecting to a GDB-server, plus obj2yaml segfaults on ARC elf files.
> Would this do the job?
> ```
> --- !ELF
> FileHeader:
>   Class:           ELFCLASS64
>   Data:            ELFDATA2LSB
>   Type:            ET_DYN
>   Machine:         EM_AARCH64
>   Entry:           0x00000000000006C0
> Sections:
>   - Name:            .text
>     Type:            SHT_PROGBITS
>     Flags:           [ SHF_ALLOC, SHF_EXECINSTR ]
>     Address:         0x00000000000006C0
>     AddressAlign:    0x0000000000000008
>     Content:         DEADBEEF
> ...
> ```
It is definitely needed to change ET_DYN to ET_EXEC in this yaml, because the patch specifically modifies behavior only for executables. With that change this works on my x86_64/Linux, but I don't known how it will behave if test would be run on aarch64 host - will platform still change to "remote-linux" for this ELF or will it remain at "host"? I'm not sure how this process of platform selection works - can it distinguish between elf for aarch64-linux and elf for baremetal aarch64-elf?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70847/new/

https://reviews.llvm.org/D70847





More information about the lldb-commits mailing list