Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import abc
from collections import defaultdict
import copy
import io
import json
import os
import shlex
Expand Down Expand Up @@ -51,7 +50,6 @@ def __init__(self, context):
self.prefix_recv: str = "<-"
self.out_handle = None
self.open = False
self.text = io.StringIO() # In-process copy of the message log.
self.lock = threading.Lock()

def _custom_enter(self):
Expand Down Expand Up @@ -93,8 +91,6 @@ def write_message(self, message: dict, incoming: bool):
message_str = json.dumps(
self._colorize_dap_message(message), indent=self.indent
).replace("\\u001b", "\033")

self.text.write(f"{prefix} {message_str}\n")
if self.out_handle is not None and self.open:
with self.lock:
self.out_handle.write(f"{prefix} {message_str}\n")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -430,16 +430,9 @@ def _post_step_hook(self):
trace_response = self._await_response(trace_req_id)
if not trace_response["success"]:
raise DebuggerException("failed to get stack frames")
try:
stackframes = trace_response["body"]["stackFrames"]
path = stackframes[0]["source"]["path"]
addr = stackframes[0]["instructionPointerReference"]
except KeyError as e:
# Temporarily print the DAP log if this fails to aid debugging
# a buildbot failure that doesn't reproduce easily.
print(self.message_logger.text.getvalue(), file=sys.stderr)
raise e

