- you can use a Python script to write a summary string for data-types, in one of
three ways:
-P option and typing the script a line at a time
-s option and passing a one-line Python script
-F option and passing the name of a Python function
these options all work for the "type summary add" command
your Python code (if provided through -P or -s) is wrapped in a function
that accepts two parameters: valobj (a ValueObject) and dict (an LLDB
internal dictionary object). if you use -F and give a function name,
you're expected to define the function on your own and with the right
prototype. your function, however defined, must return a Python string
- test case for the Python summary feature
- a few quirks:
Python summaries cannot have names, and cannot use regex as type names
both issues will be fixed ASAP
major redesign of type summary code:
- type summary working with strings and type summary working with Python code
are two classes, with a common base class SummaryFormat
- SummaryFormat classes now are able to actively format objects rather than
just aggregating data
- cleaner code to print descriptions for summaries
the public API now exports a method to easily navigate a ValueObject hierarchy
New InputReaderEZ and PriorityPointerPair classes
Several minor fixes and improvements
llvm-svn: 135238
49 lines
1.1 KiB
C++
49 lines
1.1 KiB
C++
//===-- main.cpp ------------------------------------------------*- C++ -*-===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <stdint.h>
|
|
|
|
struct i_am_cool
|
|
{
|
|
int integer;
|
|
float floating;
|
|
char character;
|
|
i_am_cool(int I, float F, char C) :
|
|
integer(I), floating(F), character(C) {}
|
|
i_am_cool() : integer(1), floating(2), character('3') {}
|
|
|
|
};
|
|
|
|
struct i_am_cooler
|
|
{
|
|
i_am_cool first_cool;
|
|
i_am_cool second_cool;
|
|
float floating;
|
|
|
|
i_am_cooler(int I1, int I2, float F1, float F2, char C1, char C2) :
|
|
first_cool(I1,F1,C1),
|
|
second_cool(I2,F2,C2),
|
|
floating((F1 + F2)/2) {}
|
|
};
|
|
|
|
int main (int argc, const char * argv[])
|
|
{
|
|
i_am_cool one(1,3.14,'E');
|
|
i_am_cool two(4,2.71,'G');
|
|
|
|
i_am_cool* twoptr = &two;
|
|
|
|
i_am_cooler three(10,4,1985,1/1/2011,'B','E'); // Set break point at this line.
|
|
|
|
two.integer = 1;
|
|
|
|
return 0;
|
|
} |