summaryrefslogtreecommitdiff
path: root/Applications/Debugger
diff options
context:
space:
mode:
authorAnotherTest <ali.mpfard@gmail.com>2020-05-25 16:57:07 +0430
committerAndreas Kling <kling@serenityos.org>2020-05-25 21:36:51 +0200
commitbc9013f7064fec7d0b6fe1d8513a62761978acad (patch)
tree82dca471709d6d9a5521963a6867104a876680d3 /Applications/Debugger
parent1e30ef239ba3a6a1108a11d25dc3024f4bdda029 (diff)
downloadserenity-bc9013f7064fec7d0b6fe1d8513a62761978acad.zip
LibLine: Change get_line to return a Result<String, Error>
This fixes a bunch of FIXME's in LibLine. Also handles the case where read() would read zero bytes in vt_dsr() and effectively block forever by erroring out. Fixes #2370
Diffstat (limited to 'Applications/Debugger')
-rw-r--r--Applications/Debugger/main.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/Applications/Debugger/main.cpp b/Applications/Debugger/main.cpp
index ded418d17a..203eab46c5 100644
--- a/Applications/Debugger/main.cpp
+++ b/Applications/Debugger/main.cpp
@@ -236,7 +236,13 @@ int main(int argc, char** argv)
}
for (;;) {
- auto command = editor.get_line("(sdb) ");
+ auto command_result = editor.get_line("(sdb) ");
+
+ if (command_result.is_error())
+ return DebugSession::DebugDecision::Detach;
+
+ auto& command = command_result.value();
+
bool success = false;
Optional<DebugSession::DebugDecision> decision;