This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Feature for objdump or another binutil binary....


I have a question concerning a feature that I would find useful with
the binutils. Most likely it could go in 'objdump' or maybe another
tool already exists or maybe it would warrant another seperate tool
itself. Here is a line in an 'objdump -d <file>' for a MIPS binary:

402ed0: 24020001 li v0,1

Let's say that I am interested in all instructions that load the
immediate value of 1 into register v0. Currently, I have to do the
'objdump -d' and then grep for '24020001' to find the occurences
of this instruction in the text file output. That is the first case.

The next and more general case might be to find all instruction
occurences of where any immediate value loaded into v0 happens.
And finally, maybe we would like a more complex case of if there
is an arithmetic shift left instruction executed in the delay
slot of a 'bnez' instruction. You get the idea.....

The whole point of my email is that I find it cumbersome to have to
do a 'objdump -d' and potentially waste space with a big text file
and then grep through it for what I want. It would be nice to be
able to specify the instruction and perhaps the section or sections
to look in and have it search that way. Maybe it is not possible to
create a tool that is general enough for all architectures and that
will have a powerful enough search capability. I am at a point where
I am ready to write myself a tool just for MIPS, but maybe something
more general can be done. Thoughts?

-Steve


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]