110 |
# open a pipe for debugger command,.... |
# open a pipe for debugger command,.... |
111 |
# |
# |
112 |
def start |
def start |
113 |
|
|
114 |
|
# if not the current Editpane is not a real edit pane then do nothing |
115 |
return unless @plugin['/system/ui/current/EditPane'].managed? |
return unless @plugin['/system/ui/current/EditPane'].managed? |
116 |
|
|
117 |
|
# Check if the file is modified. if so must save it before debugging |
118 |
|
ep = @plugin['/system/ui/current/EditPane'] |
119 |
|
file = ep.manager.filename |
120 |
|
if ep.manager.modified? |
121 |
|
answer = @cmd_mgr.command("App/Services/YesNoDialog").invoke("Save Changes before debug...", "You must first save the file before running the debugger. Save changes to '#{file}'?") |
122 |
|
return unless answer == 'yes' |
123 |
|
ep.manager.save |
124 |
|
# update file name in case it was changed by a 'save as...' |
125 |
|
file = ep.manager.filename |
126 |
|
end |
127 |
|
|
128 |
|
# all ok show the debugger |
129 |
@actions['show'].invoke |
@actions['show'].invoke |
130 |
|
|
131 |
# initialize variables |
# initialize variables |
133 |
@running = false |
@running = false |
134 |
@action_queue = Array.new |
@action_queue = Array.new |
135 |
|
|
136 |
|
|
137 |
# open the debugger command pipe |
# open the debugger command pipe |
138 |
open_pipe() |
open_pipe() |
139 |
|
|
141 |
# FIXME: in the future we should create "debugging profiles" where a user can |
# FIXME: in the future we should create "debugging profiles" where a user can |
142 |
# indicate in a dialog box what ruby interpreter to use, what include dir, what module |
# indicate in a dialog box what ruby interpreter to use, what include dir, what module |
143 |
# to include, command line arguments... |
# to include, command line arguments... |
|
file = @plugin['/system/ui/current/EditPane'].manager.file |
|
144 |
@plugin.log_info << "File to debug : #{file}" |
@plugin.log_info << "File to debug : #{file}" |
145 |
debuggee_file = File.join("#{@plugin.plugin_configuration.full_base_path}","debuggee.rb") |
debuggee_file = File.join("#{@plugin.plugin_configuration.full_base_path}","debuggee.rb") |
146 |
drb_file = File.join(@plugin['/system/properties/config/codebase'].data,'redist','drb','drb') |
drb_file = File.join(@plugin['/system/properties/config/codebase'].data,'redist','drb','drb') |