From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23704 invoked by alias); 6 Aug 2007 21:00:06 -0000 Received: (qmail 23592 invoked by uid 22791); 6 Aug 2007 21:00:03 -0000 X-Spam-Check-By: sourceware.org Received: from vms046pub.verizon.net (HELO vms046pub.verizon.net) (206.46.252.46) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 06 Aug 2007 21:00:00 +0000 Received: from ultsol.com ([72.74.235.69]) by vms046.mailsrvcs.net (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) with ESMTPA id <0JMD00H7AEBP7DU1@vms046.mailsrvcs.net> for gdb@sourceware.org; Mon, 06 Aug 2007 15:59:50 -0500 (CDT) Date: Mon, 06 Aug 2007 21:00:00 -0000 From: "Fahd Abidi" Subject: RE: trying to use gdb to disassemble a binary file To: Message-id: <071DB0C788671B48940BC79F8B49306918A860@ultsol01.tewks.ultsol.local> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: quoted-printable Content-class: urn:content-classes:message X-Ninja-PIM: Scanned by Ninja X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2007-08/txt/msg00065.txt.bz2 Thanks to the both of you. The objdump command worked. I tried the objcopy before I emailed and converted the binary file to an ELF format but for some reason the architecture would not get written to the created elf file: PPC_440-bojcopy -I binary -O elf32-powerpc -B powerpc file file.elf trying to do an "objdump -f" showed that there was no architecture information copied over. Trying to disassemble this resulted in an error saying the architecture was unknown. Probably this was a problem with my tools so I won't worry about it. And it would have to go on another thread anyhow. Thanks again. Fahd =20 -----Original Message----- From: Daniel Jacobowitz [mailto:drow@false.org]=20 Sent: Monday, August 06, 2007 3:30 PM To: Dave Korn Cc: Fahd Abidi; gdb@sourceware.org Subject: Re: trying to use gdb to disassemble a binary file On Mon, Aug 06, 2007 at 07:56:32PM +0100, Dave Korn wrote: > On 06 August 2007 19:45, Fahd Abidi wrote: >=20 > > Hello, > >=20 > > I am trying to use GDB to disassemble a binary file. I have no=20 > > problems when gdb connects to a target board (running a PC440) and=20 > > viewing the disassembly via the display command, (gdb)x=20 > > /10i$0xfffff000. But GDB does will not recognize or open a binary=20 > > file format. It might not be the right tool to use, I really just=20 > > want to open a binary file in gdb and view the disassembly. Is that possible? >=20 > Not easily, although it would work if you could get the file's=20 > contents loaded into memory. >=20 > Probably your best bet is to use "objdump -D --target=3Dbinary=20 > --architecture=3D filename" Alternatively, use objcopy to convert the file into an ELF image. -- Daniel Jacobowitz CodeSourcery