[lldb-dev] What's the difference between GetLocation, AddressOf and GetLoadAddress

Greg Clayton gclayton at apple.com
Tue Mar 31 09:38:32 PDT 2015

> On Mar 30, 2015, at 7:59 PM, Ziming Song <s.ziming at hotmail.com> wrote:
> Every time the process stops, I use SBFrame::GetVariables to get to variable list and display them in the "variable" window. Since variable within different scope may have same name, I want to use the address of the variable to check if they are same. For example, when the process first stop, I got a variable "a" at address 0x123. While on the next stop, I got a variable "a" at address 0x456, so I know these two "a" are different variables.
> If variable can also be in register, how can I know if two variables got from two stop are the same. Is there a way to get the identity of variables?

My question to you: why are you trying to remove some variables? Are you trying to show all variables for all frames at the same time? If not, you shouldn't be removing any variables. So my question is why are you trying to remove anything?

> PS: I know there's a function SBValue::GetID, but that seems to return different result on different stop.

This isn't going to help you unique anything I would avoid using it.

More information about the lldb-dev mailing list