<div><div dir="auto">Yes, seems that it is what I needed.</div></div><div dir="auto"><br></div><div dir="auto">Thank you for the tip!</div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">вт, 2 апр. 2019 г. в 1:45, Jim Ingham <<a href="mailto:jingham@apple.com">jingham@apple.com</a>>:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Independent of the naming issue, if you have an address and want to view its pointee as a given type, CreateValueFromAddress is much more efficient than CreateValueFromExpression.  After all, CreateValueFromAddress just reads some memory and presents it as the given type, rather than having to parse and evaluate an expression just to figure out the type and address, and then go read the memory and present it as the given type..<br>
<br>
As a side note, if you only wanted the dereferenced values, and needed to use the expression, you could also just make the expression be:<br>
<br>
*((uint32_t *) ADDR)<br>
<br>
The resultant SBValue would have the name you wanted.  But again, for "typed addresses" CreateValueFromAddress is a more robust & efficient API.<br>
<br>
Jim<br>
<br>
<br>
> On Apr 1, 2019, at 3:36 PM, Alexander Polyakov <<a href="mailto:polyakov.alx@gmail.com" target="_blank">polyakov.alx@gmail.com</a>> wrote:<br>
> <br>
> I have an address of memory where the value of some register is. I do following:<br>
> <br>
> addr = 0x1234 (just for example)<br>
> rbx = target.CreateValueFromExpression('(uint32_t *) ' + str(addr), 'rbx')<br>
> rbx = rbx.Dereference()<br>
> <br>
> Then I want to create a map:<br>
> rbx.GetName() => rbx.GetValue()<br>
> <br>
> In this case rbx.GetName() will return "*rbx". <br>
> <br>
> Maybe it'd be better to use SBTarget::CreateValueFromAddress() instead of CreateValueFromExpression. The Value created this way will be dereferenced initially, so its name will not contain *, I guess.<br>
> <br>
> On Tue, Apr 2, 2019 at 1:23 AM Jim Ingham <<a href="mailto:jingham@apple.com" target="_blank">jingham@apple.com</a>> wrote:<br>
> What are you using the name for?  If the name of an SBValue is the name of a variable, then it makes sense (at least in C languages) for the name of the dereference Value to be "*VARNAME".  After all that's what it is.  If the name is some other random string, I'm not sure anything would be better or worse, except it would be confusing to dereference an SBValue and get back another value with the same name, so we have to choose something else.<br>
> <br>
> Jim<br>
> <br>
> > On Apr 1, 2019, at 3:16 PM, Alexander Polyakov <<a href="mailto:polyakov.alx@gmail.com" target="_blank">polyakov.alx@gmail.com</a>> wrote:<br>
> > <br>
> > I can't say that it's a problem, I just want to know what is the actual reason of such a behavior to find good workaround.<br>
> > <br>
> > I have a SBValue with a pointer to some object, e.g. "(uint32_t *) sp", when I do dereference it, I get another SBValue - "(uint32_t) *sp". The only way to deal with it that I see is to check the first symbol of name and erase it if it's equal to *.<br>
> > <br>
> > I'm facing with that situation when creating an object from a pointer via SBTarget::CreateValueFromExpression.<br>
> > <br>
> > <br>
> > <br>
> > On Mon, Apr 1, 2019 at 9:35 PM Jim Ingham <<a href="mailto:jingham@apple.com" target="_blank">jingham@apple.com</a>> wrote:<br>
> > Dereference returns another SBValue distinct from the initial one, so it needs to make up a name for it.  I think it would be confusing for it to return the same name, and putting a * at the beginning of the initial SBValue seems as good a choice as any.<br>
> > <br>
> > Is this causing you some concrete problem?<br>
> > <br>
> > Jim<br>
> > <br>
> > <br>
> > > On Mar 30, 2019, at 11:18 AM, Alexander Polyakov via lldb-dev <<a href="mailto:lldb-dev@lists.llvm.org" target="_blank">lldb-dev@lists.llvm.org</a>> wrote:<br>
> > > <br>
> > > Hi lldb-dev,<br>
> > > <br>
> > > I have a SBValue created via SBTarget.CreateValueFromExpression('some_name', expr).<br>
> > > If the expression looks like '(some_type *) addr', then GetName returns 'some_name' as expected, but when I do Dereference this value, GetName returns '*some_name'.<br>
> > > <br>
> > > So, is it a conventional behavior of the GetName method applied to dereferenced SBValue?<br>
> > > <br>
> > > -- <br>
> > > Alexander<br>
> > > _______________________________________________<br>
> > > lldb-dev mailing list<br>
> > > <a href="mailto:lldb-dev@lists.llvm.org" target="_blank">lldb-dev@lists.llvm.org</a><br>
> > > <a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev</a><br>
> > <br>
> > <br>
> > <br>
> > -- <br>
> > Alexander<br>
> <br>
> <br>
> <br>
> -- <br>
> Alexander<br>
<br>
</blockquote></div></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><span style="color:rgb(0,0,0);font-family:arial,helvetica,sans-serif;font-size:12.8px">Alexander</span><br></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>