Fix Bug 232051 - Make jprof work with Fedora Core1. The stack walking code

did not work on that platform. r=dbaron sr=dbaron.
This commit is contained in:
jim_nance%yahoo.com 2004-01-25 01:51:39 +00:00
Родитель b33678fe6a
Коммит 02a08d62dc
1 изменённых файлов: 2 добавлений и 8 удалений

Просмотреть файл

@ -88,13 +88,7 @@ static void CrawlStack(malloc_log_entry* me, jmp_buf jb, char* first)
#ifdef JPROF_PTHREAD_HACK #ifdef JPROF_PTHREAD_HACK
int skip = 3; int skip = 3;
#else #else
// This is a linux hack we have to do to figure out where the signal was me->pcs[numpcs++] = first;
// called from. Only use |first| if it looks like a reasonable value
// (sometimes it's not -- in this case we'll just lose the lowest frame
// before the signal invocation).
if (first >= (char *)0x08000000 && first <= (char *)0x7fffffff) {
me->pcs[numpcs++] = first;
}
// skip 2 frames: StackHook, __restore_rt. // skip 2 frames: StackHook, __restore_rt.
// The next frame is the frame _above_ |first|. // The next frame is the frame _above_ |first|.
@ -106,7 +100,7 @@ static void CrawlStack(malloc_log_entry* me, jmp_buf jb, char* first)
#ifdef JPROF_PTHREAD_HACK #ifdef JPROF_PTHREAD_HACK
if ((pc < 0x08000000) || ((pc > 0x7fffffff) && (skip <= 0)) || (nextbp < bp)) { if ((pc < 0x08000000) || ((pc > 0x7fffffff) && (skip <= 0)) || (nextbp < bp)) {
#else #else
if ((pc < 0x08000000) || (pc > 0x7fffffff) || (nextbp < bp)) { if ((nextbp < bp)) {
#endif #endif
break; break;
} }