This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC 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]

Find offset of block instruction in function


Hello,

Given the result of 'DECL_SAVED_TREE' for a FUNCTION_DECL, is there a way to
determine the offset into the function for a given block instruction?
Perhaps the question is not worded correctly, or maybe what I'm asking
doesn't make sense. But essentially, say there is a function:

void something() {
    int blah;
    
    blah = 2;

    if (1) {
        printf("blah: %d\n, blah);
    }
}

In this case is there a way to determine the offset of 'if (1)' or 'printf'?
By 'offset' I mean in the same sense 'backtrace_symbols' includes "a
hexadecimal offset into the function." If so does it depend on optimization
or anything else?

Any help is appreciated.



--
View this message in context: http://gcc.1065356.n5.nabble.com/Find-offset-of-block-instruction-in-function-tp1247666.html
Sent from the gcc - Help mailing list archive at Nabble.com.


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