Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  nodelist  faq  login

No line available at 300 baud.


programming / comp.lang.asm.x86 / Re: how to use gdb on a .bin file?

SubjectAuthor
* how to use gdb on a .bin file?bilsch01
`* Re: how to use gdb on a .bin file?Jens Kallup
 `- Re: how to use gdb on a .bin file?bilsch01

1
Subject: how to use gdb on a .bin file?
From: bilsch01
Newsgroups: comp.lang.asm.x86
Organization: A noiseless patient Spider
Date: Thu, 19 Sep 2019 16:56 UTC
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: king...@nospicedham.comcast.net (bilsch01)
Newsgroups: comp.lang.asm.x86
Subject: how to use gdb on a .bin file?
Date: Thu, 19 Sep 2019 09:56:32 -0700
Organization: A noiseless patient Spider
Lines: 5
Approved: fbkotler@myfairpoint.net - comp.lang.asm.x86 moderation team.
Message-ID: <qm0c02$1ko$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: reader02.eternal-september.org; posting-host="6a092641dc4ba3fcabd24b77ad2802dd";
logging-data="4231"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18iQsF9HDJwlKAa1Yqu8P4PwR9qq/vx7kI="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
Thunderbird/60.8.0
Cancel-Lock: sha1:W52u2KC3MkA5UEVZDeuUJ/cdgiI=
View all headers
I stepped away from programming for about 2 years and don't recognize things I did. Mostly I compiled .asm files into .bin files and load and jump to them from the boot sector. I cant get gdb to handle a .bin file - it says it's not executable format.



Subject: Re: how to use gdb on a .bin file?
From: Jens Kallup
Newsgroups: comp.lang.asm.x86
Organization: albasani.net
Date: Thu, 19 Sep 2019 17:19 UTC
References: 1
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: jkal...@nospicedham.web.de (Jens Kallup)
Newsgroups: comp.lang.asm.x86
Subject: Re: how to use gdb on a .bin file?
Date: Thu, 19 Sep 2019 19:19:14 +0200
Organization: albasani.net
Lines: 10
Approved: fbkotler@myfairpoint.net - comp.lang.asm.x86 moderation team.
Message-ID: <qm0dbd$q05$1@news.albasani.net>
References: <qm0c02$1ko$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: reader02.eternal-september.org; posting-host="6a092641dc4ba3fcabd24b77ad2802dd";
logging-data="15784"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/BPE5NmHJHfjbCmooFOJsmqfB8OQ0YNfk="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
Thunderbird/60.6.1
Cancel-Lock: sha1:i3phrSG971L7kN5Hbd10Pq/R+jM=
View all headers
Hello,

You can inject your bin file in a common .o
file by reading the .bin file byte to byte into .c file.
Then you can compile the .c file: gcc -o -g foo.o foo.c
And then, you can debug it with: gdb foo.o

Cheers
Jens



Subject: Re: how to use gdb on a .bin file?
From: bilsch01
Newsgroups: comp.lang.asm.x86
Organization: A noiseless patient Spider
Date: Thu, 19 Sep 2019 18:17 UTC
References: 1 2
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: king...@nospicedham.comcast.net (bilsch01)
Newsgroups: comp.lang.asm.x86
Subject: Re: how to use gdb on a .bin file?
Date: Thu, 19 Sep 2019 11:17:34 -0700
Organization: A noiseless patient Spider
Lines: 14
Approved: fbkotler@myfairpoint.net - comp.lang.asm.x86 moderation team.
Message-ID: <qm0go0$vq$1@dont-email.me>
References: <qm0c02$1ko$1@dont-email.me> <qm0dbd$q05$1@news.albasani.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: reader02.eternal-september.org; posting-host="6a092641dc4ba3fcabd24b77ad2802dd";
logging-data="6733"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/cBWG8x6dauRxYm/XYgfxaPyL45okx3+Y="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
Thunderbird/60.8.0
Cancel-Lock: sha1:3x0+8vlJXHbiTaZE0JmcQAhLFCI=
View all headers
On 9/19/19 10:19 AM, Jens Kallup wrote:
Hello,

You can inject your bin file in a common .o
file by reading the .bin file byte to byte into .c file.
Then you can compile the .c file: gcc -o -g foo.o foo.c
And then, you can debug it with: gdb foo.o

Cheers
Jens

maybe gdb is the wrong tool.  What is the debugger I should use? My os is ubuntu with gnome.  I'm using nasm.



1
rocksolid light 0.7.2
clearneti2ptor