Changeset View
Changeset View
Standalone View
Standalone View
debuggers/gdb/debugsession.cpp
Show First 20 Lines • Show All 52 Lines • ▼ Show 20 Line(s) | |||||
53 | using namespace KDevMI::MI; | 53 | using namespace KDevMI::MI; | ||
54 | using namespace KDevelop; | 54 | using namespace KDevelop; | ||
55 | 55 | | |||
56 | DebugSession::DebugSession() | 56 | DebugSession::DebugSession() | ||
57 | : MIDebugSession() | 57 | : MIDebugSession() | ||
58 | , m_breakpointController(nullptr) | 58 | , m_breakpointController(nullptr) | ||
59 | , m_variableController(nullptr) | 59 | , m_variableController(nullptr) | ||
60 | , m_frameStackModel(nullptr) | 60 | , m_frameStackModel(nullptr) | ||
61 | , m_autoDisableASLR(false) | ||||
61 | { | 62 | { | ||
62 | m_breakpointController = new BreakpointController(this); | 63 | m_breakpointController = new BreakpointController(this); | ||
63 | m_variableController = new VariableController(this); | 64 | m_variableController = new VariableController(this); | ||
64 | m_frameStackModel = new GdbFrameStackModel(this); | 65 | m_frameStackModel = new GdbFrameStackModel(this); | ||
65 | } | 66 | } | ||
66 | 67 | | |||
67 | DebugSession::~DebugSession() | 68 | DebugSession::~DebugSession() | ||
68 | { | 69 | { | ||
69 | } | 70 | } | ||
70 | 71 | | |||
72 | void DebugSession::setAutoDisableASLR(bool enable) | ||||
73 | { | ||||
74 | m_autoDisableASLR = enable; | ||||
75 | } | ||||
76 | | ||||
71 | BreakpointController *DebugSession::breakpointController() const | 77 | BreakpointController *DebugSession::breakpointController() const | ||
72 | { | 78 | { | ||
73 | return m_breakpointController; | 79 | return m_breakpointController; | ||
74 | } | 80 | } | ||
75 | 81 | | |||
76 | VariableController *DebugSession::variableController() const | 82 | VariableController *DebugSession::variableController() const | ||
77 | { | 83 | { | ||
78 | return m_variableController; | 84 | return m_variableController; | ||
Show All 36 Lines | 119 | if (!fileName.isEmpty()) { | |||
115 | QString quotedPrintersPath = fileInfo.dir().path() | 121 | QString quotedPrintersPath = fileInfo.dir().path() | ||
116 | .replace('\\', "\\\\") | 122 | .replace('\\', "\\\\") | ||
117 | .replace('"', "\\\""); | 123 | .replace('"', "\\\""); | ||
118 | addCommand(MI::NonMI, | 124 | addCommand(MI::NonMI, | ||
119 | QString("python sys.path.insert(0, \"%0\")").arg(quotedPrintersPath)); | 125 | QString("python sys.path.insert(0, \"%0\")").arg(quotedPrintersPath)); | ||
120 | addCommand(MI::NonMI, "source " + fileName); | 126 | addCommand(MI::NonMI, "source " + fileName); | ||
121 | } | 127 | } | ||
122 | 128 | | |||
129 | // GDB can't disable ASLR on CI server. | ||||
130 | addCommand(MI::GdbSet, | ||||
131 | QStringLiteral("disable-randomization %1").arg(m_autoDisableASLR ? "on" : "off")); | ||||
132 | | ||||
123 | qCDebug(DEBUGGERGDB) << "Initialized GDB"; | 133 | qCDebug(DEBUGGERGDB) << "Initialized GDB"; | ||
124 | } | 134 | } | ||
125 | 135 | | |||
126 | void DebugSession::configure(ILaunchConfiguration *cfg) | 136 | void DebugSession::configure(ILaunchConfiguration *cfg) | ||
127 | { | 137 | { | ||
128 | // Read Configuration values | 138 | // Read Configuration values | ||
129 | KConfigGroup grp = cfg->config(); | 139 | KConfigGroup grp = cfg->config(); | ||
130 | bool breakOnStart = grp.readEntry(KDevMI::breakOnStartEntry, false); | 140 | bool breakOnStart = grp.readEntry(KDevMI::breakOnStartEntry, false); | ||
▲ Show 20 Lines • Show All 141 Lines • Show Last 20 Lines |