I find gdb very "unfriendly", and so use some other debugger when possible. However:
; nasm -f elf32 -F dwarf hw.asm
; ld -o hw hw.o
; gdb hw
; break bp1
; run
; step
; step
; ...
global _start
section .data
msg db 'Hello, world',0Ah
msg_len equ $-msg
section .text
_start:
nop ; parking place for gdb
bp1:
mov eax,4
mov ebx,1
mov ecx, msg
mov edx,msg_len
int 80h
bp2:
mov eax,1
int 80h
Works for me... I can't help ya with Mac.
Best,
Frank