diff --git a/tdbg.cpp b/tdbg.cpp index 8db550ec07b3c1dcae00f40ffa5e5cd2467c4460..c206018499b30d9b382da5f84460362a4d9a2f49 100644 --- a/tdbg.cpp +++ b/tdbg.cpp @@ -619,6 +619,7 @@ bool running = true; InputMode mode = INPUT_MODE_NORMAL; std::string input_buffer; + std::string current_source_filename; std::vector log_buffer; int log_scroll_offset = 0; int locals_scroll_offset = 0; @@ -652,8 +653,10 @@ if (le.IsValid()) { std::string fullpath; if (le.GetFileSpec().GetDirectory()) { fullpath = std::string(le.GetFileSpec().GetDirectory()) + "/" + le.GetFileSpec().GetFilename(); + current_source_filename = le.GetFileSpec().GetFilename(); } else { fullpath = le.GetFileSpec().GetFilename(); + current_source_filename = fullpath; } const std::vector& lines = source_cache.get_lines(fullpath); int total_lines = (int)lines.size(); @@ -701,7 +704,11 @@ log_msg(log_buffer, "Already running"); } } else if (ev.ch == 'b') { mode = INPUT_MODE_BREAKPOINT; - input_buffer.clear(); + if (!current_source_filename.empty()) { + input_buffer = current_source_filename + ":"; + } else { + input_buffer.clear(); + } } else if (ev.ch == 'p') { mode = INPUT_MODE_VARIABLE; input_buffer.clear();