diff mbox

[6/7] Libsanitizer merge from upstream r249633.

Message ID 561CE931.3010909@partner.samsung.com
State New
Headers show

Commit Message

max Oct. 13, 2015, 11:21 a.m. UTC
This patch adjusts the fix for 
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61771 to extract the last 
PC from the stack frame if no valid FP is available for ARM.

Comments

Jakub Jelinek Oct. 14, 2015, 7:38 a.m. UTC | #1
On Tue, Oct 13, 2015 at 02:21:21PM +0300, Maxim Ostapenko wrote:
> This patch adjusts the fix for
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61771 to extract the last PC
> from the stack frame if no valid FP is available for ARM.

I guess this is ok once all other changes are acked.

> 2015-10-13  Maxim Ostapenko  <m.ostapenko@partner.samsung.com>
> 
> 	* sanitizer_common/sanitizer_stacktrace.cc (GetCanonicFrame): Assume we
> 	compiled code with GCC when extracting the caller PC for ARM if no
> 	valid frame pointer is available.
> 
> Index: libsanitizer/sanitizer_common/sanitizer_stacktrace.cc
> ===================================================================
> --- libsanitizer/sanitizer_common/sanitizer_stacktrace.cc	(revision 250059)
> +++ libsanitizer/sanitizer_common/sanitizer_stacktrace.cc	(working copy)
> @@ -62,8 +62,8 @@
>    // Nope, this does not look right either. This means the frame after next does
>    // not have a valid frame pointer, but we can still extract the caller PC.
>    // Unfortunately, there is no way to decide between GCC and LLVM frame
> -  // layouts. Assume LLVM.
> -  return bp_prev;
> +  // layouts. Assume GCC.
> +  return bp_prev - 1;
>  #else
>    return (uhwptr*)bp;
>  #endif


	Jakub
diff mbox

Patch

2015-10-13  Maxim Ostapenko  <m.ostapenko@partner.samsung.com>

	* sanitizer_common/sanitizer_stacktrace.cc (GetCanonicFrame): Assume we
	compiled code with GCC when extracting the caller PC for ARM if no
	valid frame pointer is available.

Index: libsanitizer/sanitizer_common/sanitizer_stacktrace.cc
===================================================================
--- libsanitizer/sanitizer_common/sanitizer_stacktrace.cc	(revision 250059)
+++ libsanitizer/sanitizer_common/sanitizer_stacktrace.cc	(working copy)
@@ -62,8 +62,8 @@ 
   // Nope, this does not look right either. This means the frame after next does
   // not have a valid frame pointer, but we can still extract the caller PC.
   // Unfortunately, there is no way to decide between GCC and LLVM frame
-  // layouts. Assume LLVM.
-  return bp_prev;
+  // layouts. Assume GCC.
+  return bp_prev - 1;
 #else
   return (uhwptr*)bp;
 #endif