🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.asm.x86
Article #142

Re: Debugging GNU assembler on FreeBSD

#142
From: wbinvd
Date: Fri, 01 May 1998 00:00
30 lines
2397 bytes
In article <6icd56$b46$1@winter.news.erols.com>#1/1,
  "Eric Fowler" <v-ericfo@microsoft.com> wrote:
>
> I have some GNU assembler code running on FreeBSD. I am assembling using
> the gcc compiler/'as'-driver and would like to debug with gdb. To further
> establish my credentials as a masochist, I am doing this in text mode using
> vi.
> I can easily get gcc-compiled C code to generate symbols, but if I pass the
> -ggdb or the -g flag to gcc for assembler code, I get a binary that has no
> symbols(at least, that's what gdb says). How can I debug my assembler
> source in gdb?
>
>

I tried using GDB in linux, but AS can't include debugging stuff in the
.o files. What's even worse, you can only set breakpoints on labels in GDB,
not where you want the breakpoint to be set.
It's hard to debug an ASM only program with GNU tools.

One way could be to put all your ASM code in a C/C++ file and then
"compile" it and then run it with GDB. You can also check the .s file
(the .s file gcc produced from your "C" file) to see how they add debugging
symbols. There's also a command line switch you can pass to gcc and it will
print all files it executes including the command line it passes to them
(so you know what options to pass to AS).
See in the man page for all options.

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading
Technical Details
Message-ID: <6id5sc$5s1$1@winter.news.erols.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <6icd56$b46$1@winter.news.erols.com>#1/1

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,dcec7446a040194f
X-Google-Attributes: gid11318c,public
X-Google-Thread: 114917,dcec7446a040194f
X-Google-Attributes: gid114917,public
X-Google-Thread: 10ba33,dcec7446a040194f
X-Google-Attributes: gid10ba33,public
From: wbinvd@mail.bip.net
Subject: Re: Debugging GNU assembler on FreeBSD
Date: 1998/05/01
Message-ID: <6id5sc$5s1$1@winter.news.erols.com>
X-Deja-AN: 349388135
Approved: <johnfine@erols.com>
References: <6icd56$b46$1@winter.news.erols.com>#1/1
X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 4.01; Windows 95)
X-Mozilla-Status: 0801
X-Complaints-To: abuse@erols.com
X-UIDL: 874c02e0ec
X-Trace: winter.news.erols.com 894048972 6017 207.172.241.99 (1 May 1998 18:56:12 GMT)
Organization: Deja News - The Leader in Internet Discussion
X-Article-Creation-Date: Fri May 01 17:29:30 1998 GMT
Newsgroups: comp.lang.asm.x86,gnu.gcc.help,gnu.g++.help