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