I'm trying to integrate objdump as a command in a secondary target in Eclipse CDT, and the current CDT environment is quite simple, and does not allow to redirect the stdout to a file.
Could you add '-o filename' to objdump to write the result to a file, instead of stdout?
I know that this implies a lot of small changes, and I'm ready to contribute this patch if you agree to merge it to the main branch.
Just create a script that wraps around objdump and handles the redirection.
come on, using scripts in this case is a kludge, not to mention that invoking them is not portable between Windows and Unix.
my Eclipse plug-in adds three more steps to the usual build process, after link I do one step to create the binary hex file (via objcopy), one more step to create the listing (via objdump), and one final step to report sized (via size).
all program names and parameters are fully configurable via the Eclipse GUI.
as long as I execute them from a make, everything is ok, make takes care of the redirection and 'objdump >file' works as expected.
but Eclipse also has an internal builder, that processes the dependencies internally and issues the commands directly. This one has no redirect capabilities, since all other GNU tools are able to generate the output into a file, only objdump is different (in a not so friendly way).
How is adding the -o option not a kludge?
if -o (as an option to redirect the output) is an appropriate solution for the GNU compiler/linker and for countless other programs (most GNU programs in fact), I fail to see why objdump is so special that may not use the same widely accepted solution.
according to the dictionary, 'dump' means 'copy (stored data) to a different location, especially so as to protect against loss', not necessarily on stdout, as you try to imply.
of course you are free to call it whatever you want, but by denying this additional functionality you are just limiting the tool usability.
In case anyone else runs into this. In Eclipse, when configuring an external tool, you can go to the Common tab, go down to the Standard Input and Output section, make sure Allocate Console is not checked, check Output file, and enter a filename.
Now when you run the tool, all output will be sent to that file.