简体   繁体   中英

Getting error while debugging a C program in gdb mode

When I tried to run binary in gdb mode I am getting the below mentioned error message .Please find the error message in the attachment

(gdb)  r /devl/aaa/BINARY/pfm.sql_Kavitha /devl/aaa/AVP/OCT_TEST /devl/aaa/ASAPDATA/READONLY /devl/aaa/ASAPDATA/READONLY 17 kk12345
Starting program:  /devl/aaa/BINARY/pfm.sql_Kavitha /devl/aaa/AVP/OCT_TEST /devl/aaa/ASAPDATA/READONLY /devl/aaa/ASAPDATA/READONLY 17 kk12345
**No executable file specified.
Use the "file" or "exec-file" command.**

Please let me know if anybody knows how to resolve this issue.

thanks

Invoke gdb as:

gdb /devl/aaa/BINARY/pfm.sql_Kavitha

and then run the program from within gdb as:

(gdb) r /devl/aaa/BINARY/pfm.sql_Kavitha /devl/aaa/AVP/OCT_TEST /devl/aaa/ASAPDATA/READONLY /devl/aaa/ASAPDATA/READONLY 17 kk12345

(gdb) above is the prompt.

If you want to be able to specify the program to execute from within gdb, use file command, as the error message says:

(gdb) file /devl/aaa/BINARY/pfm.sql_Kavitha

followed by the r command as above.

There is some problem with the file you are trying to run from gdb -- either it is a corrupted file or the path is wrong. Try "gdb {filename}".

Instead of a single command, you will need two. One to specify the binary file and another to run the binary. In your case the commands are:

file /devl/aaa/BINARY/pfm.sql_Kavitha
run /devl/aaa/AVP/OCT_TEST /devl/aaa/ASAPDATA/READONLY /devl/aaa/ASAPDATA/READONLY 17 kk12345

Alternatively, instead of using the file command, you can give the binary name to gdb as an argument when you start gdb. Also notice the syntax of the run command. The binary name is not repeated!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM