17 if (
begin > cur.end) {
19 }
else if (
begin >= cur.begin &&
begin <= cur.end) {
22 }
else if (begin < cur.begin && end > cur.end) {
24 DEBUGPRINTF2(printf(
"tracepointgen: removeOffsetRange: %llu, %llu, %d\n", cur.begin, cur.end, cur.line));
25 }
else if (
end >= cur.begin &&
end <= cur.end) {
29 }
else if (
end < cur.begin) {
58 endOfLine =
data.length();
66 if (endOfComment == -1)
87 endOfLine =
data.length();
94 if (endOfComment == -1)
110 for (
int i = 0;
i < lines.size();
i++) {
111 QString l = lines.at(
i).simplified();
151 rep.in =
params.left(punc).simplified();
152 rep.out =
params.right(
params.length() - punc - 1).simplified();
170 QString begin =
data.mid(endOfProvider + 1, classMarker - endOfProvider - 1);
171 QString end =
data.
mid(classMarker + 2, beginOfFunctionMarker - classMarker - 2);
173 if (spaceIndex == -1)
176 func.className =
begin.mid(spaceIndex + 1,
begin.length() - spaceIndex - 1);
179 if (spaceIndex < braceIndex)
180 func.functionName =
end.left(spaceIndex).simplified();
182 func.functionName =
end.left(braceIndex).simplified();
185 func.functionParameters =
end.mid(braceIndex + 1, lastBraceIndex - braceIndex - 1).simplified();
204 if (endOfPoint == -1 || endOfPoint2 < endOfPoint) {
205 endOfPoint = endOfPoint2;
229 prefix =
data.
mid(endOfProvider + 1, endOfPoint - endOfProvider - 1).
simplified();
246 DEBUGPRINTF(printf(
"Cannot open '%s' for reading: %s\n",
260 for (
int i = 0;
i <
split.size() - 1;
i++) {
264 while (
m.hasNext() && !found) {
272 if (
match.hasCaptured(3)) {
290 while (
m.hasNext()) {
304 for (
const auto &e : enums) {
305 const auto trimmed = e.trimmed();
306 if (!trimmed.isEmpty() && !trimmed.startsWith(
QLatin1Char(
'#')))
328 QList<EnumNameValue>
ret;
346 return elem.name == val;
349 cur =
r.value =
iter->value;
377 metadata =
data.
mid(endOfProvider + 1, endOfPoint - endOfProvider - 1).
simplified();
388 while (
i.hasNext()) {
391 int cur =
match.capturedStart();
403 while (
r.hasNext()) {
405 ranges << rm.captured(1);
406 ranges << rm.captured(2);
411 const auto enumOrFlag =
match.captured(1);
426 for (
int i = 0;
i < ranges.size() / 2;
i++) {
427 bool rangeFound =
false;
428 for (
auto &
v : moreValues) {
429 if (
v.name == ranges[2 *
i]) {
431 QString rangeEnd = ranges[2 *
i + 1];
432 auto iter = std::find_if(moreValues.begin(), moreValues.end(), [&rangeEnd](
const EnumNameValue &elem){
433 return elem.name == rangeEnd;
435 if (
iter != moreValues.end())
442 if (rangeFound ==
false)
447 return a.value < b.value;
450 int prevValue = std::as_const(moreValues).front().value;
451 for (
const auto &
v : std::as_const(moreValues)) {
453 if (
v.valueStr.isNull()) {
454 if (
v.value == prevValue + 1 && !
flags)
482 return info.absoluteFilePath();
486 return info.absoluteFilePath();
497 DEBUGPRINTF(printf(
"Cannot open '%s' for reading: %s\n",
510 while (
i.hasNext()) {
517 if (!info2.exists()) {
521 rinc = info2.absoluteFilePath();
522 filename = info2.fileName();
555 while (
i.hasNext()) {
569 i = traceMacro.globalMatch(
data);
570 while (
i.hasNext()) {
588 func.functionParameters.replace(rep.in, rep.out);
598 out << prefix <<
"\n";
604 out <<
func.className <<
"_" <<
func.functionName <<
"_entry(" <<
func.functionParameters <<
")\n";
605 out <<
func.className <<
"_" <<
func.functionName <<
"_exit()\n";
608 out << point.name <<
"(" << point.parameters <<
")\n";
QList< IncludePath > includes
QList< QString > m_metadata
int lineNumber(qsizetype offset) const
void addIncludesRecursive(const QString &filename, QStringList &includes)
void parseParamReplace(const QString &data, qsizetype offset, const QString &name)
void parse(QIODevice &input, const QString &name)
QList< QString > m_includeDirs
void parseMetadata(const QString &data, qsizetype offset, const QStringList &includes)
QList< Replace > m_replaces
void parsePrefix(const QString &data, qsizetype offset)
void write(QIODevice &input) const
QList< QString > m_prefixes
QString resolveInclude(const QString &filename)
QStringList findEnumValues(const QString &name, const QStringList &includes)
void parseInstrument(const QString &data, qsizetype offset)
void parsePoint(const QString &data, qsizetype offset)
QList< Function > m_functions
QList< LineNumber > m_offsets
\inmodule QtCore \reentrant
qsizetype size() const noexcept
void push_back(parameter_type t)
void append(parameter_type t)
\inmodule QtCore \reentrant
\inmodule QtCore \reentrant
\inmodule QtCore \reentrant
\macro QT_RESTRICTED_CAST_FROM_ASCII
QString left(qsizetype n) const &
iterator begin()
Returns an \l{STL-style iterators}{STL-style iterator} pointing to the first character in the string.
qsizetype indexOf(QLatin1StringView s, qsizetype from=0, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
bool startsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string starts with s; otherwise returns false.
QStringList split(const QString &sep, Qt::SplitBehavior behavior=Qt::KeepEmptyParts, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Splits the string into substrings wherever sep occurs, and returns the list of those strings.
QString mid(qsizetype position, qsizetype n=-1) const &
bool isEmpty() const noexcept
Returns true if the string has no characters; otherwise returns false.
QString simplified() const &
iterator end()
Returns an \l{STL-style iterators}{STL-style iterator} pointing just after the last character in the ...
QString right(qsizetype n) const &
bool endsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string ends with s; otherwise returns false.
QString trimmed() const &
qsizetype length() const noexcept
Returns the number of characters in this string.
void panic(const char *fmt,...)
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter * iter
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLenum GLsizei GLsizei GLint * values
[15]
GLboolean GLboolean GLboolean b
GLsizei const GLfloat * v
[13]
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum GLenum GLsizei count
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLuint GLintptr offset
GLuint GLsizei const GLuint const GLintptr * offsets
GLenum GLenum GLenum input
static void split(QT_FT_Vector *b)
QtPrivate::QRegularExpressionMatchIteratorRangeBasedForIterator begin(const QRegularExpressionMatchIterator &iterator)
#define qPrintable(string)
#define QStringLiteral(str)
static bool match(const uchar *found, uint foundLen, const char *target, uint targetLen)
QTextStream out(stdout)
[7]
\inmodule QtCore \reentrant
bool contains(const AT &t) const noexcept
static void removeOffsetRange(qsizetype begin, qsizetype end, QList< LineNumber > &offsets)
static void simplifyData(QString &data, QList< LineNumber > &offsets)
static QList< EnumNameValue > enumsToValues(const QStringList &values)
static bool findSpaceRange(const QString &data, qsizetype &offset, qsizetype &end)
static QString preprocessMetadata(const QString &in)