Review Request 121442: gdb: Refactoring of GDB/MI and state tracking (work in progress)

Nicolai Hähnle nhaehnle at gmail.com
Fri Dec 12 14:15:24 UTC 2014



> On Dez. 12, 2014, 12:19 nachm., Milian Wolff wrote:
> > debuggers/gdb/gdb.h, line 48
> > <https://git.reviewboard.kde.org/r/121442/diff/2/?file=332672#file332672line48>
> >
> >     style: put & next to typename

Will do. I ask for forgiveness for future instances where this may happen, this kind of habit is hard to change ;)


> On Dez. 12, 2014, 12:19 nachm., Milian Wolff wrote:
> > debuggers/gdb/mi/miparser.cpp, line 142
> > <https://git.reviewboard.kde.org/r/121442/diff/2/?file=332681#file332681line142>
> >
> >     is the explicit move really required?

Yes. Returning the stream object implies making a copy, but std::unique_ptr cannot be copied. I just verified this just to make sure: indeed, gcc produces an error message if I replace this by "return stream;".


> On Dez. 12, 2014, 12:19 nachm., Milian Wolff wrote:
> > debuggers/gdb/unittests/test_gdb.cpp, line 920
> > <https://git.reviewboard.kde.org/r/121442/diff/2/?file=332683#file332683line920>
> >
> >     this is also done elsewhere, right? can you factor it out into a function?

Done. Ultimately this check should probably be moved into the plugin itself at some point, when the "Attach to process" dialog is revived, though I'm unsure where this type of naturally global function should best be placed.


- Nicolai


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/121442/#review71856
-----------------------------------------------------------


On Dez. 11, 2014, 2:54 nachm., Nicolai Hähnle wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/121442/
> -----------------------------------------------------------
> 
> (Updated Dez. 11, 2014, 2:54 nachm.)
> 
> 
> Review request for KDevelop.
> 
> 
> Repository: kdevelop
> 
> 
> Description
> -------
> 
> Please excuse what is probably a bit of an abuse of the system. I wanted to use KDevelop in remote debugging and ran into trouble because it gets horribly confused when user commands (including from a GDB setup script as specified in the Launch Configuration) modify certain kinds of state. I started working on this and things kind of escalated, so I wanted to put something out there ASAP to let you know that I'm working on this and to get feedback on the direction this is going.
> 
> The overall direction of those changes is to modify the gdb plugin such that it picks up state changes (running state, breakpoints, etc.) based on the async notifications rather than based on the command it sends itself. This is crucial for handling correctly the case where the user enters a command such as "continue" directly in the GDB view, or (more importantly for my use case) to handle at all the case where I set up a GDB script to attach to a remote target.
> 
> The first milestone I set for myself is being able to do *any* remote debugging in my particular use case at all, while keeping the unit tests working correctly. Longer term, I hope to be able to fix the breakpoint handling so that it picks up breakpoints set outside the control of KDevelop, and other similar issues as they come up.
> 
> This is a series of patches, the headlines of which are currently:
> 
> gdb: remove unused QueueWhileInterrupted mode from the command queue
> gdb: do not use addCommandToFront in DisassembleWidget
> gdb: DebugSession: add a testing mode for unit tests
> gdb: match structure more closely to the GDB/MI documentation and use cmd tokens
> gdb: always process async notifications from GDB
> gdb: remove magic constants in GDBMI::StreamRecord
> gdb: remove flaky DebugSession::parseStreamRecord
> gdb: add braces around multi-line if statement
> gdb: examineCoreFile: update IDebugSession::state() to match unit tests
> gdb: update session state more robustly based on async notifications
> 
> 
> Diffs
> -----
> 
>   debuggers/gdb/debugsession.h dbe06c5 
>   debuggers/gdb/debugsession.cpp 63f9a58 
>   debuggers/gdb/disassemblewidget.cpp 67024cf 
>   debuggers/gdb/gdb.h 31688cd 
>   debuggers/gdb/gdb.cpp 4dc7b5d 
>   debuggers/gdb/gdbcommand.h fb23c47 
>   debuggers/gdb/gdbcommand.cpp 67abbd8 
>   debuggers/gdb/breakpointcontroller.h 1b8ae0e 
>   debuggers/gdb/breakpointcontroller.cpp d5ba5dd 
>   debuggers/gdb/debuggerplugin.h 4c6bb07 
>   debuggers/gdb/DESIGN.txt ddefb70 
>   debuggers/gdb/gdbcommandqueue.h 7d82f45 
>   debuggers/gdb/gdbcommandqueue.cpp 801bc41 
>   debuggers/gdb/gdbglobal.h ef31c02 
>   debuggers/gdb/mi/gdbmi.h d5e92b8 
>   debuggers/gdb/mi/miparser.h 7096af0 
>   debuggers/gdb/mi/miparser.cpp 123c97e 
>   debuggers/gdb/unittests/test_gdb.h b9a961d 
>   debuggers/gdb/unittests/test_gdb.cpp 03a1203 
>   debuggers/gdb/variablecontroller.h f5ac8c1 
>   debuggers/gdb/variablecontroller.cpp 5eb9908 
> 
> Diff: https://git.reviewboard.kde.org/r/121442/diff/
> 
> 
> Testing
> -------
> 
> unit tests; debugging KDevelop with itself and some remote debugging
> 
> 
> Thanks,
> 
> Nicolai Hähnle
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20141212/0eb94ee8/attachment.html>


More information about the KDevelop-devel mailing list