sivachandra added a comment.
When such an error occurs, it is unlikely to be an lldb bug, or data-formatter
bug. One can come up with a data structure for which reading a child element
would require complete debug info, but reading the # of child elements need not
require complete debug info
sivachandra updated this revision to Diff 37630.
sivachandra added a comment.
Address comments.
http://reviews.llvm.org/D13778
Files:
include/lldb/API/SBValue.h
include/lldb/Core/ValueObject.h
include/lldb/Core/ValueObjectCast.h
include/lldb/Core/ValueObjectChild.h
labath added a subscriber: labath.
labath added a comment.
Not really my area, but couldn't the needed functionality be implemented on top
of GetChildAtIndex(). I mean, if GetChildAtIndex(50) returns a valid SBValue,
then the container has at least 50 elements, right?
Then
sivachandra added a comment.
There could be an error reading the k-th element for k < n.In which case, we
will wrongly conclude that there are only k-1 elements.
http://reviews.llvm.org/D13778
___
lldb-commits mailing list
labath added a comment.
How big of an error does it have to be for that to happen? Is that something we
would consider an "lldb bug"/"data formatter bug" or it can be caused by
something out of our control, like missing debug info on one of the children?
http://reviews.llvm.org/D13778
clayborg added a comment.
I would almost rather change the GetNumChildren() to take a "max" param:
class SBValue
{
uint32_t
GetNumChildren ();
uint32_t
GetNumChildren (uint32_t max = UINT32_MAX);
};
We need to keep the other one so that our public API still has
clayborg added a comment.
For the public API you will need both and not have a default arg.
http://reviews.llvm.org/D13778
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
sivachandra added a comment.
I did this experiment before setting off:
class A
{
public:
int method();
int method(int a = 10);
};
int
A::method()
{
return 10;
}
int
A::method(int a)
{
return a + 10;
}
int
main()
{
A a;
return
sivachandra added a comment.
Ah, I did not notice PyCallable::GetNumArguments before you drew my attention
to it. It seems to be using internals of PyCodeObject. When I said "no
easy/clean way", I was talking about avoiding such a usage. If that is
acceptable, I am fine with it. I will modify
sivachandra added a comment.
As I mentioned in the first post, this is the use case:
Synthetic child providers currently have a method "has_children" and
"get_num_children". While the former is good enough to know if there are
children, it does not give any insight into how many children there
On Thu, Oct 15, 2015 at 11:59 AM, Enrico Granata
wrote:
> granata.enrico added a comment.
>
> So, if I understand this correctly, this HasChildAtIndex() API returns a
> three-state int:
>
> 1 == yes I do
> 0 == no I do not
> -1 == maybe, can't tell
>
> When would you
granata.enrico added a comment.
Is it possible to ask for concrete examples?
As in, for example, do you plan to change ValueObjectPrinter to use this API in
some way?
Or do you have any specific synthetic providers that you would like to use this
API in?
http://reviews.llvm.org/D13778
sivachandra added a comment.
Yes, we would like to use this is specific synthetic providers. It will not be
used by any part of LLDB internally.
http://reviews.llvm.org/D13778
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
granata.enrico requested changes to this revision.
granata.enrico added a comment.
This revision now requires changes to proceed.
If so, why do you need this to be exposed as a call that LLDB knows about?
You are free to provide any methods you want in your synthetic child providers.
Adding
sivachandra added a comment.
Ah, we want this exposed in the SBValue API. What I mean't in the earlier
message was that no other part of LLDB will functionally depend/lookup/expect
this "feature".
http://reviews.llvm.org/D13778
___
lldb-commits
granata.enrico added a comment.
So, if I understand this correctly, this HasChildAtIndex() API returns a
three-state int:
1 == yes I do
0 == no I do not
-1 == maybe, can't tell
When would you ever run into the -1 case? It seems you're mostly using it as an
invalid marker. Would 0 not be a
16 matches
Mail list logo