-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCodeLocation.h
77 lines (43 loc) · 1.9 KB
/
CodeLocation.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
// CodeLocation.h
// Declares the CodeLocation class representing a container for a share-able Allocation's code location
#ifndef CODELOCATION_H
#define CODELOCATION_H
#include <memory>
#include <QString>
/** Represents a single code location in the memoryspace of the examined process,
together with any available debugging information.
Generally returned from a CodeLocationFactory which maintains a map of address -> CodeLocation instances,
so that multiple queries for the same address return the same code location. */
class CodeLocation
{
public:
CodeLocation(quint64 a_Address);
void setAddress(quint64 a_Address) { m_Address = a_Address; }
void setFunctionName(const QString & a_FunctionName) { m_FunctionName = a_FunctionName; }
void setFileName(const QString & a_FileName) { m_FileName = a_FileName; }
void setFileLineNum(quint32 a_FileLineNum) { m_FileLineNum = a_FileLineNum; }
void setHasTriedParsing() { m_HasTriedParsing = true; }
quint64 getAddress() const { return m_Address; }
const QString & getFunctionName() const { return m_FunctionName; }
const QString & getFileName() const { return m_FileName; }
quint32 getFileLineNum() const { return m_FileLineNum; }
bool hasTriedParsing() const { return m_HasTriedParsing; }
protected:
/** The raw address in the memoryspace. */
quint64 m_Address;
/** The name of the function.
Empty if not available, may also be "???" if valgrind fails to identify the location. */
QString m_FunctionName;
/** Source code file.
Empty if not available. */
QString m_FileName;
/** Source code line number.
0 if not available. */
quint32 m_FileLineNum;
/** True if the code location details have been parsed from the Massif log.
False for newly created CodeLocation instance.
Used by the parser to skip parsing of known locations. */
bool m_HasTriedParsing;
};
typedef std::shared_ptr<CodeLocation> CodeLocationPtr;
#endif // CODELOCATION_H