public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Jim Wilson <wilson@specifix.com>
To: Aashish Gupta <aashish.tap@gmail.com>
Cc: binutils@sourceware.org
Subject: Re: File not recognized in objdump!!
Date: Fri, 30 Mar 2007 14:51:00 -0000	[thread overview]
Message-ID: <1175197223.2720.18.camel@localhost.localdomain> (raw)
In-Reply-To: <2538a28f0703270024g632fea89s15cd614278ce0f7f@mail.gmail.com>

On Tue, 2007-03-27 at 12:54 +0530, Aashish Gupta wrote:
> (gdb) run objdump
> Starting program: /root/Desktop/binutils1/gas/as-new objdump
> Breakpoint 6, as_perror (gripe=0x80d7638 "Selected target format '%s' unknown",
>     filename=0x80db2be "elf64-ia64-little") at messages.c:124
> ((Our target is elf64-ia64-big though ..?? and have made modification
> accordingly..))
> 124     {
> (gdb) break bfd_check_format_matches
> Breakpoint 9 at 0x8088099: file format.c, line 118.
> (gdb) n
> 126       int saved_errno = errno;

There are a lot of problems with what you are doing here.

First of all, you are debugging the assembler, not objdump here.  See
the "starting program" line, and the fact that as_perror is an assembler
routine.  Also, you are running it incorrectly, as you passed the
objdump binary to it.  The assembler only accepts assembly source files
as input.  You need to be debugging the right program with the right
input.

You set the bfd_check_format_matches breakpoint after starting the
program, and then typed next, which is not going to work.  This will
leave you where you are already stopped, which is in the as_perror
function.  This routine just prints out the error message, which is far
too late to be useful.

You need to set the breakpoint first, and then run the program.  If you
debug the right program, and the right function, you will see that it
ends up calling the elf64_ia64_object_p function which Nick pointed you
at.

binutils is a large and complicated package.  You will need to spend a
lot more time learning how it works, and how to use basic tools like
gdb, if you wish to be successful modifying it.
-- 
Jim Wilson, GNU Tools Support, http://www.specifix.com


  reply	other threads:[~2007-03-29 19:50 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-26  5:14 Aashish Gupta
2007-03-26  5:22 ` Aashish Gupta
2007-03-26  5:45 ` Mike Frysinger
2007-03-26  7:14   ` Aashish Gupta
2007-03-26 16:57     ` H. J. Lu
2007-03-26 20:24 ` Jim Wilson
2007-03-26 23:02   ` Jim Wilson
2007-03-26 23:20   ` Jim Wilson
     [not found]   ` <2538a28f0703270019o6033dfd9x58641e94ae68a1f@mail.gmail.com>
2007-03-27  9:13     ` Aashish Gupta
2007-03-30 14:51       ` Jim Wilson [this message]
2007-03-28  8:38 ` Nick Clifton
2007-03-28  9:59   ` Nick Clifton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1175197223.2720.18.camel@localhost.localdomain \
    --to=wilson@specifix.com \
    --cc=aashish.tap@gmail.com \
    --cc=binutils@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).