stackframes = trace_response["body"]["stackFrames"]
path = stackframes[0]["source"]["path"]
addr = stackframes[0]["instructionPointerReference"]
if any(
self._debugger_state.bp_addr_map.get(self.dex_id_to_dap_id[dex_bp_id])
== addr
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// UNSUPPORTED: system-windows
//
// RUN: %dexter_regression_test_cxx_build %s -o %t
// RUN: %dexter_regression_test_run -v --binary %t -- %s 2>&1 | FileCheck --dump-input-context=999999999 %s
// RUN: %dexter_regression_test_run -v --binary %t -- %s 2>&1 | FileCheck %s

int g = 0;
int c(int) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// UNSUPPORTED: system-windows
//
// RUN: %dexter_regression_test_cxx_build %s -o %t
// RUN: %dexter_regression_test_run -v --binary %t -- %s 2>&1 | FileCheck --dump-input-context=999999999 %s
// RUN: %dexter_regression_test_run -v --binary %t -- %s 2>&1 | FileCheck %s

int g = 0;
int c(int) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//
//
// RUN: %dexter_regression_test_cxx_build %s -o %t
// RUN: not %dexter_regression_test_run --binary %t -- %s | FileCheck --dump-input-context=999999999 %s
// RUN: not %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: dex_declare_file.cpp

int main() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// UNSUPPORTED: system-darwin
//
// RUN: %dexter_regression_test_cxx_build %s -o %t
// RUN: not %dexter_regression_test_run --binary %t -- %s | FileCheck --dump-input-context=999999999 %s
// RUN: not %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: expect_program_state.cpp:

int GCD(int lhs, int rhs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// UNSUPPORTED: system-darwin
//
// RUN: %dexter_regression_test_cxx_build %s -o %t
// RUN: not %dexter_regression_test_run --binary %t -- %s | FileCheck --dump-input-context=999999999 %s
// RUN: not %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: expect_step_kinds.cpp:

int abs(int i){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// UNSUPPORTED: system-darwin
//
// RUN: %dexter_regression_test_cxx_build %s -o %t
// RUN: not %dexter_regression_test_run --binary %t -- %s | FileCheck --dump-input-context=999999999 %s
// RUN: not %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: expect_step_order.cpp:

int main()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
// expected behaviour.
//
// RUN: %dexter_regression_test_cxx_build %s -o %t
// RUN: not %dexter_regression_test_run --binary %t -- %s | FileCheck --dump-input-context=999999999 %s
// RUN: not %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: expect_watch_type.cpp:

template<class T>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//
//
// RUN: %dexter_regression_test_cxx_build %s -o %t
// RUN: not %dexter_regression_test_run --binary %t -- %s | FileCheck --dump-input-context=999999999 %s
// RUN: not %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: expect_watch_value.cpp:

int main()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// UNSUPPORTED: system-darwin
//
// RUN: %dexter_regression_test_cxx_build %s -o %t
// RUN: not %dexter_regression_test_run --binary %t -- %s | FileCheck --dump-input-context=999999999 %s
// RUN: not %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: float_range_out_range.cpp:

int main() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// UNSUPPORTED: system-darwin
//
// RUN: %dexter_regression_test_cxx_build %s -o %t
// RUN: not %dexter_regression_test_run --binary %t -- %s | FileCheck --dump-input-context=999999999 %s
// RUN: not %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: float_range_zero_nonmatch.cpp:

int main() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// UNSUPPORTED: system-windows
//
// RUN: %dexter_regression_test_cxx_build %s -o %t
// RUN: not %dexter_regression_test_run --binary %t -- %s | FileCheck --dump-input-context=999999999 %s
// RUN: not %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: missing_dex_address.cpp

int main() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//
//
// RUN: %dexter_regression_test_cxx_build %s -o %t
// RUN: not %dexter_regression_test_run --binary %t -- %s | FileCheck --dump-input-context=999999999 %s
// RUN: not %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: unreachable.cpp:

int
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//
//
// RUN: %dexter_regression_test_cxx_build %s -o %t
// RUN: not %dexter_regression_test_run --binary %t -- %s | FileCheck --dump-input-context=999999999 %s
// RUN: not %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: unreachable_line_range.cpp:

int
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//
//
// RUN: %dexter_regression_test_cxx_build %s -o %t
// RUN: not %dexter_regression_test_run --binary %t -- %s | FileCheck --dump-input-context=999999999 %s
// RUN: not %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: unreachable_on_line.cpp:

int
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// UNSUPPORTED: system-windows
//
// RUN: %dexter_regression_test_c_build %s -o %t
// RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck --dump-input-context=999999999 %s
// RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: command_line.c:

int main(int argc, const char **argv) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// the first reference to that value.
//
// RUN: %dexter_regression_test_cxx_build %s -o %t
// RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck --dump-input-context=999999999 %s
// RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: address_after_ref.cpp

int main() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// times.
//
// RUN: %dexter_regression_test_cxx_build %s -o %t
// RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck --dump-input-context=999999999 %s
// RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: address_hit_count.cpp

int main() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// addresses of two local variables that refer to the same address.
//
// RUN: %dexter_regression_test_cxx_build %s -o %t
// RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck --dump-input-context=999999999 %s
// RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: expression_address.cpp

int main() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// pointer variables.
//
// RUN: %dexter_regression_test_cxx_build %s -o %t
// RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck --dump-input-context=999999999 %s
// RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: identical_address.cpp

int main() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// addresses can be used within a single \DexExpectWatchValue.
//
// RUN: %dexter_regression_test_cxx_build %s -o %t
// RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck --dump-input-context=999999999 %s
// RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: multiple_address.cpp

int main() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// variables that have a fixed offset between them.
//
// RUN: %dexter_regression_test_cxx_build %s -o %t
// RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck --dump-input-context=999999999 %s
// RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: offset_address.cpp

int main() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// value of a variable over time, relative to its initial value.
//
// RUN: %dexter_regression_test_cxx_build %s -o %t
// RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck --dump-input-context=999999999 %s
// RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: self_comparison.cpp

int main() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//
//
// RUN: %dexter_regression_test_cxx_build %s -o %t
// RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck --dump-input-context=999999999 %s
// RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: dex_and_source

int main() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# UNSUPPORTED: system-darwin
#
# RUN: %dexter_regression_test_cxx_build %S/test.cpp -o %t
# RUN: %dexter_regression_base --binary %t %s | FileCheck --dump-input-context=999999999 %s
# RUN: %dexter_regression_base --binary %t %s | FileCheck %s
# CHECK: commands.dex
#
# test.cpp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# UNSUPPORTED: system-darwin
#
# RUN: %clang %S/../source/test.cpp -O0 -g -o %t
# RUN: %dexter_regression_base --binary %t %s | FileCheck --dump-input-context=999999999 %s
# RUN: %dexter_regression_base --binary %t %s | FileCheck %s
# RUN: rm %t
# CHECK: commands.dex
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

# RUN: %clang %S/../source/test.cpp -O0 -g -o %t
# RUN: %dexter_regression_base --binary %t \
# RUN: --source-root-dir="%S/../source" -- %s | FileCheck --dump-input-context=999999999 %s
# RUN: --source-root-dir="%S/../source" -- %s | FileCheck %s
# RUN: rm %t

# CHECK: source_root_dir.dex: (1.0000)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# REQUIRES: system-windows
#
# RUN: %dexter_regression_test_cxx_build "%S/source/test file.cpp" -o %t
# RUN: %dexter_regression_base --binary %t %s | FileCheck --dump-input-context=999999999 %s
# RUN: %dexter_regression_base --binary %t %s | FileCheck %s
# CHECK: test.dex
#
# ./source/test file.cpp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// Tests using the default controller (no \DexLimitSteps).
//
// RUN: %dexter_regression_test_cxx_build %s -o %t
// RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck --dump-input-context=999999999 %s
// RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: default_conditional.cpp

int main() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// Tests using the default controller (no \DexLimitSteps).
//
// RUN: %dexter_regression_test_cxx_build %s -o %t
// RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck --dump-input-context=999999999 %s
// RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: default_conditional_hit_count.cpp

int main() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Tests using the default controller (no \DexLimitSteps).
//
// RUN: %dexter_regression_test_cxx_build %s -o %t
// RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck --dump-input-context=999999999 %s
// RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: default_hit_count.cpp

int main() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Tests using the default controller (no \DexLimitSteps).
//
// RUN: %dexter_regression_test_cxx_build %s -o %t
// RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck --dump-input-context=999999999 %s
// RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: default_simple.cpp

int main() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// UNSUPPORTED: system-windows
//
// RUN: %dexter_regression_test_cxx_build %s -o %t
// RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck --dump-input-context=999999999 %s
// RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: limit_steps_conditional.cpp

int main() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// UNSUPPORTED: system-windows
//
// RUN: %dexter_regression_test_cxx_build %s -o %t
// RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck --dump-input-context=999999999 %s
// RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: limit_steps_conditional_hit_count.cpp

int main() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// UNSUPPORTED: system-windows
//
// RUN: %dexter_regression_test_cxx_build %s -o %t
// RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck --dump-input-context=999999999 %s
// RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: limit_steps_hit_count.cpp

int main() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// UNSUPPORTED: system-windows, system-darwin
//
// RUN: %dexter_regression_test_cxx_build %s -o %t
// RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck --dump-input-context=999999999 %s
// RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: limit_steps_simple.cpp

int main() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//
//
// RUN: %dexter_regression_test_cxx_build %s -o %t
// RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck --dump-input-context=999999999 %s
// RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: expect_program_state.cpp:

int GCD(int lhs, int rhs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// XFAIL: system-windows
//
// RUN: %dexter_regression_test_cxx_build %s -o %t
// RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck --dump-input-context=999999999 %s
// RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: direction.cpp:

int func(int i) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// UNSUPPORTED: system-darwin
//
// RUN: %dexter_regression_test_cxx_build %s -o %t
// RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck --dump-input-context=999999999 %s
// RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: func.cpp:

int func(int i) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// why.
//
// RUN: %dexter_regression_test_cxx_build %s -o %t
// RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck --dump-input-context=999999999 %s
// RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: func_external.cpp:

#include <cstdlib>
Expand Down
Loading
Loading