LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-12-2004, 04:49 PM   #1
BradDaBug
LQ Newbie
 
Registered: May 2002
Posts: 29

Rep: Reputation: 15
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.

Last edited by BradDaBug; 04-12-2004 at 04:57 PM.
 
Old 05-06-2004, 05:31 AM   #2
Beaven
LQ Newbie
 
Registered: May 2004
Location: Nottingham
Posts: 1

Rep: Reputation: 1
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
 
1 members found this post helpful.
Old 09-14-2004, 06:12 PM   #3
sonitbk
LQ Newbie
 
Registered: Mar 2004
Location: Russia
Posts: 8

Rep: Reputation: 0
thanks for help...I had similar thing..and this helps..thanks again.
 
Old 03-20-2012, 08:19 AM   #4
dombrowsky
Member
 
Registered: Dec 2005
Location: New York
Distribution: Debian/GNU
Posts: 235

Rep: Reputation: 31
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
(gdb) r
Starting program: /a.out
Cannot exec /a.out -c exec /a.out .
Error: No such file or directory
During startup program exited with code 127.
fix:
Code:
# export SHELL=/bin/sh
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
gdb error lucky6969b Linux - Software 1 11-30-2005 08:26 PM
Gdb error on Aix 4.3.3 ayeletr AIX 3 04-05-2004 10:57 PM
error in emacs with gdb varala_kanth Linux - Software 0 04-05-2004 01:40 AM
emacs with gdb error varala_kanth Linux - Software 0 04-03-2004 05:24 AM
wierd gdb error teval Programming 13 08-21-2003 11:15 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:21 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration