From owner-freebsd-questions Sun May 16 7:24: 6 1999 Delivered-To: freebsd-questions@freebsd.org Received: from fep04-svc.tin.it (mta04-acc.tin.it [212.216.176.35]) by hub.freebsd.org (Postfix) with ESMTP id 4954215017 for ; Sun, 16 May 1999 07:23:51 -0700 (PDT) (envelope-from gimatra@tin.it) Received: from tin.it ([212.216.200.36]) by fep04-svc.tin.it (InterMail v4.0 201-221-105) with ESMTP id <19990516142350.ERYK3147.fep04-svc@tin.it> for ; Sun, 16 May 1999 16:23:50 +0200 Message-ID: <373EB204.BD1DE491@tin.it> Date: Sun, 16 May 1999 13:54:44 +0200 From: Ugo Matrangolo Organization: PULSEnet X-Mailer: Mozilla 4.5 [en] (X11; I; FreeBSD 3.1-RELEASE i386) X-Accept-Language: en MIME-Version: 1.0 To: freebsd-questions@freebsd.org Subject: newbie : gdb and 386's machine code Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hi , Cause i have to do some coding in 'pure' assembly language (college exam) i have to find a way to write pure x86 code under freebsd . Now , i can easily write asm code using nasm and run it using this C code that wraps my asm program : #include extern void start(void); int main(void) { start(); return 0; } ... and this is a sample asm code : ; hello.s -- Simple test program . BITS 32 GLOBAL start ; exported syms EXTERN printf ; imported syms SECTION .text start: push ebp mov esp,ebp push dword hello_string call printf add esp,4 mov ebp,esp pop ebp ret SECTION .data hello_string db "Hello World!",10,0 SECTION .bss After compiling this with nasm & gcc ,it runs fine . Now , what if i want to debug the asm code instruction by instruction ? If i use gdb,placing a breakpoint on start(),"step"/"next" jumps over the start() routine ! All i can do ( i think ! )is to put a breakpoint in memory ,run the code, and see what are the registers but i don't know how to execute every single instructions . How can i do it using gdb or any other debugger (?) under freebsd ? Please , i don't want to reinstall dos on my box !;-) bye! To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message