This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

gdb exits with segmentation fault


I hope I am at the right forum.
I am trying to run simplest program - 

#include <stdio.h>

int  main(int argc, char *args[])
{
        int num1;
        num1 = 10;
        printf("VALUE OF NUM1=%d\n",num1);
        return 0;
}

i can run the program - 

[nitin@localhost shellCode]$ ./simple
VALUE OF NUM1=10

But gdb exits with segmentation fault - 

[nitin@localhost shellCode]$ gdb simple 
GNU gdb 6.0
Copyright 2003 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...
(gdb) run
Starting program: simple 
Segmentation fault
[nitin@localhost shellCode]$ 

I am using Mandrake 10 with a kernel 2.6.3-7mdk. and the gdb
is 6.0 - quite old, but i have some requirement.
I have compiled gdb from source as it was not installed. 
While compiling gdb i dint get any errors.
I cant figure out whats wrong with gdb. It's happening with
all executable programs. Can run few other commands like
disassemble, help but not run.

Any help would be appreciated.
Thanks a lot.
Nitin
 

-- 
View this message in context: http://www.nabble.com/gdb-exits-with-segmentation-fault-tp23901800p23901800.html
Sent from the Sourceware - gdb list mailing list archive at Nabble.com.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]