Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright 2010 The Native Client Authors. All rights reserved. | 2 * Copyright 2010 The Native Client Authors. All rights reserved. |
| 3 * Use of this source code is governed by a BSD-style license that can | 3 * Use of this source code is governed by a BSD-style license that can |
| 4 * be found in the LICENSE file. | 4 * be found in the LICENSE file. |
| 5 */ | 5 */ |
| 6 | 6 |
| 7 | 7 |
| 8 #include <assert.h> | 8 #include <assert.h> |
| 9 #include <string.h> | 9 #include <string.h> |
| 10 #include <stdlib.h> | 10 #include <stdlib.h> |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 258 | 258 |
| 259 bool Packet::GetWord8(uint8_t *ch) { | 259 bool Packet::GetWord8(uint8_t *ch) { |
| 260 assert(ch); | 260 assert(ch); |
| 261 | 261 |
| 262 char seq1, seq2; | 262 char seq1, seq2; |
| 263 int val1, val2; | 263 int val1, val2; |
| 264 | 264 |
| 265 // Get two ASCII hex values | 265 // Get two ASCII hex values |
| 266 if (!GetRawChar(&seq1)) return false; | 266 if (!GetRawChar(&seq1)) return false; |
| 267 if (!GetRawChar(&seq2)) return false; | 267 if (!GetRawChar(&seq2)) return false; |
| 268 | 268 |
|
noelallen_use_chromium
2010/12/07 23:04:44
This looks like it should be removed. Accidental
mlinck
2010/12/10 21:10:27
Done.
| |
| 269 printf("GetWord8 got chars: %c %c\n", seq1, seq2); | |
|
mmortensen
2010/12/07 22:53:58
Having the printf is probably a big help here, sin
mlinck
2010/12/10 21:10:27
removed this
| |
| 270 | |
| 269 // Convert them to ints | 271 // Convert them to ints |
| 270 if (!NibbleToInt(seq1, &val1)) return false; | 272 if (!NibbleToInt(seq1, &val1)) return false; |
| 271 if (!NibbleToInt(seq2, &val2)) return false; | 273 if (!NibbleToInt(seq2, &val2)) return false; |
| 272 | 274 |
| 273 *ch = (val1 << 4) + val2; | 275 *ch = (val1 << 4) + val2; |
| 274 return true; | 276 return true; |
| 275 } | 277 } |
| 276 | 278 |
| 277 bool Packet::GetBlock(void *ptr, uint32_t len) { | 279 bool Packet::GetBlock(void *ptr, uint32_t len) { |
| 278 assert(ptr); | 280 assert(ptr); |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 292 assert(ptr); | 294 assert(ptr); |
| 293 return GetBlock(ptr, sizeof(*ptr)); | 295 return GetBlock(ptr, sizeof(*ptr)); |
| 294 } | 296 } |
| 295 | 297 |
| 296 bool Packet::GetWord32(uint32_t *ptr) { | 298 bool Packet::GetWord32(uint32_t *ptr) { |
| 297 assert(ptr); | 299 assert(ptr); |
| 298 return GetBlock(ptr, sizeof(*ptr)); | 300 return GetBlock(ptr, sizeof(*ptr)); |
| 299 } | 301 } |
| 300 | 302 |
| 301 bool Packet::GetWord64(uint64_t *ptr) { | 303 bool Packet::GetWord64(uint64_t *ptr) { |
| 304 printf("GetWord64 running \n"); | |
|
noelallen_use_chromium
2010/12/07 23:04:44
same.
mlinck
2010/12/10 21:10:27
Done.
| |
| 302 assert(ptr); | 305 assert(ptr); |
| 303 return GetBlock(ptr, sizeof(*ptr)); | 306 return GetBlock(ptr, sizeof(*ptr)); |
| 304 } | 307 } |
| 305 | 308 |
| 306 | 309 |
| 307 bool Packet::GetString(string* str) { | 310 bool Packet::GetString(string* str) { |
| 308 if (EndOfPacket()) return false; | 311 if (EndOfPacket()) return false; |
| 309 | 312 |
| 310 *str = &data_[read_index_]; | 313 *str = &data_[read_index_]; |
| 311 read_index_ = write_index_; | 314 read_index_ = write_index_; |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 383 | 386 |
| 384 return false; | 387 return false; |
| 385 } | 388 } |
| 386 | 389 |
| 387 void Packet::SetSequence(int32_t val) { | 390 void Packet::SetSequence(int32_t val) { |
| 388 seq_ = val; | 391 seq_ = val; |
| 389 } | 392 } |
| 390 | 393 |
| 391 } // namespace gdb_rsp | 394 } // namespace gdb_rsp |
| 392 | 395 |
| OLD | NEW |