remote_gdb.cc (4572:5499df089a6c) | remote_gdb.cc (5543:3af77710f397) |
---|---|
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; --- 16 unchanged lines hidden (view full) --- 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 * 28 * Authors: Nathan Binkert 29 */ 30 31/* 32 * Copyright (c) 1990, 1993 | 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; --- 16 unchanged lines hidden (view full) --- 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 * 28 * Authors: Nathan Binkert 29 */ 30 31/* 32 * Copyright (c) 1990, 1993 |
33 * The Regents of the University of California. All rights reserved. | 33 * The Regents of the University of California. All rights reserved. |
34 * 35 * This software was developed by the Computer Systems Engineering group 36 * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and 37 * contributed to Berkeley. 38 * 39 * All advertising materials mentioning features or use of this software 40 * must display the following acknowledgement: | 34 * 35 * This software was developed by the Computer Systems Engineering group 36 * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and 37 * contributed to Berkeley. 38 * 39 * All advertising materials mentioning features or use of this software 40 * must display the following acknowledgement: |
41 * This product includes software developed by the University of 42 * California, Lawrence Berkeley Laboratories. | 41 * This product includes software developed by the University of 42 * California, Lawrence Berkeley Laboratories. |
43 * 44 * Redistribution and use in source and binary forms, with or without 45 * modification, are permitted provided that the following conditions 46 * are met: 47 * 1. Redistributions of source code must retain the above copyright 48 * notice, this list of conditions and the following disclaimer. 49 * 2. Redistributions in binary form must reproduce the above copyright 50 * notice, this list of conditions and the following disclaimer in the 51 * documentation and/or other materials provided with the distribution. 52 * 3. All advertising materials mentioning features or use of this software 53 * must display the following acknowledgement: | 43 * 44 * Redistribution and use in source and binary forms, with or without 45 * modification, are permitted provided that the following conditions 46 * are met: 47 * 1. Redistributions of source code must retain the above copyright 48 * notice, this list of conditions and the following disclaimer. 49 * 2. Redistributions in binary form must reproduce the above copyright 50 * notice, this list of conditions and the following disclaimer in the 51 * documentation and/or other materials provided with the distribution. 52 * 3. All advertising materials mentioning features or use of this software 53 * must display the following acknowledgement: |
54 * This product includes software developed by the University of 55 * California, Berkeley and its contributors. | 54 * This product includes software developed by the University of 55 * California, Berkeley and its contributors. |
56 * 4. Neither the name of the University nor the names of its contributors 57 * may be used to endorse or promote products derived from this software 58 * without specific prior written permission. 59 * 60 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 61 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 62 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 63 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 64 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 65 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 66 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 67 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 68 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 69 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 70 * SUCH DAMAGE. 71 * | 56 * 4. Neither the name of the University nor the names of its contributors 57 * may be used to endorse or promote products derived from this software 58 * without specific prior written permission. 59 * 60 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 61 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 62 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 63 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 64 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 65 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 66 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 67 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 68 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 69 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 70 * SUCH DAMAGE. 71 * |
72 * @(#)kgdb_stub.c 8.4 (Berkeley) 1/12/94 | 72 * @(#)kgdb_stub.c 8.4 (Berkeley) 1/12/94 |
73 */ 74 75/*- 76 * Copyright (c) 2001 The NetBSD Foundation, Inc. 77 * All rights reserved. 78 * 79 * This code is derived from software contributed to The NetBSD Foundation 80 * by Jason R. Thorpe. 81 * 82 * Redistribution and use in source and binary forms, with or without 83 * modification, are permitted provided that the following conditions 84 * are met: 85 * 1. Redistributions of source code must retain the above copyright 86 * notice, this list of conditions and the following disclaimer. 87 * 2. Redistributions in binary form must reproduce the above copyright 88 * notice, this list of conditions and the following disclaimer in the 89 * documentation and/or other materials provided with the distribution. 90 * 3. All advertising materials mentioning features or use of this software 91 * must display the following acknowledgement: | 73 */ 74 75/*- 76 * Copyright (c) 2001 The NetBSD Foundation, Inc. 77 * All rights reserved. 78 * 79 * This code is derived from software contributed to The NetBSD Foundation 80 * by Jason R. Thorpe. 81 * 82 * Redistribution and use in source and binary forms, with or without 83 * modification, are permitted provided that the following conditions 84 * are met: 85 * 1. Redistributions of source code must retain the above copyright 86 * notice, this list of conditions and the following disclaimer. 87 * 2. Redistributions in binary form must reproduce the above copyright 88 * notice, this list of conditions and the following disclaimer in the 89 * documentation and/or other materials provided with the distribution. 90 * 3. All advertising materials mentioning features or use of this software 91 * must display the following acknowledgement: |
92 * This product includes software developed by the NetBSD 93 * Foundation, Inc. and its contributors. | 92 * This product includes software developed by the NetBSD 93 * Foundation, Inc. and its contributors. |
94 * 4. Neither the name of The NetBSD Foundation nor the names of its 95 * contributors may be used to endorse or promote products derived 96 * from this software without specific prior written permission. 97 * 98 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 99 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 100 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 101 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS --- 44 unchanged lines hidden (view full) --- 146 : BaseRemoteGDB(_system, c, KGDB_NUMREGS) 147{ 148 memset(gdbregs.regs, 0, gdbregs.bytes()); 149} 150 151/////////////////////////////////////////////////////////// 152// RemoteGDB::acc 153// | 94 * 4. Neither the name of The NetBSD Foundation nor the names of its 95 * contributors may be used to endorse or promote products derived 96 * from this software without specific prior written permission. 97 * 98 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 99 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 100 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 101 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS --- 44 unchanged lines hidden (view full) --- 146 : BaseRemoteGDB(_system, c, KGDB_NUMREGS) 147{ 148 memset(gdbregs.regs, 0, gdbregs.bytes()); 149} 150 151/////////////////////////////////////////////////////////// 152// RemoteGDB::acc 153// |
154// Determine if the mapping at va..(va+len) is valid. | 154// Determine if the mapping at va..(va+len) is valid. |
155// 156bool 157RemoteGDB::acc(Addr va, size_t len) 158{ 159#if !FULL_SYSTEM 160 panic("acc function needs to be rewritten for SE mode\n"); 161#else 162 Addr last_va; --- 36 unchanged lines hidden (view full) --- 199 DPRINTF(GDBAcc, "acc: %#x mapping is valid\n", va); 200 return true; 201#endif 202} 203 204/////////////////////////////////////////////////////////// 205// RemoteGDB::getregs 206// | 155// 156bool 157RemoteGDB::acc(Addr va, size_t len) 158{ 159#if !FULL_SYSTEM 160 panic("acc function needs to be rewritten for SE mode\n"); 161#else 162 Addr last_va; --- 36 unchanged lines hidden (view full) --- 199 DPRINTF(GDBAcc, "acc: %#x mapping is valid\n", va); 200 return true; 201#endif 202} 203 204/////////////////////////////////////////////////////////// 205// RemoteGDB::getregs 206// |
207// Translate the kernel debugger register format into 208// the GDB register format. | 207// Translate the kernel debugger register format into 208// the GDB register format. |
209void 210RemoteGDB::getregs() 211{ 212 memset(gdbregs.regs, 0, gdbregs.bytes()); 213 214 gdbregs.regs[KGDB_REG_PC] = context->readPC(); 215 216 // @todo: Currently this is very Alpha specific. --- 12 unchanged lines hidden (view full) --- 229 gdbregs.regs[i + KGDB_REG_F0] = context->readFloatRegBits(i); 230 } 231#endif 232} 233 234/////////////////////////////////////////////////////////// 235// RemoteGDB::setregs 236// | 209void 210RemoteGDB::getregs() 211{ 212 memset(gdbregs.regs, 0, gdbregs.bytes()); 213 214 gdbregs.regs[KGDB_REG_PC] = context->readPC(); 215 216 // @todo: Currently this is very Alpha specific. --- 12 unchanged lines hidden (view full) --- 229 gdbregs.regs[i + KGDB_REG_F0] = context->readFloatRegBits(i); 230 } 231#endif 232} 233 234/////////////////////////////////////////////////////////// 235// RemoteGDB::setregs 236// |
237// Translate the GDB register format into the kernel 238// debugger register format. | 237// Translate the GDB register format into the kernel 238// debugger register format. |
239// 240void 241RemoteGDB::setregs() 242{ 243 // @todo: Currently this is very Alpha specific. 244 if (AlphaISA::PcPAL(gdbregs.regs[KGDB_REG_PC])) { 245 for (int i = 0; i < TheISA::NumIntArchRegs; ++i) { 246 context->setIntReg(AlphaISA::reg_redir[i], gdbregs.regs[i]); --- 71 unchanged lines hidden --- | 239// 240void 241RemoteGDB::setregs() 242{ 243 // @todo: Currently this is very Alpha specific. 244 if (AlphaISA::PcPAL(gdbregs.regs[KGDB_REG_PC])) { 245 for (int i = 0; i < TheISA::NumIntArchRegs; ++i) { 246 context->setIntReg(AlphaISA::reg_redir[i], gdbregs.regs[i]); --- 71 unchanged lines hidden --- |