scripts/gdb/lvglgdb/lvgl/misc/README.md
This directory contains GDB debugging scripts for LVGL's miscellaneous data structures, including red-black trees and cache systems.
Provides debugging support for LVGL's red-black tree (lv_rb_t) implementation.
Classes:
LVRedBlackTree - Iterator for red-black tree nodesFunctions:
dump_rb_info(rb, datatype) - Dump basic red-black tree informationUsage:
# In GDB:
python tree = LVRedBlackTree(some_rb_tree)
python for data in tree: print(data)
python dump_rb_info(some_rb_tree, datatype)
Provides debugging support for LVGL's cache system (lv_cache_t).
Classes:
LVCache - Wrapper for cache objectsFunctions:
dump_cache_info(cache, datatype) - Dump cache informationUsage:
# In GDB:
python cache = LVCache(some_cache)
python print(f"Cache usage: {cache.get_usage_percentage()}%")
python dump_cache_info(some_cache, datatype)
Provides debugging support for cache entries (lv_cache_entry_t).
Classes:
LVCacheEntry - Wrapper for cache entriesFunctions:
dump_cache_entry_info(entry, datatype) - Dump cache entry informationUsage:
# In GDB:
python entry = LVCacheEntry(some_entry)
python print(f"Ref count: {entry.get_ref_count()}")
python dump_cache_entry_info(some_entry, datatype)
Specialized support for LRU-based caches using red-black trees.
Classes:
LVCacheLRURB - Specialized cache wrapper for LRU RB implementationsFunctions:
dump_lru_rb_cache_info(cache) - Dump LRU RB cache informationProvides debugging support for LVGL's image cache (lv_image_cache_t).
Classes:
LVImageCache - Wrapper for image cache objectsUsage:
# In GDB:
python curr_inst().image_cache().print_info()
python curr_inst().image_cache().print_entries()
All these modules are automatically imported and available when using the LVGL GDB scripts. You can access them through
the main lvgl module:
# In GDB:
python from lvglgdb import LVRedBlackTree, LVCache, dump_rb_info, dump_cache_info
All wrapper classes support multiple input types:
gdb.Value objects (from GDB expressions)Value objects (from lvglgdb.value module)0x12345678)This allows flexible usage patterns:
# From GDB variable
entry = LVCacheEntry(my_entry)
# From raw memory address
entry = LVCacheEntry(0x7fff12345678)
# From GDB expression result
entry = LVCacheEntry(gdb.parse_and_eval("*(lv_cache_entry_t*)0x7fff12345678"))
# Create tree iterator from variable
tree = LVRedBlackTree(some_rb_variable)
# Create from raw pointer (0x12345678)
tree = LVRedBlackTree(0x12345678)
# Iterate through all nodes
for data_ptr in tree:
print(f"Data pointer: {data_ptr}")
# Get tree info
print(f"Tree has {len(tree)} nodes")
tree.print_info()
# Create cache wrapper from variable
cache = LVCache(some_cache_variable)
# Create from raw pointer (0x12345678)
cache = LVCache(0x12345678)
# Check cache status
print(f"Cache usage: {cache.get_usage_percentage():.1f}%")
print(f"Cache enabled: {cache.is_enabled()}")
# Dump full info
cache.print_info()
# Create entry wrapper from variable
entry = LVCacheEntry(some_entry_variable)
# Create from raw pointer (0x12345678)
entry = LVCacheEntry(0x12345678)
# Check entry status
print(f"Ref count: {entry.get_ref_count()}")
print(f"Invalid: {entry.is_invalid()}")
# Dump full info
entry.print_info()
lv_rb.py - Red-black tree debugging supportlv_cache.py - General cache debugging supportlv_cache_entry.py - Cache entry debugging supportlv_cache_lru_rb.py - LRU RB cache specialized supportlv_image_cache.py - Image cache debugging supportlv_image_header_cache.py - Image header cache debugging supportlv_cache_iter_base.py - Cache iterator base classlv_cache_iter_factory.py - Cache iterator factory functions__init__.py - Module exports and initialization