This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [PATCH]: (alpha) heuristic_proc_start
- To: msnyder at cygnus dot com
- Subject: Re: [PATCH]: (alpha) heuristic_proc_start
- From: Guy Harris <guy at netapp dot com>
- Date: Wed, 26 Jul 2000 14:23:25 -0700 (PDT)
- CC: gdb-patches at sourceware dot cygnus dot com, Eirik Fuller <eirik at netapp dot com>
> This one looks very suspect to me:
> someone with Alpha knowledge, can you evaluate it?
[Eirik, this is your patch to GDB on Alpha to handle crashes/core
dumps caused by dereferencing a null function pointer - it
showed up on crashes from our appliances, but I ahve a program
that can make it happen on Digital UNIX and probably other Alpha
UNIXes as well.
The test program catches SIGSEGV and thus causes the signal
frame to be followed by regular frames; GDB can't handle that.
I've attached the test program in question.]
I don't know if this is The Right Way to handle this, but I'm not sure
what The Right Way is.
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <signal.h>
void (*bloop)(void) = NULL;
static void catchme(int);
int
main(int argc, char **argv)
{
struct sigaction hello;
hello.sa_handler = catchme;
hello.sa_mask = 0;
hello.sa_flags = 0;
if (sigaction(SIGSEGV, &hello, NULL) < 0) {
fprintf(stderr, "sigaction failed: %s\n", strerror(errno));
return 2;
}
(*bloop)();
return 1;
}
static void
catchme(int signo)
{
abort();
}