[all-commits] [llvm/llvm-project] ece4b7: [lldb] Add C source output mode to formatter_bytec...

Dave Lee via All-commits all-commits at lists.llvm.org
Tue Mar 3 15:48:53 PST 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ece4b759327c03fa09edc90b802db3a74fa19e33
      https://github.com/llvm/llvm-project/commit/ece4b759327c03fa09edc90b802db3a74fa19e33
  Author: Dave Lee <davelee.com at gmail.com>
  Date:   2026-03-03 (Tue, 03 Mar 2026)

  Changed paths:
    M lldb/examples/python/formatter_bytecode.py

  Log Message:
  -----------
  [lldb] Add C source output mode to formatter_bytecode.py (#184242)

Add the ability to generate a C source file, which is in addition to the
existing functionality of generating binary.

An example of the generated source:

```c
#ifdef __APPLE__
#define FORMATTER_SECTION "__DATA_CONST,__lldbformatters"
#else
#define FORMATTER_SECTION ".lldbformatters"
#endif

__attribute__((used, section(FORMATTER_SECTION)))
unsigned char _Account_synthetic[] =
    // version
    "\x01"
    // remaining record size
    "\x15"
    // type name size
    "\x07"
    // type name
    "Account"
    // flags
    "\x00"
    // sig_get_num_children
    "\x02"
    // program size
    "\x02"
    // program
    "\x20\x01"
    // sig_get_child_at_index
    "\x04"
    // program size
    "\x06"
    // program
    "\x02\x20\x00\x23\x11\x60"
;
```



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list