This is the mail archive of the
mailing list for the binutils project.
Re: Any option to objdump just one function ?
- From: Ciro Santilli <ciro dot santilli at gmail dot com>
- To: Nicholas Clifton <nickc at redhat dot com>
- Cc: binutils at sourceware dot org, manningaustin at mac dot com
- Date: Wed, 1 Jul 2015 19:12:44 +0200
- Subject: Re: Any option to objdump just one function ?
- Authentication-results: sourceware.org; auth=none
- References: <CAFXrp_eouEA-A1igf63PSyFUVhBPACxO10rixjOyC5=1M_vXJw at mail dot gmail dot com> <5594137F dot 5090908 at redhat dot com>
Thanks for the reply.
On Wed, Jul 1, 2015 at 6:21 PM, Nicholas Clifton <firstname.lastname@example.org> wrote:
> Hi Ciro,
>> This is a reply to:
>> Is this feature technically feasible? Seems simple, but I may be
>> missing something.
> Technically feasible yes, but I think unnecessary.
>> Would you be interested in a patch that a adds a new option like:
>> objdump -d --function main main.o
> I don't think so. I have already described several methods whereby this
> functionality could be achieved without modifying objdump, so I really do
> not see the need.
I feel that the solutions mentioned so fare are not very satisfactory:
- gdb disassemble:
- only woks on executables, not object files or shared libraries (?)
- objdump has useful ways to visualize code that gdb does not,
e.g. -S: http://stackoverflow.com/questions/9970636/view-both-assembly-and-c-code
- -ffunction-section : requires a recompile
- --start-address and --stop-address= : how to you get the addresses beforehand?
There also seem to be more people who want this:
Currently the best solution I see if one is really motivated is to
pass it to awk, but the overhead of piping / creating the alias is a
Of course, if you think its not worth the review time, I understand,
not a blocking issue either.