Index: debugger/rsp/rsp_info_packets.cc |
=================================================================== |
--- debugger/rsp/rsp_info_packets.cc (revision 931) |
+++ debugger/rsp/rsp_info_packets.cc (working copy) |
@@ -127,5 +127,30 @@ |
void QXferReply::ToBlob(debug::Blob* message) const { |
Format(message, (eom_ ? "l%s" : "m%s"), body_.c_str()); |
} |
+ |
+bool GetOffsetsReply::FromBlob(const std::string& type, debug::Blob* message) { |
mmortensen
2011/07/21 17:36:44
Optional: these functions don't have comments that
garianov1
2011/07/21 17:50:36
Will fix in the separate CL.
|
+ // Example: Text=c00000000;Data=c00000000 |
+ std::deque<debug::Blob> statements; |
+ message->Split(debug::Blob().FromString(";"), &statements); |
+ for (size_t i = 0; i < statements.size(); i++) { |
+ std::deque<debug::Blob> tokens; |
+ statements[i].Split(debug::Blob().FromString("="), &tokens); |
+ if (tokens.size() >= 2) { |
+ if ("Text" == tokens[0].ToString()) |
+ rsp::PopIntFromFront(&tokens[1], &text_offset_); |
+ else if ("Data" == tokens[0].ToString()) |
+ rsp::PopIntFromFront(&tokens[1], &data_offset_); |
+ } |
+ } |
+ return true; |
+} |
+ |
+void GetOffsetsReply::ToBlob(debug::Blob* message) const { |
+ message->Append(debug::Blob().FromString("Text=")); |
+ rsp::PushIntToBack(text_offset_, message); |
+ message->Append(debug::Blob().FromString(";Data=")); |
+ rsp::PushIntToBack(data_offset_, message); |
+} |
+ |
} // namespace rsp |