Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1692)

Side by Side Diff: debugger/rsp/rsp_info_packets.cc

Issue 7466014: Add rsp::GetOffsets command + reply (Closed) Base URL: http://nativeclient-sdk.googlecode.com/svn/trunk/src/
Patch Set: '' Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « debugger/rsp/rsp_info_packets.h ('k') | debugger/rsp/rsp_packets.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Native Client Authors. All rights reserved. 1 // Copyright (c) 2011 The Native Client Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 #include "debugger/rsp/rsp_info_packets.h" 4 #include "debugger/rsp/rsp_info_packets.h"
5 5
6 namespace rsp { 6 namespace rsp {
7 void QuerySupportedCommand::AddFeature(const std::string& name, 7 void QuerySupportedCommand::AddFeature(const std::string& name,
8 const std::string& value) { 8 const std::string& value) {
9 features_.push_back(std::pair<std::string, std::string>(name, value)); 9 features_.push_back(std::pair<std::string, std::string>(name, value));
10 } 10 }
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 return false; 120 return false;
121 121
122 eom_ = ('l' == cmd); 122 eom_ = ('l' == cmd);
123 body_ = message->ToString(); 123 body_ = message->ToString();
124 return true; 124 return true;
125 } 125 }
126 126
127 void QXferReply::ToBlob(debug::Blob* message) const { 127 void QXferReply::ToBlob(debug::Blob* message) const {
128 Format(message, (eom_ ? "l%s" : "m%s"), body_.c_str()); 128 Format(message, (eom_ ? "l%s" : "m%s"), body_.c_str());
129 } 129 }
130
131 bool GetOffsetsReply::FromBlob(const std::string& type, debug::Blob* message) {
132 // Example: Text=c00000000;Data=c00000000
133 std::deque<debug::Blob> statements;
134 message->Split(debug::Blob().FromString(";"), &statements);
135 for (size_t i = 0; i < statements.size(); i++) {
136 std::deque<debug::Blob> tokens;
137 statements[i].Split(debug::Blob().FromString("="), &tokens);
138 if (tokens.size() >= 2) {
139 if ("Text" == tokens[0].ToString())
140 rsp::PopIntFromFront(&tokens[1], &text_offset_);
141 else if ("Data" == tokens[0].ToString())
142 rsp::PopIntFromFront(&tokens[1], &data_offset_);
143 }
144 }
145 return true;
146 }
147
148 void GetOffsetsReply::ToBlob(debug::Blob* message) const {
149 message->Append(debug::Blob().FromString("Text="));
150 rsp::PushIntToBack(text_offset_, message);
151 message->Append(debug::Blob().FromString(";Data="));
152 rsp::PushIntToBack(data_offset_, message);
153 }
154
130 } // namespace rsp 155 } // namespace rsp
131 156
OLDNEW
« no previous file with comments | « debugger/rsp/rsp_info_packets.h ('k') | debugger/rsp/rsp_packets.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698