* backtrace() for Win32
@ 2002-04-23 18:54 Adam Megacz
2002-04-23 20:15 ` Tom Tromey
0 siblings, 1 reply; 3+ messages in thread
From: Adam Megacz @ 2002-04-23 18:54 UTC (permalink / raw)
To: java
I'm checking this in.
- a
2002-04-23 Adam Megacz <adam@xwt.org>
* win32.cc, include/win32.cc (backtrace): Added this function
because Win32 does not supply it.
Index: win32.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/win32.cc,v
retrieving revision 1.4.8.7
diff -u -r1.4.8.7 win32.cc
--- win32.cc 11 Apr 2002 22:23:56 -0000 1.4.8.7
+++ win32.cc 24 Apr 2002 01:02:23 -0000
@@ -195,3 +195,25 @@
break;
}
}
+
+/* Store up to SIZE return address of the current program state in
+ ARRAY and return the exact number of values stored. */
+int
+backtrace (void **__array, int __size)
+{
+ register void *_ebp __asm__ ("ebp");
+ register void *_esp __asm__ ("esp");
+ unsigned int *rfp;
+
+ int i=0;
+ for (rfp = *(unsigned int**)_ebp;
+ rfp && i < __size;
+ rfp = *(unsigned int **)rfp)
+ {
+ int diff = *rfp - (unsigned int)rfp;
+ if ((void*)rfp < _esp || diff > 4 * 1024 || diff < 0) break;
+
+ __array[i++] = (void*)(rfp[1]-4);
+ }
+ return i;
+}
Index: include/win32.h
===================================================================
RCS file: /cvs/gcc/gcc/libjava/include/win32.h,v
retrieving revision 1.3.8.4
diff -u -r1.3.8.4 win32.h
--- include/win32.h 7 Apr 2002 11:30:09 -0000 1.3.8.4
+++ include/win32.h 24 Apr 2002 01:02:23 -0000
@@ -29,4 +29,10 @@
// Ignore.
}
+#define HAVE_BACKTRACE
+
+/* Store up to SIZE return address of the current program state in
+ ARRAY and return the exact number of values stored. */
+extern int backtrace (void **__array, int __size);
+
#endif /* __JV_WIN32_H__ */
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: backtrace() for Win32
2002-04-23 18:54 backtrace() for Win32 Adam Megacz
@ 2002-04-23 20:15 ` Tom Tromey
2002-04-24 8:55 ` Mark Mitchell
0 siblings, 1 reply; 3+ messages in thread
From: Tom Tromey @ 2002-04-23 20:15 UTC (permalink / raw)
To: Adam Megacz; +Cc: java, Mark Mitchell
>>>>> "Adam" == Adam Megacz <gcj@lists.megacz.com> writes:
Adam> I'm checking this in.
Adam> 2002-04-23 Adam Megacz <adam@xwt.org>
Adam> * win32.cc, include/win32.cc (backtrace): Added this function
Adam> because Win32 does not supply it.
The branch requires Mark's approval for all non-documentation patches
right now. This was announced on the gcc list this morning.
Mark, should we back out this change? Or do you want to approve it
retroactively? I can back it out if that is what you want.
Also, Mark, could you CC notes like the branch-freezing note to the
java list? That would be helpful, since I think not all the Java
developers read the gcc list regularly. If not, I understand. I'd
like to know, though, so I can try to forward pertinent notes myself.
Tom
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: backtrace() for Win32
2002-04-23 20:15 ` Tom Tromey
@ 2002-04-24 8:55 ` Mark Mitchell
0 siblings, 0 replies; 3+ messages in thread
From: Mark Mitchell @ 2002-04-24 8:55 UTC (permalink / raw)
To: tromey, Adam Megacz; +Cc: java, Mark Mitchell
--On Tuesday, April 23, 2002 08:02:57 PM -0600 Tom Tromey
<tromey@redhat.com> wrote:
>>>>>> "Adam" == Adam Megacz <gcj@lists.megacz.com> writes:
>
> Adam> I'm checking this in.
> Adam> 2002-04-23 Adam Megacz <adam@xwt.org>
> Adam> * win32.cc, include/win32.cc (backtrace): Added this
> function Adam> because Win32 does not supply it.
>
> The branch requires Mark's approval for all non-documentation patches
> right now. This was announced on the gcc list this morning.
>
> Mark, should we back out this change? Or do you want to approve it
> retroactively? I can back it out if that is what you want.
I'll approve it retroactively. (I've looked at the patch and it looks
sane.)
> Also, Mark, could you CC notes like the branch-freezing note to the
> java list?
Yes, I'll try to remember to do that. If I forget, feel free to prod
me and/or to forward the notes yourself.
Thanks!
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2002-04-24 15:42 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-23 18:54 backtrace() for Win32 Adam Megacz
2002-04-23 20:15 ` Tom Tromey
2002-04-24 8:55 ` Mark Mitchell
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).