2 * Copyright (c) 2002-2005 The Regents of The University of Michigan
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;
9 * redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution;
12 * neither the name of the copyright holders nor the names of its
13 * contributors may be used to endorse or promote products derived from
14 * this software without specific prior written permission.
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
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.
28 * Authors: Nathan Binkert
32 * Copyright (c) 1990, 1993
33 * The Regents of the University of California. All rights reserved.
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.
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.
44 * Redistribution and use in source and binary forms, with or without
45 * modification, are permitted provided that the following conditions
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.
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.
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
72 * @(#)kgdb_stub.c 8.4 (Berkeley) 1/12/94
76 * Copyright (c) 2001 The NetBSD Foundation, Inc.
77 * All rights reserved.
79 * This code is derived from software contributed to The NetBSD Foundation
82 * Redistribution and use in source and binary forms, with or without
83 * modification, are permitted provided that the following conditions
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.
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.
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
102 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
103 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
104 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
105 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
106 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
107 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
108 * POSSIBILITY OF SUCH DAMAGE.
112 * $NetBSD: kgdb_stub.c,v 1.8 2001/07/07 22:58:00 wdk Exp $
116 * "Stub" to allow remote cpu to debug over a serial line using gdb.
119 #include <sys/signal.h>
125 #include "config/full_system.hh"
128 #include "arch/vtophys.hh"
131 #include "base/intmath.hh"
132 #include "base/remote_gdb.hh"
133 #include "base/socket.hh"
134 #include "base/trace.hh"
135 #include "config/the_isa.hh"
136 #include "cpu/thread_context.hh"
137 #include "cpu/static_inst.hh"
138 #include "mem/port.hh"
139 #include "mem/translating_port.hh"
140 #include "sim/system.hh"
143 using namespace TheISA
;
146 vector
<BaseRemoteGDB
*> debuggers
;
151 static int current_debugger
= -1;
152 if (current_debugger
>= 0 && current_debugger
< (int)debuggers
.size()) {
153 BaseRemoteGDB
*gdb
= debuggers
[current_debugger
];
154 if (!gdb
->isattached())
155 gdb
->listener
->accept();
156 if (gdb
->isattached())
162 ///////////////////////////////////////////////////////////
167 GDBListener::Event::Event(GDBListener
*l
, int fd
, int e
)
168 : PollEvent(fd
, e
), listener(l
)
172 GDBListener::Event::process(int revent
)
177 GDBListener::GDBListener(BaseRemoteGDB
*g
, int p
)
178 : event(NULL
), gdb(g
), port(p
)
180 assert(!gdb
->listener
);
181 gdb
->listener
= this;
184 GDBListener::~GDBListener()
193 return gdb
->name() + ".listener";
197 GDBListener::listen()
199 if (ListenSocket::allDisabled()) {
200 warn_once("Sockets disabled, not accepting gdb connections");
204 while (!listener
.listen(port
, true)) {
205 DPRINTF(GDBMisc
, "Can't bind port %d\n", port
);
209 event
= new Event(this, listener
.getfd(), POLLIN
);
210 pollQueue
.schedule(event
);
213 gdb
->number
= debuggers
.size();
214 debuggers
.push_back(gdb
);
218 ccprintf(cerr
, "%d: %s: listening for remote gdb #%d on port %d\n",
219 curTick
, name(), gdb
->number
, port
);
221 ccprintf(cerr
, "%d: %s: listening for remote gdb on port %d\n",
222 curTick
, name(), port
);
227 GDBListener::accept()
229 if (!listener
.islistening())
230 panic("GDBListener::accept(): cannot accept if we're not listening!");
232 int sfd
= listener
.accept(true);
235 if (gdb
->isattached())
242 BaseRemoteGDB::Event::Event(BaseRemoteGDB
*g
, int fd
, int e
)
243 : PollEvent(fd
, e
), gdb(g
)
247 BaseRemoteGDB::Event::process(int revent
)
251 else if (revent
& POLLNVAL
)
255 BaseRemoteGDB::BaseRemoteGDB(System
*_system
, ThreadContext
*c
, size_t cacheSize
)
256 : event(NULL
), listener(NULL
), number(-1), fd(-1),
257 active(false), attached(false),
258 system(_system
), pmem(_system
->physmem
), context(c
),
261 memset(gdbregs
.regs
, 0, gdbregs
.bytes());
264 BaseRemoteGDB::~BaseRemoteGDB()
271 BaseRemoteGDB::name()
273 return system
->name() + ".remote_gdb";
277 BaseRemoteGDB::isattached()
281 BaseRemoteGDB::attach(int f
)
285 event
= new Event(this, fd
, POLLIN
);
286 pollQueue
.schedule(event
);
289 DPRINTFN("remote gdb attached\n");
293 BaseRemoteGDB::detach()
299 pollQueue
.remove(event
);
300 DPRINTFN("remote gdb detached\n");
304 BaseRemoteGDB::gdb_command(char cmd
)
307 case GDBSignal
: return "KGDB_SIGNAL";
308 case GDBSetBaud
: return "KGDB_SET_BAUD";
309 case GDBSetBreak
: return "KGDB_SET_BREAK";
310 case GDBCont
: return "KGDB_CONT";
311 case GDBAsyncCont
: return "KGDB_ASYNC_CONT";
312 case GDBDebug
: return "KGDB_DEBUG";
313 case GDBDetach
: return "KGDB_DETACH";
314 case GDBRegR
: return "KGDB_REG_R";
315 case GDBRegW
: return "KGDB_REG_W";
316 case GDBSetThread
: return "KGDB_SET_THREAD";
317 case GDBCycleStep
: return "KGDB_CYCLE_STEP";
318 case GDBSigCycleStep
: return "KGDB_SIG_CYCLE_STEP";
319 case GDBKill
: return "KGDB_KILL";
320 case GDBMemW
: return "KGDB_MEM_W";
321 case GDBMemR
: return "KGDB_MEM_R";
322 case GDBSetReg
: return "KGDB_SET_REG";
323 case GDBReadReg
: return "KGDB_READ_REG";
324 case GDBQueryVar
: return "KGDB_QUERY_VAR";
325 case GDBSetVar
: return "KGDB_SET_VAR";
326 case GDBReset
: return "KGDB_RESET";
327 case GDBStep
: return "KGDB_STEP";
328 case GDBAsyncStep
: return "KGDB_ASYNC_STEP";
329 case GDBThreadAlive
: return "KGDB_THREAD_ALIVE";
330 case GDBTargetExit
: return "KGDB_TARGET_EXIT";
331 case GDBBinaryDload
: return "KGDB_BINARY_DLOAD";
332 case GDBClrHwBkpt
: return "KGDB_CLR_HW_BKPT";
333 case GDBSetHwBkpt
: return "KGDB_SET_HW_BKPT";
334 case GDBStart
: return "KGDB_START";
335 case GDBEnd
: return "KGDB_END";
336 case GDBGoodP
: return "KGDB_GOODP";
337 case GDBBadP
: return "KGDB_BADP";
338 default: return "KGDB_UNKNOWN";
342 /////////////////////////
347 BaseRemoteGDB::getbyte()
350 if (::read(fd
, &b
, 1) != 1)
351 warn("could not read byte from debugger");
356 BaseRemoteGDB::putbyte(uint8_t b
)
358 if (::write(fd
, &b
, 1) != 1)
359 warn("could not write byte to debugger");
362 // Send a packet to gdb
364 BaseRemoteGDB::send(const char *bp
)
369 DPRINTF(GDBSend
, "send: %s\n", bp
);
373 //Start sending a packet
375 //Send the contents, and also keep a check sum.
376 for (csum
= 0; (c
= *p
); p
++) {
380 //Send the ending character.
383 putbyte(i2digit(csum
>> 4));
384 putbyte(i2digit(csum
));
385 //Try transmitting over and over again until the other end doesn't send an
387 } while ((c
= getbyte() & 0x7f) == GDBBadP
);
390 // Receive a packet from gdb
392 BaseRemoteGDB::recv(char *bp
, int maxlen
)
401 //Find the beginning of a packet
402 while ((c
= getbyte()) != GDBStart
)
405 //Read until you find the end of the data in the packet, and keep
406 //track of the check sum.
407 while ((c
= getbyte()) != GDBEnd
&& len
< maxlen
) {
414 //Mask the check sum, and terminate the command string.
418 //If the command was too long, report an error.
424 //Bring in the checksum. If the check sum matches, csum will be 0.
425 csum
-= digit2i(getbyte()) * 16;
426 csum
-= digit2i(getbyte());
428 //If the check sum was correct
430 //Report that the packet was received correctly
437 memcpy(bp
, bp
+3, len
);
441 //Otherwise, report that there was a mistake.
445 DPRINTF(GDBRecv
, "recv: %s: %s\n", gdb_command(*bp
), bp
);
450 // Read bytes from kernel address space for debugger.
452 BaseRemoteGDB::read(Addr vaddr
, size_t size
, char *data
)
454 static Addr lastaddr
= 0;
455 static size_t lastsize
= 0;
458 DPRINTF(GDBRead
, "read: reading memory location zero!\n");
459 vaddr
= lastaddr
+ lastsize
;
462 DPRINTF(GDBRead
, "read: addr=%#x, size=%d", vaddr
, size
);
465 VirtualPort
*port
= context
->getVirtPort();
467 TranslatingPort
*port
= context
->getMemPort();
469 port
->readBlob(vaddr
, (uint8_t*)data
, size
);
472 if (DTRACE(GDBRead
)) {
473 if (DTRACE(GDBExtra
)) {
475 mem2hex(buf
, data
, size
);
476 DPRINTFNR(": %s\n", buf
);
485 // Write bytes to kernel address space for debugger.
487 BaseRemoteGDB::write(Addr vaddr
, size_t size
, const char *data
)
489 static Addr lastaddr
= 0;
490 static size_t lastsize
= 0;
493 DPRINTF(GDBWrite
, "write: writing memory location zero!\n");
494 vaddr
= lastaddr
+ lastsize
;
497 if (DTRACE(GDBWrite
)) {
498 DPRINTFN("write: addr=%#x, size=%d", vaddr
, size
);
499 if (DTRACE(GDBExtra
)) {
501 mem2hex(buf
, data
, size
);
502 DPRINTFNR(": %s\n", buf
);
507 VirtualPort
*port
= context
->getVirtPort();
509 TranslatingPort
*port
= context
->getMemPort();
511 port
->writeBlob(vaddr
, (uint8_t*)data
, size
);
519 PCEventQueue
*BaseRemoteGDB::getPcEventQueue()
521 return &system
->pcEventQueue
;
524 BaseRemoteGDB::HardBreakpoint::HardBreakpoint(BaseRemoteGDB
*_gdb
, Addr pc
)
525 : PCEvent(_gdb
->getPcEventQueue(), "HardBreakpoint Event", pc
),
526 gdb(_gdb
), refcount(0)
528 DPRINTF(GDBMisc
, "creating hardware breakpoint at %#x\n", evpc
);
532 BaseRemoteGDB::HardBreakpoint::process(ThreadContext
*tc
)
534 DPRINTF(GDBMisc
, "handling hardware breakpoint at %#x\n", pc());
536 if (tc
== gdb
->context
)
541 BaseRemoteGDB::insertSoftBreak(Addr addr
, size_t len
)
543 if (len
!= sizeof(TheISA::MachInst
))
544 panic("invalid length\n");
546 return insertHardBreak(addr
, len
);
550 BaseRemoteGDB::removeSoftBreak(Addr addr
, size_t len
)
552 if (len
!= sizeof(MachInst
))
553 panic("invalid length\n");
555 return removeHardBreak(addr
, len
);
559 BaseRemoteGDB::insertHardBreak(Addr addr
, size_t len
)
561 if (len
!= sizeof(MachInst
))
562 panic("invalid length\n");
564 DPRINTF(GDBMisc
, "inserting hardware breakpoint at %#x\n", addr
);
566 HardBreakpoint
*&bkpt
= hardBreakMap
[addr
];
568 bkpt
= new HardBreakpoint(this, addr
);
576 BaseRemoteGDB::removeHardBreak(Addr addr
, size_t len
)
578 if (len
!= sizeof(MachInst
))
579 panic("invalid length\n");
581 DPRINTF(GDBMisc
, "removing hardware breakpoint at %#x\n", addr
);
583 break_iter_t i
= hardBreakMap
.find(addr
);
584 if (i
== hardBreakMap
.end())
587 HardBreakpoint
*hbp
= (*i
).second
;
588 if (--hbp
->refcount
== 0) {
590 hardBreakMap
.erase(i
);
597 BaseRemoteGDB::setTempBreakpoint(Addr bkpt
)
599 DPRINTF(GDBMisc
, "setTempBreakpoint: addr=%#x\n", bkpt
);
600 insertHardBreak(bkpt
, sizeof(TheISA::MachInst
));
604 BaseRemoteGDB::clearTempBreakpoint(Addr
&bkpt
)
606 DPRINTF(GDBMisc
, "setTempBreakpoint: addr=%#x\n", bkpt
);
607 removeHardBreak(bkpt
, sizeof(TheISA::MachInst
));
612 BaseRemoteGDB::break_type(char c
)
615 case '0': return "software breakpoint";
616 case '1': return "hardware breakpoint";
617 case '2': return "write watchpoint";
618 case '3': return "read watchpoint";
619 case '4': return "access watchpoint";
620 default: return "unknown breakpoint/watchpoint";
624 // This function does all command processing for interfacing to a
625 // remote gdb. Note that the error codes are ignored by gdb at
626 // present, but might eventually become meaningful. (XXX) It might
627 // makes sense to use POSIX errno values, because that is what the
628 // gdb/remote.c functions want to return.
630 BaseRemoteGDB::trap(int type
)
634 char data
[GDBPacketBufLen
+ 1];
638 char command
, subcmd
;
645 bufferSize
= gdbregs
.bytes() * 2 + 256;
646 buffer
= (char*)malloc(bufferSize
);
648 DPRINTF(GDBMisc
, "trap: PC=%#x NPC=%#x\n",
649 context
->readPC(), context
->readNextPC());
654 * The first entry to this function is normally through
655 * a breakpoint trap in kgdb_connect(), in which case we
656 * must advance past the breakpoint because gdb will not.
658 * On the first entry here, we expect that gdb is not yet
659 * listening to us, so just enter the interaction loop.
660 * After the debugger is "active" (connected) it will be
661 * waiting for a "signaled" message from us.
666 // Tell remote host that an exception has occurred.
667 snprintf((char *)buffer
, bufferSize
, "S%02x", type
);
670 // Stick frame regs into our reg cache.
674 datalen
= recv(data
, sizeof(data
));
675 data
[sizeof(data
) - 1] = 0; // Sentinel
682 // if this command came from a running gdb, answer it --
683 // the other guy has no way of knowing if we're in or out
684 // of this loop when he issues a "remote-signal".
685 snprintf((char *)buffer
, bufferSize
,
691 if (2 * gdbregs
.bytes() > bufferSize
)
692 panic("buffer too small");
694 mem2hex(buffer
, gdbregs
.regs
, gdbregs
.bytes());
699 p
= hex2mem(gdbregs
.regs
, p
, gdbregs
.bytes());
700 if (p
== NULL
|| *p
!= '\0')
715 if (val
< 0 && val
>= KGDB_NUMREGS
) {
720 gdbregs
.regs
[val
] = hex2i(&p
);
738 if (len
> bufferSize
) {
742 if (!acc(val
, len
)) {
747 if (read(val
, (size_t)len
, (char *)buffer
)) {
748 // variable length array would be nice, but C++ doesn't
749 // officially support those...
750 char *temp
= new char[2*len
+1];
751 mem2hex(temp
, buffer
, len
);
770 if (len
> datalen
- (p
- data
)) {
774 p
= hex2mem(buffer
, p
, bufferSize
);
779 if (!acc(val
, len
)) {
783 if (write(val
, (size_t)len
, (char *)buffer
))
810 context
->setNextPC(val
+ sizeof(MachInst
));
816 if (p
- data
< (ptrdiff_t)datalen
) {
819 context
->setNextPC(val
+ sizeof(MachInst
));
829 context
->setNextPC(val
+ sizeof(MachInst
));
835 if (p
- data
< (ptrdiff_t)datalen
) {
838 context
->setNextPC(val
+ sizeof(MachInst
));
845 if (*p
++ != ',') send("E0D");
847 if (*p
++ != ',') send("E0D");
850 DPRINTF(GDBMisc
, "clear %s, addr=%#x, len=%d\n",
851 break_type(subcmd
), val
, len
);
856 case '0': // software breakpoint
857 ret
= removeSoftBreak(val
, len
);
860 case '1': // hardware breakpoint
861 ret
= removeHardBreak(val
, len
);
864 case '2': // write watchpoint
865 case '3': // read watchpoint
866 case '4': // access watchpoint
872 send(ret
? "OK" : "E0C");
877 if (*p
++ != ',') send("E0D");
879 if (*p
++ != ',') send("E0D");
882 DPRINTF(GDBMisc
, "set %s, addr=%#x, len=%d\n",
883 break_type(subcmd
), val
, len
);
888 case '0': // software breakpoint
889 ret
= insertSoftBreak(val
, len
);
892 case '1': // hardware breakpoint
893 ret
= insertHardBreak(val
, len
);
896 case '2': // write watchpoint
897 case '3': // read watchpoint
898 case '4': // access watchpoint
904 send(ret
? "OK" : "E0C");
908 var
= string(p
, datalen
- 1);
919 case GDBSigCycleStep
:
926 // Unsupported command
927 DPRINTF(GDBMisc
, "Unsupported command: %s\n",
928 gdb_command(command
));
929 DDUMP(GDBMisc
, (uint8_t *)data
, datalen
);
935 DPRINTF(GDBMisc
, "Unknown command: %c(%#x)\n",
949 // Convert a hex digit into an integer.
950 // This returns -1 if the argument passed is no valid hex digit.
952 BaseRemoteGDB::digit2i(char c
)
954 if (c
>= '0' && c
<= '9')
956 else if (c
>= 'a' && c
<= 'f')
957 return (c
- 'a' + 10);
958 else if (c
>= 'A' && c
<= 'F')
960 return (c
- 'A' + 10);
965 // Convert the low 4 bits of an integer into an hex digit.
967 BaseRemoteGDB::i2digit(int n
)
969 return ("0123456789abcdef"[n
& 0x0f]);
972 // Convert a byte array into an hex string.
974 BaseRemoteGDB::mem2hex(void *vdst
, const void *vsrc
, int len
)
976 char *dst
= (char *)vdst
;
977 const char *src
= (const char *)vsrc
;
980 *dst
++ = i2digit(*src
>> 4);
981 *dst
++ = i2digit(*src
++);
986 // Convert an hex string into a byte array.
987 // This returns a pointer to the character following the last valid
988 // hex digit. If the string ends in the middle of a byte, NULL is
991 BaseRemoteGDB::hex2mem(void *vdst
, const char *src
, int maxlen
)
993 char *dst
= (char *)vdst
;
996 while (*src
&& maxlen
--) {
997 msb
= digit2i(*src
++);
1000 lsb
= digit2i(*src
++);
1003 *dst
++ = (msb
<< 4) | lsb
;
1008 // Convert an hex string into an integer.
1009 // This returns a pointer to the character following the last valid
1012 BaseRemoteGDB::hex2i(const char **srcp
)
1014 const char *src
= *srcp
;
1018 while ((nibble
= digit2i(*src
)) >= 0) {