[Lldb-commits] [PATCH] lldb: To allow cross-compilation of Linux/ProcessMonitor.cpp, hide PC-related stuff behind #ifdef's

Todd Fiala tfiala at google.com
Tue Jun 10 13:18:58 PDT 2014


Hey Paul,

Am I understanding you correctly that you are trying to cross compile this
for Linux on a non-Linux box?

-Todd


On Tue, Jun 10, 2014 at 12:51 PM, Paul Osmialowski <pawelo at king.net.pl>
wrote:

> To allow cross-compilation of Linux/ProcessMonitor.cpp, hide PC-related
> stuff behind #ifdef's. Note that struct user used in affected code has a
> field named i387 which is x86-specific, therefore it should be compiled
> only for PC.
>
> http://reviews.llvm.org/D4092
>
> Files:
>   source/Plugins/Process/Linux/ProcessMonitor.cpp
>
> Index: source/Plugins/Process/Linux/ProcessMonitor.cpp
> ===================================================================
> --- source/Plugins/Process/Linux/ProcessMonitor.cpp
> +++ source/Plugins/Process/Linux/ProcessMonitor.cpp
> @@ -764,6 +764,9 @@
>      const ArchSpec& arch =
> monitor->GetProcess().GetTarget().GetArchitecture();
>      switch(arch.GetMachine())
>      {
> +#if defined(__i386__) || defined(__x86_64__)
> +    // note that struct user used below has field named i387 which is
> x86-specific
> +    // therefore case below should be compiled only for PC
>      case llvm::Triple::x86:
>      {
>          // Find the GS register location for our host architecture.
> @@ -790,6 +793,7 @@
>          *m_addr = tmp[1];
>          break;
>      }
> +#endif
>      case llvm::Triple::x86_64:
>          // Read the FS register base.
>          m_result = (PTRACE(PTRACE_ARCH_PRCTL, m_tid, m_addr, (void
> *)ARCH_GET_FS, 0) == 0);
>
> _______________________________________________
> lldb-commits mailing list
> lldb-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
>
>


-- 
Todd Fiala | Software Engineer | tfiala at google.com | 650-943-3180
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20140610/815b163f/attachment.html>


More information about the lldb-commits mailing list