File indexing completed on 2024-04-14 04:31:18

0001 /* This file is part of KDevelop
0002 * Copyright 2006-2008 Hamish Rodda <rodda@kde.org>
0003 * Copyright 2011 Mathieu Lornac <mathieu.lornac@gmail.com>
0004 * Copyright 2011 Damien Coppel <damien.coppel@gmail.com>
0005 * Copyright 2011 Lionel Duc <lionel.data@gmail.com>
0006 * Copyright 2011 Sarie Lucas <lucas.sarie@gmail.com>
0007 * Copyright 2017 Anton Anikin <anton@anikin.xyz>
0008 
0009   This program is free software; you can redistribute it and/or
0010   modify it under the terms of the GNU General Public
0011   License as published by the Free Software Foundation; either
0012   version 2 of the License, or (at your option) any later version.
0013 
0014   This program is distributed in the hope that it will be useful,
0015   but WITHOUT ANY WARRANTY; without even the implied warranty of
0016   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0017    General Public License for more details.
0018 
0019   You should have received a copy of the GNU General Public License
0020   along with this program; see the file COPYING.  If not, write to
0021   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0022   Boston, MA 02110-1301, USA.
0023 */
0024 
0025 #pragma once
0026 
0027 #include <interfaces/iproblem.h>
0028 
0029 #include <QList>
0030 
0031 namespace Valgrind
0032 {
0033 
0034 namespace XmlParser
0035 {
0036 
0037 struct Frame
0038 {
0039     void setValue(const QString& name, const QString& value);
0040 
0041     KDevelop::IProblem::Ptr toIProblem(const QString& toolName, bool showInstructionPointer) const;
0042 
0043     int line = 0;
0044 
0045     QString function = QStringLiteral("???");
0046     QString instructionPointer;
0047 
0048     QString objectFile;
0049 
0050     QString directory;
0051     QString file;
0052 };
0053 
0054 struct Stack
0055 {
0056     Frame* addFrame();
0057 
0058     KDevelop::IProblem::Ptr toIProblem(const QString& toolName, bool showInstructionPointer) const;
0059 
0060     QList<Frame> frames;
0061 };
0062 
0063 // DRD tool
0064 struct OtherSegment
0065 {
0066     Stack* addStack();
0067 
0068     KDevelop::IProblem::Ptr toIProblem(const QString& toolName, bool showInstructionPointer) const;
0069 
0070     bool isStart;
0071     QList<Stack> stacks;
0072 };
0073 
0074 struct Error
0075 {
0076     Stack* addStack();
0077     OtherSegment* addOtherSegment(bool isStart);
0078 
0079     void setValue(const QString& name, const QString& value);
0080 
0081     KDevelop::IProblem::Ptr toIProblem(const QString& toolName, bool showInstructionPointer) const;
0082 
0083     void clear();
0084 
0085     QList<Stack> stacks;
0086     QList<OtherSegment> otherSegments;
0087 
0088     QStringList messages;
0089 };
0090 
0091 }
0092 
0093 }