Skip to content

Commit

Permalink
[debugger] Remove JumpToLine method (unused)
Browse files Browse the repository at this point in the history
GitOrigin-RevId: d99b3228bbb5c42a93163a4649b213510ff16bb0
  • Loading branch information
werat authored and copybara-github committed Mar 7, 2022
1 parent 0563dd0 commit bdd1df5
Show file tree
Hide file tree
Showing 9 changed files with 1 addition and 79 deletions.
12 changes: 0 additions & 12 deletions DebuggerGrpc/protos/RemoteThreadApi.proto
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ service RemoteThreadRpcService {
}
rpc GetProcess(GetProcessRequest) returns (GetProcessResponse) {
}
rpc JumpToLine(JumpToLineRequest) returns (JumpToLineResponse) {
}
rpc GetFramesWithInfo(GetFramesWithInfoRequest)
returns (GetFramesWithInfoResponse) {
}
Expand Down Expand Up @@ -174,16 +172,6 @@ message GetProcessResponse {
Common.GrpcSbProcess process = 1;
}

message JumpToLineRequest {
Common.GrpcSbThread thread = 1;
string filePath = 2;
uint32 line = 3;
}

message JumpToLineResponse {
Common.GrpcSbError error = 1;
}

message GetFramesWithInfoRequest {
Common.GrpcSbThread thread = 1;
uint32 fields = 2;
Expand Down
25 changes: 0 additions & 25 deletions DebuggerGrpcClient/Implementations/RemoteThreadProxy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -318,31 +318,6 @@ public RemoteFrame GetFrameAtIndex(uint index)
return null;
}

public SbError JumpToLine(string filePath, uint line)
{
JumpToLineResponse response = null;
if (connection.InvokeRpc(() =>
{
response = client.JumpToLine(new JumpToLineRequest
{
Thread = grpcSbThread,
FilePath = filePath,
Line = line,
});
}))
{
if (response.Error != null)
{
return errorFactory.Create(response.Error);
}
}
return errorFactory.Create(new GrpcSbError
{
Success = false,
Error = "Rpc error while calling JumpToLine()."
});
}

public List<FrameInfoPair> GetFramesWithInfo(
FrameInfoFlags fields, uint startIndex, uint maxCount)
{
Expand Down
5 changes: 0 additions & 5 deletions DebuggerGrpcClient/Interfaces/RemoteThread.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,6 @@ public interface RemoteThread
/// </summary>
uint GetStopReasonDataCount();

/// <summary>
/// Jump to |line| in file at |filePath|
/// </summary>
SbError JumpToLine(string filePath, uint line);

/// <summary>
/// Retrieves requested information synchronously about the frames of this thread.
/// </summary>
Expand Down
5 changes: 1 addition & 4 deletions DebuggerGrpcServer/Implementations/RemoteThreadImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,6 @@ public ulong GetStopReasonDataAtIndex(uint index) =>

public uint GetStopReasonDataCount() => sbThread.GetStopReasonDataCount();

public SbError JumpToLine(string filePath, uint line) =>
sbThread.JumpToLine(filePath, line);

public SbThread GetSbThread() => sbThread;

public List<FrameInfoPair> GetFramesWithInfo(
Expand All @@ -83,7 +80,7 @@ public List<FrameInfoPair> GetFramesWithInfo(
var framesWithInfo = new List<FrameInfoPair>();

/// This is a workaround to avoid calling <see cref="sbThread.GetNumFrames"/>.
/// It is a very expensive call for cases when stack is significantly larger
/// It is a very expensive call for cases when stack is significantly larger
/// than <see cref="startIndex+maxCount"/>, because it traverses the whole stack.
for (uint i = startIndex; i < startIndex + maxCount; ++i)
{
Expand Down
5 changes: 0 additions & 5 deletions DebuggerGrpcServer/RemoteInterfaces/RemoteThread.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,6 @@ public interface RemoteThread
/// </summary>
uint GetStopReasonDataCount();

/// <summary>
/// Jump to |line| in file at |filePath|
/// </summary>
SbError JumpToLine(string filePath, uint line);

/// <summary>
/// Returns the underlying SbThread.
/// </summary>
Expand Down
14 changes: 0 additions & 14 deletions DebuggerGrpcServer/Services/RemoteThreadRpcServiceImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -161,20 +161,6 @@ public override Task<GetFrameAtIndexResponse> GetFrameAtIndex(
return Task.FromResult(response);
}

public override Task<JumpToLineResponse> JumpToLine(JumpToLineRequest request, ServerCallContext context)
{
var thread = threadStore.GetObject(request.Thread.Id);
var error = thread.JumpToLine(request.FilePath, request.Line);
return Task.FromResult(new JumpToLineResponse
{
Error = new GrpcSbError
{
Success = error.Success(),
Error = error.GetCString()
}
});
}

public override Task<GetFramesWithInfoResponse> GetFramesWithInfo(
GetFramesWithInfoRequest request, ServerCallContext context)
{
Expand Down
3 changes: 0 additions & 3 deletions LldbApi/SbThread.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,5 @@ public interface SbThread

// Gets the number of words associated with the stop reason.
uint GetStopReasonDataCount();

// Jump to |line| in file at |filePath|
SbError JumpToLine(string filePath, uint line);
}
}
10 changes: 0 additions & 10 deletions YetiVSI.DebugEngine.LLDBWorker/LLDBThread.cc
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,5 @@ uint32_t LLDBThread::GetStopReasonDataCount() {
return (uint32_t)thread_->GetStopReasonDataCount();
}

SbError ^ LLDBThread::JumpToLine(System::String ^ filePath, uint32_t line) {
lldb::SBFileSpec fileSpec((msclr::interop::marshal_as<std::string>(
filePath)).c_str(), true);
auto error = thread_->JumpToLine(fileSpec, line);
if (!error.IsValid()) {
return nullptr;
}
return gcnew LLDBError(error);
}

} // namespace DebugEngine
} // namespace YetiVSI
1 change: 0 additions & 1 deletion YetiVSI.DebugEngine.LLDBWorker/LLDBThread.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ ref class LLDBThread sealed : SbThread {
virtual StopReason GetStopReason();
virtual uint64_t GetStopReasonDataAtIndex(uint32_t index);
virtual uint32_t GetStopReasonDataCount();
virtual SbError ^ JumpToLine(System::String ^ filePath, uint32_t line);

private:
ManagedUniquePtr<lldb::SBThread> ^ thread_;
Expand Down

0 comments on commit bdd1df5

Please sign in to comment.