Add some debugger memory utilities (#109)

* add some memory utilities

* run waitpid in a separate thread and support very simple breakpoints

* fix breakpoints

* add missing windows stub function

* fix error message on exit
This commit is contained in:
water111
2020-11-06 13:59:39 -05:00
committed by GitHub
parent f5ed2e6ad7
commit c09541fa98
20 changed files with 1430 additions and 57 deletions
+16 -3
View File
@@ -26,12 +26,21 @@ void Compiler::execute_repl() {
while (!m_want_exit) {
try {
// 1). get a line from the user (READ)
std::string prompt;
std::string prompt = "g";
if (m_listener.is_connected()) {
prompt = "gc";
prompt += "c";
} else {
prompt = "g";
prompt += " ";
}
if (m_debugger.is_halted()) {
prompt += "s";
} else if (m_debugger.is_attached()) {
prompt += "r";
} else {
prompt += " ";
}
Object code = m_goos.reader.read_from_stdin(prompt);
// 2). compile
@@ -246,6 +255,10 @@ std::vector<std::string> Compiler::run_test_no_load(const std::string& source_co
}
void Compiler::shutdown_target() {
if (m_debugger.is_attached()) {
m_debugger.detach();
}
if (m_listener.is_connected()) {
m_listener.send_reset(true);
}