I'm learning gdb and have one example that is supposed to core dump but instead I get a bus error and no core dump file to look at -bummer.
Below is the example that I'm using. It tries to set the 0x0 address which is illegal.
/* ---------------------------
char **nowhere;
void setbad();
int main(int argc, char *argv[])
{
setbad();
printf("%s\n", *nowhere);
}
void setbad(){
nowhere = 0;
*nowhere = "This is a string\n";
}
/* ---------------------------
So, it would be great if you folks can provide this newbie with some code that would actually generate a core dump file.
Thanks!