In a book I read, the author's CPU was 32-bit. Mine is 64-bit. I run the NASM assembler in the terminal with:
nasm -f elf -g -F stabs asmwork/eatsyscall.asm
Then I run the linker:
ld -o eatsyscall eatsyscall.o
This returned:
ld: i386 architecture of input file eatsyscall.o
is incompatible with i386:x86-64 output
I read some answers and it said I needed to use elf64
(not as the book said).
I run the assembler and it solved this message.
Now I run in the terminal kdbg eatsyscall.o
. It opens the KDbg software and KDbg: Program output.
I select a breakpoint in a line and as usual a red circle appears. I click run and the red circle is not changed for an arrow. Instead in the KDbg: Program output it outputs this message (I'm not showing where the .o
file is as in the output it is written):
warning: GDB: Failed to set controlling terminal: Operation not permitted
/bin/bash: Permission denied
/bin/bash: line 0: exec: cannot execute: Permission denied.
Or on one occasion, just this message:
warning: GDB: Failed to set controlling terminal: Operation not permitted
In Settings > Global Options I have the following.
- How to invoke GDB:
gdb --fullname --nx
- Terminal for program output:
xterm -name kdbgio -title %T -e sh -c %C
What can I do? Why do I get a permission error? Is it something related to the command sudo
?
UPDATE
For running the debugger I have used kdbg program
and kdbg ./program
.
The executable file I want to debug is called program
and it is located in the folder asmwork
. When my working directory is with that folder, I write ls -l
and I get the following about the file:
-rwxrwxr-x 1 user user 1304 יול 24 17:56 program