No LineEntry info fom FindFunctions in SBTarget?

Hi,

I am calling FindFunctions in SBTarget to retrieve function info.

From returned SBSymbolContext object, I can get valid SBFunction

And SBModule objects but not any valid SBLineEntry object. I used

SBSymbolContext.GetLineEntry().

I am wondering why LineEntry is not available there? And how to get

corresponding LineEntry info for a SBFunction Object.

Thanks,

Yin

Which line entry? All of them for the entire function? My point being that a function has many possibly line entries contained within all of the code for the function.

If you want the line entry for the entry point of the function itself, you can do:

SBFunction func = SBSymbolContext().GetFunction();
SBAddress func_entry_addr = func.GetStartAddress();
SBLineEntry func_entry_line = func_entry_addr.GetLineEntry();

You might also want the first line entry at which you can set a breakpoint. For this you will want to skip the function prologue. An easy method that usually works it to grab the second line entry in the function:

SBLineEntry second_func_line = func_entry_line.GetEndAddress().GetLineEntry();

Hi Greg,

Thanks a lot Greg. this is exactly what I was looking for.
I thought the lineentry of entry point was
available directly from SBFunction.getLineEntry().

Yin