public inbox for java-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* FYI: Add another sequence that fallback_backtrace() for i386 recognises  as a function prologue
@ 2006-08-19 15:39 Ranjit Mathew
  0 siblings, 0 replies; only message in thread
From: Ranjit Mathew @ 2006-08-19 15:39 UTC (permalink / raw)
  To: java-patches

[-- Attachment #1: Type: text/plain, Size: 826 bytes --]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

  Based on Olivier Parisy's initial bug report and subsequent
confirmation of the utility of a suggested patch:

  http://gcc.gnu.org/ml/java/2006-08/msg00068.html

I've committed the attached patch to the trunk to make
fallback_backtrace() recognise another sequence of bytes
as an encoding for "pushl %ebp; movl %esp, %ebp".

Tested via an i686-pc-linux-gnu to i686-pc-mingw32
cross-compiler.

Thanks,
Ranjit.

- --
Ranjit Mathew       Email: rmathew AT gmail DOT com

Bangalore, INDIA.     Web: http://rmathew.com/




-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFE5zC9Yb1hx2wRS48RAve1AKCET9ACZ58FubxTcIwfGbphiZLsFQCgojs1
Bsxx9vCv8f7V08AC0epwQbM=
=dg+e
-----END PGP SIGNATURE-----

[-- Attachment #2: p1.txt --]
[-- Type: text/plain, Size: 1738 bytes --]

Index: ChangeLog
from  Ranjit Mathew  <rmathew@gcc.gnu.org>

	* sysdep/i386/backtrace.h (fallback_backtrace): Add "0x55 0x8B 0xEC"
	as another sequence that can indicate a "pushl %ebp; movl %esp, %ebp"
	function prologue.

Index: sysdep/i386/backtrace.h
===================================================================
--- sysdep/i386/backtrace.h	(revision 116257)
+++ sysdep/i386/backtrace.h	(working copy)
@@ -71,8 +71,9 @@ fallback_backtrace (_Unwind_Trace_Fn tra
 
       /* Try to locate a "pushl %ebp; movl %esp, %ebp" function prologue
          by scanning backwards at even addresses below the return address.
-         This instruction sequence is encoded as 0x55 0x89 0xE5.  We give up
-         if we do not find this sequence even after scanning 1024K of memory.
+         This instruction sequence is encoded either as 0x55 0x89 0xE5 or as
+         0x55 0x8B 0xEC.  We give up if we do not find this sequence even
+         after scanning 1024K of memory.
          FIXME: This is not robust and will probably give us false positives,
          but this is about the best we can do if we do not have DWARF-2 unwind
          information based exception handling.  */
@@ -83,8 +84,9 @@ fallback_backtrace (_Unwind_Trace_Fn tra
       for ( ; scan_addr >= limit_addr; scan_addr -= 2)
         {
           unsigned char *scan_bytes = (unsigned char *)scan_addr;
-          if (scan_bytes[0] == 0x55 && scan_bytes[1] == 0x89
-              && scan_bytes[2] == 0xE5)
+          if (scan_bytes[0] == 0x55
+              && ((scan_bytes[1] == 0x89 && scan_bytes[2] == 0xE5)
+                  || (scan_bytes[1] == 0x8B && scan_bytes[2] == 0xEC)))
             {
               ctx.meth_addr = scan_addr;
               break;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-08-19 15:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-08-19 15:39 FYI: Add another sequence that fallback_backtrace() for i386 recognises as a function prologue Ranjit Mathew

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).