Subject: Re: debugging x86 assembly
To: None <collver@linuxfreemail.com>
From: Jaromir Dolecek <jdolecek@netbsd.org>
List: port-i386
Date: 03/05/2002 23:42:58
FWIW, on -current with gdb 5.0nb1, it works fine - the list command
gives:

> gdb ./t2
GNU gdb 5.0nb1
Copyright 2000 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386--netbsdelf"...
(gdb) list
1       .section ".note.netbsd.ident", "a"
2       .long 2f-1f
3       .long 4f-3f
4       .long 1
5       1: .asciz "NetBSD"
6       2: .p2align 2
7       3: .long 199905
8       4: .p2align 2
9
10      .data

So, this might be more problem of used gdb than anything else.
gdb on 1.5.2 is 4.17 IIRC, which version does your friend have
on his linux box?

Jaromir

collver@linuxfreemail.com wrote:
> I am using NetBSD 1.5.2 i386.
> 
> I am attempting to debug some x86 code written in assembler.  When I write
> assembler code that uses the C environment (crt0.o crtbegin.o crtend.o
> -lgcc -lc), I am able to debug it with gdb.  When I write standalone code,
> I am unable to debug it.
> 
> When I type "list" in gdb, the error is "Can't find a default source file"
> 
> The code is at http://backyard.heliacal.net/t2.s
> 
> A friend tried the same on his x86 Linux box (removing the
> .note.netbsd.ident section and using the Linux system call interface).  He
> was able to list and debug the code within gdb.
> 
> Would someone give me a clue why I can't debug the above code?


-- 
Jaromir Dolecek <jdolecek@NetBSD.org> http://www.NetBSD.org/Ports/i386/ps2.html
-=- We should be mindful of the potential goal, but as the tantric    -=-
-=- Buddhist masters say, ``You may notice during meditation that you -=-
-=- sometimes levitate or glow.   Do not let this distract you.''     -=-