remote_gdb.cc (5543:3af77710f397) | remote_gdb.cc (5545:d7c7b6752e2c) |
---|---|
1/* 2 * Copyright (c) 2002-2005 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 332 unchanged lines hidden (view full) --- 341///////////////////////// 342// 343// 344 345uint8_t 346BaseRemoteGDB::getbyte() 347{ 348 uint8_t b; | 1/* 2 * Copyright (c) 2002-2005 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 332 unchanged lines hidden (view full) --- 341///////////////////////// 342// 343// 344 345uint8_t 346BaseRemoteGDB::getbyte() 347{ 348 uint8_t b; |
349 ::read(fd, &b, 1); | 349 if (::read(fd, &b, 1) != 1) 350 warn("could not read byte from debugger"); |
350 return b; 351} 352 353void 354BaseRemoteGDB::putbyte(uint8_t b) 355{ | 351 return b; 352} 353 354void 355BaseRemoteGDB::putbyte(uint8_t b) 356{ |
356 ::write(fd, &b, 1); | 357 if (::write(fd, &b, 1) != 1) 358 warn("could not write byte to debugger"); |
357} 358 359// Send a packet to gdb 360void 361BaseRemoteGDB::send(const char *bp) 362{ 363 const char *p; 364 uint8_t csum, c; --- 659 unchanged lines hidden --- | 359} 360 361// Send a packet to gdb 362void 363BaseRemoteGDB::send(const char *bp) 364{ 365 const char *p; 366 uint8_t csum, c; --- 659 unchanged lines hidden --- |