Skip to content

Commit

Permalink
kram - start of python visualizers for EASTL.py
Browse files Browse the repository at this point in the history
EA only released a natvis file which is no help when running on Xcode.  And Xcode moved all their python visualizers to internal C++ code for their STL impl.  Ugh.
electronicarts/EASTL#462
  • Loading branch information
alecazam committed Jan 28, 2024
1 parent 05e7734 commit e892711
Showing 1 changed file with 45 additions and 2 deletions.
47 changes: 45 additions & 2 deletions scripts/EASTL.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,52 @@
// https://pspdfkit.com/blog/2018/how-to-extend-lldb-to-provide-a-better-debugging-experience/debugging_support_formatters_for_lldb_in_vscode
// TODO: size is template param

// run this from .lldbinit
// command script import source kram/scripts/EASTL.py

// can also add commands to lldb that execute when run

import lldb

def __lldb_init_module(debugger, internal_dict):
print('installing eastl formatters to lldb')

debugger.HandleCommand('type summary add --summary-string "${var.mValue}" east::array<*>')
debugger.HandleCommand('type summary add --summary-string "${var.mpBegin} size=${var.mpEnd}-$(var.mpBegin}" east::VectorBase<*>')
debugger.HandleCommand('type summary add --summary-string "value=${var.mValue} size=1" eastl::array<>')
debugger.HandleCommand('type summary add --summary-string "value=${var.mpBegin} size=(${var.mpEnd}-${var.mpBegin})" eastl::VectorBase<>')W

// TODO:
// eastl::unique_ptr<>
// eastl::shared_ptr<>
// eastl::weak_ptr<>
// eastl::basic_string<> length, capacity, value
// eastl::basic_string<wchar_t> length, capacity, value (don't use this)
// eastl::pair<> first, second
// eastl::span<>
// eastl::DequeBase<>
// eastl::DequeueIterator<>
// eastl::queue<>
// eastl::ListBase<>
// eastl::ListNode<>
// eastl::ListIterator<>
// eastl::SListBase<>
// eastl::SListNode<>
// eastl::SListIterator<>
// eastl::intrusive_list_base<>
// eastl::intrusive_list_iterator<>
// eastl::set<>
// eastl::rbtree<>
// eastl::rbtree_node<>
// eastl::rbtree_iterator<>
// eastl::hashtable<>
// eastl::hash_node<>
// eastl::hashtable_iterator_base<>
// eastl::reverse_iterator<>
// eastl::bitset<>
// eastl::basic_string_view<>
// eastl::compressed_pair_imp<>
// eastl::optional<>
// eastl::ratio<>
// eastl::chrono::duration<> like 7 of thse
// eastl::reference_wrapper<>
// eastl::any<>
// eastl::atomic_flag<>

0 comments on commit e892711

Please sign in to comment.