Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] Getting source file name and line number

Hi all,

I'm trying to use CDT to retrieve the source file name and line number for a given offset in a shared object compiled with debugging symbols. Basically, the functionality offered by "addr2line".

I've manged to get a IBinaryParser.IBinaryObject for my shared object. Then I'm iterating on all its ISymbols. The symbols exist and match what I would expect. But for all of them the getFileName() always returns null, so I'm not sure how to get the source file name, let alone the line numbers. addr2line works on the very same shared object.

The addresses I'm looking for don't exactly match a symbol (function or variable name), but I've used ISymbol because that's the only thing I saw that has the notion of address -> line number. Could that be the problem? Or is my approach wrong?

Thanks!
Alexandre


Back to the top