Can't run program in debugger?

2019-09-05 17:01发布

问题:

I was trying to use gdb on a program earlier on a Linux 64-bit machine, and I ran gdb bomb (that's the program name), and within gdb, I simply typed in ran. It came back with the error /bin/bash: /home/imicrothinking/ics11302016004/lab2/bomb: No such file or directory During startup program exited with code 127.

I've dug around the net for a bit, and suggestions I've heard so far led to no concrete solutions, here's what I'm sure of so far:

  1. I'm logged on as a root level user.
  2. I haven't gone to the wrong directory.
  3. The executable file definitely exists.

I'd welcome all suggestions.

回答1:

maybe gdb cann't find your shell. so set the env var SHELL to your shell. eg: export SHELL=/bin/bash

ref : http://www.linuxquestions.org/questions/linux-software-2/gdb-giving-wierd-error-169299/



标签: debugging gdb