[VM/Service] Report the requested column in the error messages of CannotAddBreakpoint errors
TEST=CI Change-Id: Ia74bd61ef0b166275d5828fb21cfa9c92c5f00cf Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/389280 Reviewed-by: Ben Konyi <bkonyi@google.com> Commit-Queue: Derek Xu <derekx@google.com>
This commit is contained in:
@@ -139,7 +139,7 @@ final tests = <IsolateTest>[
|
||||
expect(e.code, RPCErrorKind.kCannotAddBreakpoint.code);
|
||||
expect(
|
||||
e.details,
|
||||
'addBreakpoint: Cannot add breakpoint at line $LINE_A. Error occurred '
|
||||
'addBreakpoint: Cannot add breakpoint at $LINE_A:37. Error occurred '
|
||||
'when resolving breakpoint location: No debuggable code where '
|
||||
'breakpoint was requested.',
|
||||
);
|
||||
|
||||
@@ -98,7 +98,7 @@ var tests = <IsolateTest>[
|
||||
expect(e.code, equals(ServerRpcException.kCannotAddBreakpoint));
|
||||
expect(
|
||||
e.message,
|
||||
'addBreakpoint: Cannot add breakpoint at line $LINE_A. Error occurred '
|
||||
'addBreakpoint: Cannot add breakpoint at $LINE_A:37. Error occurred '
|
||||
'when resolving breakpoint location: No debuggable code where '
|
||||
'breakpoint was requested.',
|
||||
);
|
||||
|
||||
+12
-4
@@ -4042,10 +4042,18 @@ static void AddBreakpointCommon(Thread* thread,
|
||||
Error::Handle(thread->isolate()->debugger()->SetBreakpointAtLineCol(
|
||||
script_uri, line, col, &bpt));
|
||||
if (!error.IsNull()) {
|
||||
js->PrintError(kCannotAddBreakpoint,
|
||||
"%s: Cannot add breakpoint at line %s. Error occurred "
|
||||
"when resolving breakpoint location: %s.",
|
||||
js->method(), line_param, error.ToErrorCString());
|
||||
if (col_param != nullptr) {
|
||||
js->PrintError(
|
||||
kCannotAddBreakpoint,
|
||||
"%s: Cannot add breakpoint at %s:%s. Error occurred when resolving "
|
||||
"breakpoint location: %s.",
|
||||
js->method(), line_param, col_param, error.ToErrorCString());
|
||||
} else {
|
||||
js->PrintError(kCannotAddBreakpoint,
|
||||
"%s: Cannot add breakpoint at line %s. Error occurred "
|
||||
"when resolving breakpoint location: %s.",
|
||||
js->method(), line_param, error.ToErrorCString());
|
||||
}
|
||||
return;
|
||||
}
|
||||
ASSERT(bpt != nullptr);
|
||||
|
||||
Reference in New Issue
Block a user