KDevelop LLDB support - GDB plugin refactor

Authored by qi437103 on May 30 2016, 4:39 AM.

Description

KDevelop LLDB support - GDB plugin refactor

Summary:
Extract common code from the GDB debugger plugin, which potentially can be reused by LLDB debugger plugin.
This refactor only touches the low-level plugin part. The UI related and other things (namely launch configuration and configpages) will be done in a separate RR later.

Changes done:

  • Rename namespace GDBMI to KDevDebugger::MI
  • Move MI parser code to common folder
  • Rename namespace GDBDebugger to KDevDebugger::GDB
  • Move code from GDBDebugger::DebugSession to KDevDebugger::DebugSessionBase and make KDevDebugger::GDB::DebugSession inherits from it
  • Move code from GDBDebugger::GDB to KDevDebugger::DebuggerBase and make KDevDebugger::GDB::GDB inherits from it
  • Move code from GDBDebugger::GdbFrameStackModel to KDevDebugger::MIFrameStackModel and make KDevDebugger::GDB::GdbFrameStackModel inherits from it
  • Move code from GDBDebugger::BreakpointController to KDevDebugger::BreakpointControllerBase and make KDevDebugger::GDB::BreakpointController inherits from it
  • Move code from GDBDebugger::VariableController to KDevDebugger::VariableControllerBase and make KDevDebugger::GDB::VariableController inherits from it
  • Move code from GDBDebugger::GdbVariable to KDevDebugger::MIVariable and make KDevDebugger::GDB::GdbVariable inherits from it
  • Move stty and stringhelper to common code

It's still unknown how much LLDB-MI comforms to the MI specification, so I might be moving too much code to common code, but I try to reuse as many code as possible when implementing LLDB support, and will move some GDB-specific code back when it's suitable.

Note: unit test requires protected access to several class in KDevPlatform, due to namespace changes, the friend class declaration in KDevPlatform are invalid now. You will need to change that in KDevPlatform:debugger/variable/variablecollection.h to get the unit test compile. Anyway, I don't it's a good idea to have friend class declaration in KDevPlatform, and I'm looking into fix that later.

Test Plan: Use existing unit tests, which should all pass, except 4-5 tests that are failing before these change.

Reviewers: apol

Subscribers: kdevelop-devel

Differential Revision: https://phabricator.kde.org/D1693

Merged Changes

CommitAuthorDetailsCommitted
372a3fa113ceqi437103
Rename namespace KDevDebugger to KDevMI 
May 30 2016
c25f61e279d2qi437103
Rename KDevDebugger::GDB::GDB to KDevDebugger::GDB::GdbDebugger 
May 27 2016
305adba5e715qi437103
Rename BreakpointControllerBase to MIBreakpointController 
May 27 2016
9dc74528abe9qi437103
Rename VariableControllerBase to MIVariableController 
May 27 2016
a2e64106f886qi437103
Rename DebugSessionBase to MIDebugSession 
May 27 2016
18d9409c77b4qi437103
Rename DebuggerBase to MIDebugger 
May 27 2016
3c5954c1afccqi437103
Move VariableController to VariableControllerBase, GdbVariable to MIVariable 
May 26 2016
fd75b43a1306qi437103
Move GdbFrameStackModel to MIFrameStackModel 
May 26 2016
2ab7ba361b00qi437103
More detailed debug logs 
May 24 2016
9b2aa3176a51qi437103
Fix gdb debugger plugin unittest: testUpdateBreakpoint 
May 24 2016
a7ba0cd3e114qi437103
Fix random abort in unittest caused by the timeout killer in DebugSessionBase… 
May 24 2016
774b1846680fqi437103
Make GDB::DebugSession inherit from DebugSessionBase. Note some unit tests… 
May 24 2016
462b03b8b8d4qi437103
Move start method from DebuggerBase to GDB, because it's too GDB specific 
May 24 2016
a9fbeebe997cqi437103
Move breakpointcontroller to common code, move stringhelpers to common code. 
May 20 2016
dced7a0fc7d2qi437103
Add missing programNoApp and programFinished methods to DebugSessionBase 
May 20 2016
9dc4b89f7702qi437103
Add missing copyright lines 
May 19 2016
adc96909006aqi437103
Basic DebugSessionBase implementation 
May 19 2016
46bfbaf3d241qi437103
Remove unused forward declaration 
May 19 2016
4ba364bef733qi437103
Add a debug output 
May 19 2016
881ad4757889qi437103
Move stty to common code 
May 19 2016
4c5738a6c044qi437103
Make GDB inherit from DebuggerBase 
May 19 2016
63770adb05ffqi437103
Add license for debuglog.h 
May 19 2016
3035f0140835qi437103
Move gdb/debug.h to common/debuglog.h 
May 19 2016
e5dc08561f16qi437103
Rename KDevDebugger::GDBDEbugger to KDevDebugger::GDB 
May 19 2016
f88ae3eb2ae4qi437103
Move namespace MI under namespace KDevDebugger, move MILexer/MIParser into… 
May 19 2016
a44b61b28d5aqi437103
Fix white space 
May 19 2016
fd12ea776ed6qi437103
Move namespace GDBDebugger under namespace KDevDebugger, move gdbglobal.h to… 
May 19 2016
fb1e1dfdd0ebqi437103
Move GDBCommand to MICommand 
May 19 2016
328f477d5714qi437103
White space 
May 19 2016
7bb35fabcd40qi437103
Rename GDBMI to MI 
May 19 2016
d2e8761413b3qi437103
Move MI code to common, preparing for LLDB plugin 
May 19 2016