gdb giving wierd error
I was checking a program I'm working on with valgrind for memory leaks and apparently it found an invalid memory access and threw a segfault. It wouldn't tell me where it happened (well, it did, but I need more info) so I decided to check it out with gdb. Except now whenever I run gdb and try to "run" the program, I get this error:
Starting program: *name of program* Cannot exec : No such file or directory. Program exited with code 0177. You can't do that without a process to debug. I can check ANY program with gdb and it gives this same error. When I try to use Anjuta to debug the program it gives similar error messages. Anyone have any idea what's wrong? Edit: It works when I login as root, but not as a regular user. |
I had a similar problem a while back. gdb is not finding your shell. You need to set the env var SHELL to whatever you're wanting to use. eg. /bin/csh
|
thanks for help...I had similar thing..and this helps..thanks again.
|
Just a post to give props to the answerer. I was working in a chroot environment, which had inherited my SHELL variable as /bin/bash. Since I was in busybox, it only had /bin/sh. Once I fixed that, gdb works fine again. Nice work.
Original error: Code:
(gdb) exec-file a.out Code:
# export SHELL=/bin/sh |
All times are GMT -5. The time now is 06:45 AM. |