problem with setting BP in GDB

here is the code that i used with command line GDB and DDD GUI interface for GDB
I tried setting the break points and used the right assembler options and linking options .
Thou the programm dosnt stop at the BP i advice it to stop at

%include "io.mac"


char_prompt db "Please input a character: ", 0
out_msg1 db "The ASCII code of '", 0
out_msg2 db "' in binary is ", 0
query_msg db "Do you want to quit (Y/N): ", 0


PutStr char_prompt
GetCh AL

PutStr out_msg1
PutCh AL
PutStr out_msg2
PutCh AH
BP mov AH, 80H
mov CX, 8

BP test AL, AH
jz print_0
PutCh '1'
jmp skip1
PutCh '0'
shr AH, 1

loop print_bit
PutStr query_msg
GetCh AL
cmp AL, 'Y'
jne read_char


I use these steps to assemble and link the programm

nasm -f elf -g -F stabs
ld -o io.o

then i start debugger as such ..


then i set the breakpoints with these commands
(gdb) break which in my case is 20 and 24 .

I have writting BP in the code above to let you know where the brek points are .

Then when i execute the program with a
the programm runs till its normal end . Thou the Debugger dosnt break at the where the breakpoints are set .

Please let me know what the proble is .. I tried doing everything by the book but it dosnt work .
Oh one thing is . That if i set the break point where i would be calling a function .
With Call it breaks there only
so if i do .

Set break points on all Functions . They break but not where i want it to .


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!