|
|
|
@ -102,7 +102,7 @@ void Debugger::Init(const uint32_t device_id, const std::string device_target) {
|
|
|
|
|
device_id_ = device_id;
|
|
|
|
|
MS_LOG(INFO) << "Debugger got device_target: " << device_target;
|
|
|
|
|
device_target_ = device_target;
|
|
|
|
|
version_ = "1.1.0";
|
|
|
|
|
version_ = "1.2.0";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Debugger::EnableDebugger() {
|
|
|
|
@ -617,6 +617,29 @@ void Debugger::CommandLoop() {
|
|
|
|
|
run = true;
|
|
|
|
|
break;
|
|
|
|
|
case DebuggerCommand::kRunCMD:
|
|
|
|
|
ProcessRunCMD(reply);
|
|
|
|
|
// exit loop
|
|
|
|
|
run = true;
|
|
|
|
|
break;
|
|
|
|
|
case DebuggerCommand::kSetCMD:
|
|
|
|
|
ProcessKSetCMD(reply);
|
|
|
|
|
break;
|
|
|
|
|
case DebuggerCommand::kViewCMD:
|
|
|
|
|
ProcessKViewCMD(reply);
|
|
|
|
|
break;
|
|
|
|
|
case DebuggerCommand::kVersionMatchedCMD:
|
|
|
|
|
MS_LOG(ERROR) << "Received unexpected Version Matched CMD from Mindinsight.";
|
|
|
|
|
Exit();
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
MS_LOG(ERROR) << "Received unknown CMD from Mindinsight";
|
|
|
|
|
Exit();
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Debugger::ProcessRunCMD(const EventReply &reply) {
|
|
|
|
|
MS_LOG(INFO) << "RunCMD";
|
|
|
|
|
if (GetRunLevel(reply) == "recheck") {
|
|
|
|
|
MS_LOG(INFO) << "rechecking all watchpoints";
|
|
|
|
@ -631,12 +654,10 @@ void Debugger::CommandLoop() {
|
|
|
|
|
|
|
|
|
|
MS_LOG(INFO) << "run_level: " << run_level_;
|
|
|
|
|
MS_LOG(INFO) << "node_name_: " << node_name_;
|
|
|
|
|
|
|
|
|
|
// exit loop
|
|
|
|
|
run = true;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case DebuggerCommand::kSetCMD:
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Debugger::ProcessKSetCMD(const EventReply &reply) {
|
|
|
|
|
MS_LOG(INFO) << "SetCMD";
|
|
|
|
|
MS_LOG(INFO) << "id: " << GetWatchpointID(reply);
|
|
|
|
|
MS_LOG(INFO) << "delete: " << GetWatchpointDelete(reply);
|
|
|
|
@ -659,8 +680,9 @@ void Debugger::CommandLoop() {
|
|
|
|
|
}
|
|
|
|
|
SetWatchpoint(GetWatchnodes(reply), GetWatchcondition(reply), GetWatchpointID(reply), GetParameters(reply));
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case DebuggerCommand::kViewCMD: {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Debugger::ProcessKViewCMD(const EventReply &reply) {
|
|
|
|
|
MS_LOG(INFO) << "ViewCMD";
|
|
|
|
|
// print view cmd content
|
|
|
|
|
ProtoVector<TensorProto> received_tensors = GetTensors(reply);
|
|
|
|
@ -690,17 +712,6 @@ void Debugger::CommandLoop() {
|
|
|
|
|
if (send_tensors_reply.status() != send_tensors_reply.OK) {
|
|
|
|
|
MS_LOG(ERROR) << "Error: SendTensors failed";
|
|
|
|
|
}
|
|
|
|
|
} break;
|
|
|
|
|
case DebuggerCommand::kVersionMatchedCMD:
|
|
|
|
|
MS_LOG(ERROR) << "Received unexpected Version Matched CMD from Mindinsight.";
|
|
|
|
|
Exit();
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
MS_LOG(ERROR) << "Received unknown CMD from Mindinsight";
|
|
|
|
|
Exit();
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void AddTensorProtoInfo(TensorProto *tensor_item, TensorProto tensor) {
|
|
|
|
@ -967,7 +978,7 @@ ProtoVector<TensorProto> GetTensors(const EventReply &reply) {
|
|
|
|
|
std::string GetTensorFullName(const TensorProto &tensor) {
|
|
|
|
|
string node_name = tensor.node_name();
|
|
|
|
|
if (tensor.truncate()) {
|
|
|
|
|
// scopes in node name are seperated by '/'
|
|
|
|
|
// scopes in node name are separated by '/'
|
|
|
|
|
// use the name without scope if truncate is true
|
|
|
|
|
std::size_t found = node_name.find_last_of("/");
|
|
|
|
|
node_name = node_name.substr(found + 1);
|
|
|
|
|