[Lldb-commits] [PATCH] D71797: Fix thread-step-out-ret-addr-check.test PT_GNU_STACK compilation on Windows

Jan Kratochvil via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Sat Dec 21 04:23:17 PST 2019


jankratochvil created this revision.
jankratochvil added reviewers: stella.stamenova, mossberg, labath.
jankratochvil added a project: LLDB.
Herald added a subscriber: krytarowski.
jankratochvil marked an inline comment as done.
jankratochvil added inline comments.


================
Comment at: lldb/test/Shell/Unwind/Inputs/thread-step-out-ret-addr-check.s:22
 
-#ifdef __linux__
         .section .note.GNU-stack,"", at progbits
----------------
That was apparently a comment now.  And OSX does not mind this section.



D71784 <https://reviews.llvm.org/D71784> broke Windows: http://lab.llvm.org:8011/builders/lldb-x64-windows-ninja/builds/11924/steps/test/logs/stdio

  E:\build_slave\lldb-x64-windows-ninja\llvm-project\lldb\test\Shell\Unwind/Inputs/thread-step-out-ret-addr-check.s:23:27: error: unexpected token in directive
          .section .note.GNU-stack,"", at progbits
                            ^

Is this patch OK? I am not sure about the backquotes, `grep` etc. how it can work on Windows. The only other idea I have is to use Python test for it. Or give up on the stack and create some non-executable data section like D71789 <https://reviews.llvm.org/D71789>.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D71797

Files:
  lldb/test/Shell/Unwind/Inputs/thread-step-out-ret-addr-check.s
  lldb/test/Shell/Unwind/thread-step-out-ret-addr-check.test


Index: lldb/test/Shell/Unwind/thread-step-out-ret-addr-check.test
===================================================================
--- lldb/test/Shell/Unwind/thread-step-out-ret-addr-check.test
+++ lldb/test/Shell/Unwind/thread-step-out-ret-addr-check.test
@@ -3,7 +3,8 @@
 
 # REQUIRES: target-x86_64
 
-# RUN: %clang_host %p/Inputs/call-asm.c %p/Inputs/thread-step-out-ret-addr-check.s -o %t
+# RUN: llvm-mc -filetype=asm `%clang_host -print-target-triple|grep -qi linux && echo --defsym LINUX=0` %p/Inputs/thread-step-out-ret-addr-check.s > %t.s
+# RUN: %clang_host %p/Inputs/call-asm.c %t.s -o %t
 # RUN: %lldb %t -s %s -b 2>&1 | FileCheck %s
 
 breakpoint set -n nonstandard_stub
Index: lldb/test/Shell/Unwind/Inputs/thread-step-out-ret-addr-check.s
===================================================================
--- lldb/test/Shell/Unwind/Inputs/thread-step-out-ret-addr-check.s
+++ lldb/test/Shell/Unwind/Inputs/thread-step-out-ret-addr-check.s
@@ -19,6 +19,6 @@
         add $0x10, %rsp
         ret
 
-#ifdef __linux__
+.ifdef LINUX
         .section .note.GNU-stack,"", at progbits
-#endif
+.endif


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71797.235013.patch
Type: text/x-patch
Size: 1113 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20191221/4631b262/attachment.bin>


More information about the lldb-commits mailing list