remote_gdb.cc (2684:71f3cabf891f) remote_gdb.cc (3082:2b5c51982f78)
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;

--- 782 unchanged lines hidden (view full) ---

791// gdb/remote.c functions want to return.
792bool
793RemoteGDB::trap(int type)
794{
795 uint64_t val;
796 size_t datalen, len;
797 char data[KGDB_BUFLEN + 1];
798 char buffer[sizeof(gdbregs) * 2 + 256];
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;

--- 782 unchanged lines hidden (view full) ---

791// gdb/remote.c functions want to return.
792bool
793RemoteGDB::trap(int type)
794{
795 uint64_t val;
796 size_t datalen, len;
797 char data[KGDB_BUFLEN + 1];
798 char buffer[sizeof(gdbregs) * 2 + 256];
799 char temp[KGDB_BUFLEN];
800 const char *p;
801 char command, subcmd;
802 string var;
803 bool ret;
804
805 if (!attached)
806 return false;
807

--- 91 unchanged lines hidden (view full) ---

899 continue;
900 }
901 if (!acc(val, len)) {
902 send("E05");
903 continue;
904 }
905
906 if (read(val, (size_t)len, (char *)buffer)) {
799 const char *p;
800 char command, subcmd;
801 string var;
802 bool ret;
803
804 if (!attached)
805 return false;
806

--- 91 unchanged lines hidden (view full) ---

898 continue;
899 }
900 if (!acc(val, len)) {
901 send("E05");
902 continue;
903 }
904
905 if (read(val, (size_t)len, (char *)buffer)) {
907 mem2hex(temp, buffer, len);
908 send(temp);
906 // variable length array would be nice, but C++ doesn't
907 // officially support those...
908 char *temp = new char[2*len+1];
909 mem2hex(temp, buffer, len);
910 send(temp);
911 delete [] temp;
909 } else {
912 } else {
910 send("E05");
913 send("E05");
911 }
912 continue;
913
914 case KGDB_MEM_W:
915 val = hex2i(&p);
916 if (*p++ != ',') {
917 send("E06");
918 continue;

--- 262 unchanged lines hidden ---
914 }
915 continue;
916
917 case KGDB_MEM_W:
918 val = hex2i(&p);
919 if (*p++ != ',') {
920 send("E06");
921 continue;

--- 262 unchanged lines hidden ---