Author: emaste
Date: Sat Jul  9 00:35:20 2016
New Revision: 302475
URL: https://svnweb.freebsd.org/changeset/base/302475

Log:
  libunwind: limit stack usage in unwind cursor
  
  This may be reworked upstream but in the interim should address the
  stack usage issue reported in the PR.
  
  PR:           206384
  MFC after:    1 week
  Sponsored by: The FreeBSD Foundation

Modified:
  head/contrib/llvm/projects/libunwind/include/__libunwind_config.h
  head/contrib/llvm/projects/libunwind/src/DwarfParser.hpp

Modified: head/contrib/llvm/projects/libunwind/include/__libunwind_config.h
==============================================================================
--- head/contrib/llvm/projects/libunwind/include/__libunwind_config.h   Fri Jul 
 8 23:44:09 2016        (r302474)
+++ head/contrib/llvm/projects/libunwind/include/__libunwind_config.h   Sat Jul 
 9 00:35:20 2016        (r302475)
@@ -22,30 +22,37 @@
 #  define _LIBUNWIND_TARGET_I386 1
 #  define _LIBUNWIND_CONTEXT_SIZE 8
 #  define _LIBUNWIND_CURSOR_SIZE 19
+#  define _LIBUNWIND_MAX_REGISTER 9
 # elif defined(__x86_64__)
 #  define _LIBUNWIND_TARGET_X86_64 1
 #  define _LIBUNWIND_CONTEXT_SIZE 21
 #  define _LIBUNWIND_CURSOR_SIZE 33
+#  define _LIBUNWIND_MAX_REGISTER 17
 # elif defined(__ppc__)
 #  define _LIBUNWIND_TARGET_PPC 1
 #  define _LIBUNWIND_CONTEXT_SIZE 117
 #  define _LIBUNWIND_CURSOR_SIZE 128
+#  define _LIBUNWIND_MAX_REGISTER 113
 # elif defined(__aarch64__)
 #  define _LIBUNWIND_TARGET_AARCH64 1
 #  define _LIBUNWIND_CONTEXT_SIZE 66
 #  define _LIBUNWIND_CURSOR_SIZE 78
+#  define _LIBUNWIND_MAX_REGISTER 96
 # elif defined(__arm__)
 #  define _LIBUNWIND_TARGET_ARM 1
 #  define _LIBUNWIND_CONTEXT_SIZE 60
 #  define _LIBUNWIND_CURSOR_SIZE 67
+#  define _LIBUNWIND_MAX_REGISTER 96
 # elif defined(__or1k__)
 #  define _LIBUNWIND_TARGET_OR1K 1
 #  define _LIBUNWIND_CONTEXT_SIZE 16
 #  define _LIBUNWIND_CURSOR_SIZE 28
+#  define _LIBUNWIND_MAX_REGISTER 32
 # elif defined(__riscv__)
 #  define _LIBUNWIND_TARGET_RISCV 1
 #  define _LIBUNWIND_CONTEXT_SIZE 128 /* XXX */
 #  define _LIBUNWIND_CURSOR_SIZE 140 /* XXX */
+#  define _LIBUNWIND_MAX_REGISTER 96
 # else
 #  error "Unsupported architecture."
 # endif
@@ -58,6 +65,7 @@
 # define _LIBUNWIND_TARGET_OR1K 1
 # define _LIBUNWIND_CONTEXT_SIZE 128
 # define _LIBUNWIND_CURSOR_SIZE 140
+# define _LIBUNWIND_MAX_REGISTER 120
 #endif // _LIBUNWIND_IS_NATIVE_ONLY
 
 #endif // ____LIBUNWIND_CONFIG_H__

Modified: head/contrib/llvm/projects/libunwind/src/DwarfParser.hpp
==============================================================================
--- head/contrib/llvm/projects/libunwind/src/DwarfParser.hpp    Fri Jul  8 
23:44:09 2016        (r302474)
+++ head/contrib/llvm/projects/libunwind/src/DwarfParser.hpp    Sat Jul  9 
00:35:20 2016        (r302475)
@@ -62,7 +62,7 @@ public:
   };
 
   enum {
-    kMaxRegisterNumber = 120
+    kMaxRegisterNumber = _LIBUNWIND_MAX_REGISTER
   };
   enum RegisterSavedWhere {
     kRegisterUnused,
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to