Martijn Bos
2023-11-30 09:00:11 UTC
All,
It has been 30+ years since I played around with some assembly.
Just for learning purposes I'm doing some more playing :-)
First some information :
The system I'm on:
[***@fedora asm]$ uname -a
Linux fedora 6.2.15-100.fc36.x86_64 #1 SMP PREEMPT_DYNAMIC Thu May 11 16:51:53 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
[***@fedora asm]$
Then for completeness also the program (for this particular problem I do not think it's that relevant :-) ):
[***@fedora asm]$ cat een.asm
section .data
section .text
global _start
_start:
mov al, 1 ; mov 1 into the al register
add al, 1 ; add one to the al register
mov rax, 60 ; syscall for exit
mov rdi, 0 ; Return code
syscall
[***@fedora asm]$
Then I compile, link and run the progrm:
[***@fedora asm]$ nasm -f elf64 -gdwarf een.asm
[***@fedora asm]$ ld -m elf_x86_64 -o een een.o
[***@fedora asm]$ ./een
[***@fedora asm]$
So far so good (I think):
But I want to see what is actually happening, so I want to see it in my debugger :
[***@fedora asm]$ gdb een
GNU gdb (GDB) Fedora 12.1-2.fc36
....
....
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from een...
(gdb) list
1 section .data
2
3 section .text
4
5 global _start
6
7 _start:
8 mov al, 1 ; mov 1 into the al register
9
10 add al, 1 ; add one to the al register
(gdb) break 8
No line 8 in the current file.
Make breakpoint pending on future shared library load? (y or [n]) n
(gdb)
As you can see I can not set a breakpoint. And that's my problem.
Whitout breakpoints I can not step through my program.
Does anyone have any pointers/tips/trics on how to resolve this issue.
(I know myself...I probably oversee the obvious...do not hesitate to point that out)
Best Regards,
Martijn Bos
It has been 30+ years since I played around with some assembly.
Just for learning purposes I'm doing some more playing :-)
First some information :
The system I'm on:
[***@fedora asm]$ uname -a
Linux fedora 6.2.15-100.fc36.x86_64 #1 SMP PREEMPT_DYNAMIC Thu May 11 16:51:53 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
[***@fedora asm]$
Then for completeness also the program (for this particular problem I do not think it's that relevant :-) ):
[***@fedora asm]$ cat een.asm
section .data
section .text
global _start
_start:
mov al, 1 ; mov 1 into the al register
add al, 1 ; add one to the al register
mov rax, 60 ; syscall for exit
mov rdi, 0 ; Return code
syscall
[***@fedora asm]$
Then I compile, link and run the progrm:
[***@fedora asm]$ nasm -f elf64 -gdwarf een.asm
[***@fedora asm]$ ld -m elf_x86_64 -o een een.o
[***@fedora asm]$ ./een
[***@fedora asm]$
So far so good (I think):
But I want to see what is actually happening, so I want to see it in my debugger :
[***@fedora asm]$ gdb een
GNU gdb (GDB) Fedora 12.1-2.fc36
....
....
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from een...
(gdb) list
1 section .data
2
3 section .text
4
5 global _start
6
7 _start:
8 mov al, 1 ; mov 1 into the al register
9
10 add al, 1 ; add one to the al register
(gdb) break 8
No line 8 in the current file.
Make breakpoint pending on future shared library load? (y or [n]) n
(gdb)
As you can see I can not set a breakpoint. And that's my problem.
Whitout breakpoints I can not step through my program.
Does anyone have any pointers/tips/trics on how to resolve this issue.
(I know myself...I probably oversee the obvious...do not hesitate to point that out)
Best Regards,
Martijn Bos