[PATCH] D42582: [lldb][PPC64] Fixed step-in stopping in the wrong line

Jim Ingham via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 23 16:54:46 PST 2018


jingham requested changes to this revision.
jingham added a comment.
This revision now requires changes to proceed.

GetBytesToSkip strikes me as an odd function.  It takes a thread but implicitly acts on the PC of frame 0 of that thread.  That makes it feel overly specific and requires a process when you don't really need one to do the calculation.   Plus you already have the pc & symbol but you end up re-looking them up.   You could do all the calculations you do in GetBytesToSkip if you passed in the symbol and the pc as an Address.  That would allow you to get the file address for the PC, and you can compare that directly to the symbol's address.

You can get an Address from a load address (which curr_addr is) by calling target->GetSectionLoadList()->ResolveLoadAddress(curr_addr, ReturnedAddress).  Then you can use the file address from the ReturnedAddress to compare against the FileAddress of the symbol.

The way you are using these is fine, BTW.  I'm just quibbling about the interface of GetBytesToSkip.


https://reviews.llvm.org/D42582





More information about the llvm-commits mailing list