[lldb-dev] Writing a data formatter for LLDB

2017-10-02 Thread Francois Fayard via lldb-dev
Hi,

I would like to write a data formatter for LLDB, for a class which is very 
close to std::array. Here it is:

template 
class StaticArray {
 private:
  T data_[n];
}

I wrote the following data formatter adapted from my own “std::vector” data 
formatter but I still have blanks to fill :

class StaticArrayProvider:
def __init__(self, valobj, internal_dict):
self.valobj = valobj
self.data = 
self.valobj.GetChildMemberWithName('data_').GetChildAtIndex(0)
self.data_type = self.data.GetType()
self.type_size = self.data_type.GetByteSize()
self.size = #???

def num_children(self):
return self.size

def get_child_index(self, name):
try:
return int(name.lstrip('[').rstrip(']'))
except:
return -1

def get_child_at_index(self, index):
if index < 0:
return None
if index >= self.num_children():
return None
try:
return #???
except:
return None

Could you please give me a hand to fill those blanks?

François Fayard
Founder & Consultant - +33 (0)6 01 44 06 93
Inside Loop - Scaling up Computational Science
Paris - 38 rue Desbordes-Valmore, 75116 Paris
Lyon/Grenoble - 34 route de Four, 38090 Vaulx-Milieu

___
lldb-dev mailing list
lldb-dev@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev


[lldb-dev] October LLVM bay-area social is this Thursday!

2017-10-02 Thread George Burgess IV via lldb-dev
We'll be at Tied House as usual, starting on Thursday the 5th at 7pm!

If you can, help us plan and RSVP here: http://meetu.ps/3cH44d

See everyone there!
___
lldb-dev mailing list
lldb-dev@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev