-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Server Mode #145
Closed
Closed
Server Mode #145
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,13 +22,13 @@ def help_command | |
|
||
def help(cmd) | ||
%{ | ||
q[uit]\texit from debugger, | ||
q[uit]\texit from debugger, | ||
exit\talias to quit | ||
} | ||
end | ||
end | ||
end | ||
|
||
class RestartCommand < Command # :nodoc: | ||
self.control = true | ||
|
||
|
@@ -39,7 +39,7 @@ def regexp | |
$ | ||
/x | ||
end | ||
|
||
def execute | ||
if not defined? Debugger::RDEBUG_SCRIPT or not defined? Debugger::ARGV | ||
print "We are not in a context we can restart from.\n" | ||
|
@@ -64,7 +64,7 @@ def help_command | |
|
||
def help(cmd) | ||
%{ | ||
restart|R [args] | ||
restart|R [args] | ||
Restart the program. This is is a re-exec - all debugger state | ||
is lost. If command arguments are passed those are used. | ||
} | ||
|
@@ -78,7 +78,7 @@ class StartCommand < Command # :nodoc: | |
def regexp | ||
/^\s*(start)(\s+ \S+ .*)?$/x | ||
end | ||
|
||
def execute | ||
@printer.print_debug("Starting: running program script") | ||
Debugger.run_prog_script #Debugger.prog_script_running? | ||
|
@@ -102,23 +102,23 @@ class InterruptCommand < Command # :nodoc: | |
self.event = false | ||
self.control = true | ||
self.need_context = true | ||
|
||
def regexp | ||
/^\s*i(?:nterrupt)?\s*$/ | ||
end | ||
|
||
def execute | ||
unless Debugger.interrupt_last | ||
context = Debugger.thread_context(Thread.main) | ||
context.interrupt | ||
end | ||
end | ||
|
||
class << self | ||
def help_command | ||
'interrupt' | ||
end | ||
|
||
def help(cmd) | ||
%{ | ||
i[nterrupt]\tinterrupt the program | ||
|
@@ -136,11 +136,13 @@ def regexp | |
end | ||
|
||
def execute | ||
Debugger.require_multiprocess | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. isn't it already required by this moment? |
||
interface.command_queue << "finish" if Debugger.skip_wait_for_start | ||
Debugger.stop | ||
Debugger.interface.close | ||
Debugger::MultiProcess.undo_monkey | ||
Debugger.control_thread = nil | ||
Thread.current.exit #@control_thread is a current thread | ||
Thread.current.exit unless Debugger.skip_wait_for_start #@control_thread is a current thread | ||
end | ||
|
||
class << self | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -90,6 +90,8 @@ def process_commands | |
end | ||
end | ||
rescue ::Exception | ||
# Workaround to Disconnect in Paused State | ||
return @interface.command_queue << "finish" if $!.message === 'closed stream' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it's better to return after logging the error and backtrace |
||
@printer.print_debug "INTERNAL ERROR!!! #{$!}\n" rescue nil | ||
@printer.print_error "INTERNAL ERROR!!! #{$!}\n" rescue nil | ||
@printer.print_error $!.backtrace.map{|l| "\t#{l}"}.join("\n") rescue nil | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need to require it here?