| 1 | // SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. | 
| 2 | // | 
| 3 | // SPDX-License-Identifier: GPL-3.0-or-later | 
| 4 |  | 
| 5 | #ifndef BREAKPOINT_H | 
| 6 | #define BREAKPOINT_H | 
| 7 |  | 
| 8 | #include <dap/protocol.h> | 
| 9 | #include <QString> | 
| 10 |  | 
| 11 | namespace Internal | 
| 12 | { | 
| 13 |  | 
| 14 | enum BreakpointType | 
| 15 | { | 
| 16 |     UnknownBreakpointType, | 
| 17 |     BreakpointByFileAndLine, | 
| 18 |     BreakpointByFunction, | 
| 19 |     BreakpointByAddress, | 
| 20 |     BreakpointAtThrow, | 
| 21 |     BreakpointAtCatch, | 
| 22 |     BreakpointAtExec, | 
| 23 |     LastBreakpointType | 
| 24 | }; | 
| 25 |  | 
| 26 | class Breakpoint | 
| 27 | { | 
| 28 | public: | 
| 29 |     Breakpoint(); | 
| 30 |  | 
| 31 |     void update(dap::Breakpoint &bp); | 
| 32 |  | 
| 33 |     bool operator==(const Breakpoint& o) const | 
| 34 |     { | 
| 35 |         if (filePath == o.filePath | 
| 36 |                 && lineNumber == o.lineNumber) | 
| 37 |             return true; | 
| 38 |         return false; | 
| 39 |     } | 
| 40 |  | 
| 41 |     bool enabled = true; | 
| 42 |     QString fileName; | 
| 43 |     QString filePath; | 
| 44 |     int lineNumber = 0; | 
| 45 |     int threadSpec = 0; | 
| 46 |     QString functionName; | 
| 47 |     QString module; | 
| 48 |     BreakpointType type = BreakpointByFileAndLine; | 
| 49 |     QString address; | 
| 50 | }; | 
| 51 |  | 
| 52 | using Breakpoints = QVector<Breakpoint>; | 
| 53 | } | 
| 54 |  | 
| 55 | #endif // BREAKPOINT_H | 
| 56 |  |