[yast-devel] YCP debugger: prototype
Hi! Since there was interest in still providing YCP debugger, I gave it a shot and here is a first prototype. I did not test it to actually trace a real module, but it provides the basic functionality and I need feedback what needs to be improved, possibly reporting bugs. The patch for yast2-core is attached, the packages for openSUSE 11.4 are available in my home project: home:visnov:branches:openSUSE:11.4:Update:Test Usage: 1) zypper install yast2-core-debugger 2) start YaST2 process with --debugger option: /usr/lib/YaST2/bin/y2base --debugger <YCP-client> <frontend> 3) start debugger: /usr/lib/YaST2/bin/ycp-debugger The currently supported commands: yast-dbg> help Available commands: q quit help this help s step n next c continue p <var> print variable value b <fnc> set breakpoint rb <fnc> remove breakpoint bt backtrace v <var>=<val> set variable value attach attach to current YaST process detach detach from current YaST process WARNING: if you enter non-existent/empty command, the communication will go out of sync and you have to start over! TODO: Infrastructure: - enable debugger at runtime - secure socket creation Client: - make it robust, most likely a complete rewrite is a way to go Breakpoints: - set breakpoint to filename:linenumber - list breakpoints Any feedback is welcome! Stano
Hi! Here is updated patch with implemented some of the suggestions so far. Changes: - move almost all debugging flags to Debugger class instance, thus not influence memory requirements for non-debugger case - implemented remote debugging: /usr/lib/YaST2/bin/y2base --debugger-remote <YCP-client> <frontend> and client via /usr/lib/YaST2/bin/ycp-debugger <hostname> - use Y2DEBUGGER environment variable as also means to start local/remote debugger (set it to value "1" or "2") - provide better context information during tracing - do not allow to debug non-YCP code - refuse starting local debugging if socket already exists - fixed tracing if stepping from a breakpoint - some refactoring Feedback still welcome! Stano On Pi 22. Júl 2011 16:09:42 Stanislav Visnovsky wrote:
Hi!
Since there was interest in still providing YCP debugger, I gave it a shot and here is a first prototype. I did not test it to actually trace a real module, but it provides the basic functionality and I need feedback what needs to be improved, possibly reporting bugs.
The patch for yast2-core is attached, the packages for openSUSE 11.4 are available in my home project:
home:visnov:branches:openSUSE:11.4:Update:Test
Usage:
1) zypper install yast2-core-debugger 2) start YaST2 process with --debugger option:
/usr/lib/YaST2/bin/y2base --debugger <YCP-client> <frontend>
3) start debugger: /usr/lib/YaST2/bin/ycp-debugger
The currently supported commands:
yast-dbg> help Available commands:
q quit help this help s step n next c continue p <var> print variable value b <fnc> set breakpoint rb <fnc> remove breakpoint bt backtrace v <var>=<val> set variable value attach attach to current YaST process detach detach from current YaST process
WARNING: if you enter non-existent/empty command, the communication will go out of sync and you have to start over!
TODO: Infrastructure: - enable debugger at runtime - secure socket creation
Client: - make it robust, most likely a complete rewrite is a way to go
Breakpoints: - set breakpoint to filename:linenumber - list breakpoints
Any feedback is welcome!
Stano
On Fri, Jul 29, 2011 at 02:39:21PM +0200, Stanislav Višňovský wrote:
Hi!
Here is updated patch with implemented some of the suggestions so far.
Changes: - move almost all debugging flags to Debugger class instance, thus not influence memory requirements for non-debugger case - implemented remote debugging:
/usr/lib/YaST2/bin/y2base --debugger-remote <YCP-client> <frontend>
and client via
/usr/lib/YaST2/bin/ycp-debugger <hostname>
- use Y2DEBUGGER environment variable as also means to start local/remote debugger (set it to value "1" or "2") - provide better context information during tracing - do not allow to debug non-YCP code - refuse starting local debugging if socket already exists
ah, but then it should clean it up on normal exit?
- fixed tracing if stepping from a breakpoint - some refactoring
Committed! http://svn.opensuse.org/viewvc/yast?view=revision&revision=65256 With a small improvement to make CWM backtraces readable at all: http://svn.opensuse.org/viewvc/yast?view=revision&revision=65257 yast2-core-2.21.5 submitted for next week's M4 of 12.1: https://build.opensuse.org/request/show/78133
Feedback still welcome!
Hmm, is it OK for CallFrame to keep an unmanaged pointer to params? TODO: Move the socket to /var/run TODO: Can we enable it by default for the installation? TODO: For the SLES11 SP2 installation? Yay! -- Martin Vidner, YaST developer http://en.opensuse.org/User:Mvidner Kuracke oddeleni v restauraci je jako fekalni oddeleni v bazenu
On Pi 5. August 2011 16:58:28 Martin Vidner wrote:
On Fri, Jul 29, 2011 at 02:39:21PM +0200, Stanislav Višňovský wrote:
Hi!
Here is updated patch with implemented some of the suggestions so far.
Changes: - move almost all debugging flags to Debugger class instance, thus not influence memory requirements for non-debugger case
- implemented remote debugging: /usr/lib/YaST2/bin/y2base --debugger-remote <YCP-client> <frontend>
and client via
/usr/lib/YaST2/bin/ycp-debugger <hostname>
- use Y2DEBUGGER environment variable as also means to start local/remote debugger (set it to value "1" or "2") - provide better context information during tracing - do not allow to debug non-YCP code - refuse starting local debugging if socket already exists
ah, but then it should clean it up on normal exit?
- fixed tracing if stepping from a breakpoint - some refactoring
Committed! http://svn.opensuse.org/viewvc/yast?view=revision&revision=65256 With a small improvement to make CWM backtraces readable at all: http://svn.opensuse.org/viewvc/yast?view=revision&revision=65257
yast2-core-2.21.5 submitted for next week's M4 of 12.1: https://build.opensuse.org/request/show/78133
Thank you!
Feedback still welcome!
Hmm, is it OK for CallFrame to keep an unmanaged pointer to params?
I don't see right now how the pointer could become invalid while still on the CallFrame stack.
TODO: Move the socket to /var/run
Good point.
TODO: Can we enable it by default for the installation?
All you need to do is pass Y2DEBUGGER=2 to the kernel commandline. At least, this should work.
TODO: For the SLES11 SP2 installation?
See above, I believe this should work out of the box. Stano -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org
participants (2)
-
Martin Vidner
-
Stanislav Visnovsky