0

I compiled my c source code and got an elf.

I use "objdump -Sl" but don't need the assembly instructions.

Is there a way to use objdump without the assembly part (or other tool)?

for example, now i get this:

**/home/test/src/main.c:764
{
    return OPERATE_ON;
}
else
{
    return OPERATE_OFF;**
 102:   ed88        li  v1,8
 103:   0044 1818   movn    v1,a0,v0
 104:   3042 0000   addiu   v0,v0,0
 108:   c845        sw  v0,20(sp)
 10a:   41a7 1000   lui a3,0x1000
 10e:   3040 02fc   li  v0,764

but I only care about the c code:

    **/home/test/src/main.c:764
{
    return OPERATE_ON;
}
else
{
    return OPERATE_OFF;**

*I know it's possible with tee or regex, but I don't want the assembly instruction at all to make the objdump work faster

Thanks

1

If you don't need assembly, just read the source file (main.c). objdump is a debug tool and by using it you can check what assembly instructions correspond to source lines. If you don't need this functionality, why are you using objdump at all?

1
  • I work on a large legacy code with complicated complication and flags. with objdump I can ignore parts of the code that hasn't been complied for the coonfiguration. – iii2 Feb 24 at 8:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.