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>
124 #include "config/full_system.hh"
127 #include "arch/vtophys.hh"
130 #include "base/intmath.hh"
131 #include "base/remote_gdb.hh"
132 #include "base/socket.hh"
133 #include "base/trace.hh"
134 #include "cpu/thread_context.hh"
135 #include "cpu/static_inst.hh"
136 //#include "mem/physical.hh"
137 #include "mem/port.hh"
138 #include "mem/translating_port.hh"
139 #include "sim/system.hh"
142 using namespace TheISA
;
145 vector
<BaseRemoteGDB
*> debuggers
;
150 static int current_debugger
= -1;
151 if (current_debugger
>= 0 && current_debugger
< (int)debuggers
.size()) {
152 BaseRemoteGDB
*gdb
= debuggers
[current_debugger
];
153 if (!gdb
->isattached())
154 gdb
->listener
->accept();
155 if (gdb
->isattached())
161 ///////////////////////////////////////////////////////////
166 GDBListener::Event::Event(GDBListener
*l
, int fd
, int e
)
167 : PollEvent(fd
, e
), listener(l
)
171 GDBListener::Event::process(int revent
)
176 GDBListener::GDBListener(BaseRemoteGDB
*g
, int p
)
177 : event(NULL
), gdb(g
), port(p
)
179 assert(!gdb
->listener
);
180 gdb
->listener
= this;
183 GDBListener::~GDBListener()
192 return gdb
->name() + ".listener";
196 GDBListener::listen()
198 if (ListenSocket::allDisabled()) {
199 warn_once("Sockets disabled, not accepting gdb connections");
203 while (!listener
.listen(port
, true)) {
204 DPRINTF(GDBMisc
, "Can't bind port %d\n", port
);
208 event
= new Event(this, listener
.getfd(), POLLIN
);
209 pollQueue
.schedule(event
);
212 gdb
->number
= debuggers
.size();
213 debuggers
.push_back(gdb
);
217 ccprintf(cerr
, "%d: %s: listening for remote gdb #%d on port %d\n",
218 curTick
, name(), gdb
->number
, port
);
220 ccprintf(cerr
, "%d: %s: listening for remote gdb on port %d\n",
221 curTick
, name(), port
);
226 GDBListener::accept()
228 if (!listener
.islistening())
229 panic("GDBListener::accept(): cannot accept if we're not listening!");
231 int sfd
= listener
.accept(true);
234 if (gdb
->isattached())
241 BaseRemoteGDB::Event::Event(BaseRemoteGDB
*g
, int fd
, int e
)
242 : PollEvent(fd
, e
), gdb(g
)
246 BaseRemoteGDB::Event::process(int revent
)
250 else if (revent
& POLLNVAL
)
254 BaseRemoteGDB::BaseRemoteGDB(System
*_system
, ThreadContext
*c
, size_t cacheSize
)
255 : event(NULL
), listener(NULL
), number(-1), fd(-1),
256 active(false), attached(false),
257 system(_system
), pmem(_system
->physmem
), context(c
),
260 memset(gdbregs
.regs
, 0, gdbregs
.bytes());
263 BaseRemoteGDB::~BaseRemoteGDB()
270 BaseRemoteGDB::name()
272 return system
->name() + ".remote_gdb";
276 BaseRemoteGDB::isattached()
280 BaseRemoteGDB::attach(int f
)
284 event
= new Event(this, fd
, POLLIN
);
285 pollQueue
.schedule(event
);
288 DPRINTFN("remote gdb attached\n");
292 BaseRemoteGDB::detach()
298 pollQueue
.remove(event
);
299 DPRINTFN("remote gdb detached\n");
303 BaseRemoteGDB::gdb_command(char cmd
)
306 case GDBSignal
: return "KGDB_SIGNAL";
307 case GDBSetBaud
: return "KGDB_SET_BAUD";
308 case GDBSetBreak
: return "KGDB_SET_BREAK";
309 case GDBCont
: return "KGDB_CONT";
310 case GDBAsyncCont
: return "KGDB_ASYNC_CONT";
311 case GDBDebug
: return "KGDB_DEBUG";
312 case GDBDetach
: return "KGDB_DETACH";
313 case GDBRegR
: return "KGDB_REG_R";
314 case GDBRegW
: return "KGDB_REG_W";
315 case GDBSetThread
: return "KGDB_SET_THREAD";
316 case GDBCycleStep
: return "KGDB_CYCLE_STEP";
317 case GDBSigCycleStep
: return "KGDB_SIG_CYCLE_STEP";
318 case GDBKill
: return "KGDB_KILL";
319 case GDBMemW
: return "KGDB_MEM_W";
320 case GDBMemR
: return "KGDB_MEM_R";
321 case GDBSetReg
: return "KGDB_SET_REG";
322 case GDBReadReg
: return "KGDB_READ_REG";
323 case GDBQueryVar
: return "KGDB_QUERY_VAR";
324 case GDBSetVar
: return "KGDB_SET_VAR";
325 case GDBReset
: return "KGDB_RESET";
326 case GDBStep
: return "KGDB_STEP";
327 case GDBAsyncStep
: return "KGDB_ASYNC_STEP";
328 case GDBThreadAlive
: return "KGDB_THREAD_ALIVE";
329 case GDBTargetExit
: return "KGDB_TARGET_EXIT";
330 case GDBBinaryDload
: return "KGDB_BINARY_DLOAD";
331 case GDBClrHwBkpt
: return "KGDB_CLR_HW_BKPT";
332 case GDBSetHwBkpt
: return "KGDB_SET_HW_BKPT";
333 case GDBStart
: return "KGDB_START";
334 case GDBEnd
: return "KGDB_END";
335 case GDBGoodP
: return "KGDB_GOODP";
336 case GDBBadP
: return "KGDB_BADP";
337 default: return "KGDB_UNKNOWN";
341 /////////////////////////
346 BaseRemoteGDB::getbyte()
349 if (::read(fd
, &b
, 1) != 1)
350 warn("could not read byte from debugger");
355 BaseRemoteGDB::putbyte(uint8_t b
)
357 if (::write(fd
, &b
, 1) != 1)
358 warn("could not write byte to debugger");
361 // Send a packet to gdb
363 BaseRemoteGDB::send(const char *bp
)
368 DPRINTF(GDBSend
, "send: %s\n", bp
);
372 //Start sending a packet
374 //Send the contents, and also keep a check sum.
375 for (csum
= 0; (c
= *p
); p
++) {
379 //Send the ending character.
382 putbyte(i2digit(csum
>> 4));
383 putbyte(i2digit(csum
));
384 //Try transmitting over and over again until the other end doesn't send an
386 } while ((c
= getbyte() & 0x7f) == GDBBadP
);
389 // Receive a packet from gdb
391 BaseRemoteGDB::recv(char *bp
, int maxlen
)
400 //Find the beginning of a packet
401 while ((c
= getbyte()) != GDBStart
)
404 //Read until you find the end of the data in the packet, and keep
405 //track of the check sum.
406 while ((c
= getbyte()) != GDBEnd
&& len
< maxlen
) {
413 //Mask the check sum, and terminate the command string.
417 //If the command was too long, report an error.
423 //Bring in the checksum. If the check sum matches, csum will be 0.
424 csum
-= digit2i(getbyte()) * 16;
425 csum
-= digit2i(getbyte());
427 //If the check sum was correct
429 //Report that the packet was received correctly
436 memcpy(bp
, bp
+3, len
);
440 //Otherwise, report that there was a mistake.
444 DPRINTF(GDBRecv
, "recv: %s: %s\n", gdb_command(*bp
), bp
);
449 // Read bytes from kernel address space for debugger.
451 BaseRemoteGDB::read(Addr vaddr
, size_t size
, char *data
)
453 static Addr lastaddr
= 0;
454 static size_t lastsize
= 0;
457 DPRINTF(GDBRead
, "read: reading memory location zero!\n");
458 vaddr
= lastaddr
+ lastsize
;
461 DPRINTF(GDBRead
, "read: addr=%#x, size=%d", vaddr
, size
);
464 VirtualPort
*port
= context
->getVirtPort();
466 TranslatingPort
*port
= context
->getMemPort();
468 port
->readBlob(vaddr
, (uint8_t*)data
, size
);
471 if (DTRACE(GDBRead
)) {
472 if (DTRACE(GDBExtra
)) {
474 mem2hex(buf
, data
, size
);
475 DPRINTFNR(": %s\n", buf
);
484 // Write bytes to kernel address space for debugger.
486 BaseRemoteGDB::write(Addr vaddr
, size_t size
, const char *data
)
488 static Addr lastaddr
= 0;
489 static size_t lastsize
= 0;
492 DPRINTF(GDBWrite
, "write: writing memory location zero!\n");
493 vaddr
= lastaddr
+ lastsize
;
496 if (DTRACE(GDBWrite
)) {
497 DPRINTFN("write: addr=%#x, size=%d", vaddr
, size
);
498 if (DTRACE(GDBExtra
)) {
500 mem2hex(buf
, data
, size
);
501 DPRINTFNR(": %s\n", buf
);
506 VirtualPort
*port
= context
->getVirtPort();
508 TranslatingPort
*port
= context
->getMemPort();
510 port
->writeBlob(vaddr
, (uint8_t*)data
, size
);
518 PCEventQueue
*BaseRemoteGDB::getPcEventQueue()
520 return &system
->pcEventQueue
;
523 BaseRemoteGDB::HardBreakpoint::HardBreakpoint(BaseRemoteGDB
*_gdb
, Addr pc
)
524 : PCEvent(_gdb
->getPcEventQueue(), "HardBreakpoint Event", pc
),
525 gdb(_gdb
), refcount(0)
527 DPRINTF(GDBMisc
, "creating hardware breakpoint at %#x\n", evpc
);
531 BaseRemoteGDB::HardBreakpoint::process(ThreadContext
*tc
)
533 DPRINTF(GDBMisc
, "handling hardware breakpoint at %#x\n", pc());
535 if (tc
== gdb
->context
)
540 BaseRemoteGDB::insertSoftBreak(Addr addr
, size_t len
)
542 if (len
!= sizeof(TheISA::MachInst
))
543 panic("invalid length\n");
545 return insertHardBreak(addr
, len
);
549 BaseRemoteGDB::removeSoftBreak(Addr addr
, size_t len
)
551 if (len
!= sizeof(MachInst
))
552 panic("invalid length\n");
554 return removeHardBreak(addr
, len
);
558 BaseRemoteGDB::insertHardBreak(Addr addr
, size_t len
)
560 if (len
!= sizeof(MachInst
))
561 panic("invalid length\n");
563 DPRINTF(GDBMisc
, "inserting hardware breakpoint at %#x\n", addr
);
565 HardBreakpoint
*&bkpt
= hardBreakMap
[addr
];
567 bkpt
= new HardBreakpoint(this, addr
);
575 BaseRemoteGDB::removeHardBreak(Addr addr
, size_t len
)
577 if (len
!= sizeof(MachInst
))
578 panic("invalid length\n");
580 DPRINTF(GDBMisc
, "removing hardware breakpoint at %#x\n", addr
);
582 break_iter_t i
= hardBreakMap
.find(addr
);
583 if (i
== hardBreakMap
.end())
586 HardBreakpoint
*hbp
= (*i
).second
;
587 if (--hbp
->refcount
== 0) {
589 hardBreakMap
.erase(i
);
596 BaseRemoteGDB::setTempBreakpoint(Addr bkpt
)
598 DPRINTF(GDBMisc
, "setTempBreakpoint: addr=%#x\n", bkpt
);
599 insertHardBreak(bkpt
, sizeof(TheISA::MachInst
));
603 BaseRemoteGDB::clearTempBreakpoint(Addr
&bkpt
)
605 DPRINTF(GDBMisc
, "setTempBreakpoint: addr=%#x\n", bkpt
);
606 removeHardBreak(bkpt
, sizeof(TheISA::MachInst
));
611 BaseRemoteGDB::break_type(char c
)
614 case '0': return "software breakpoint";
615 case '1': return "hardware breakpoint";
616 case '2': return "write watchpoint";
617 case '3': return "read watchpoint";
618 case '4': return "access watchpoint";
619 default: return "unknown breakpoint/watchpoint";
623 // This function does all command processing for interfacing to a
624 // remote gdb. Note that the error codes are ignored by gdb at
625 // present, but might eventually become meaningful. (XXX) It might
626 // makes sense to use POSIX errno values, because that is what the
627 // gdb/remote.c functions want to return.
629 BaseRemoteGDB::trap(int type
)
633 char data
[GDBPacketBufLen
+ 1];
637 char command
, subcmd
;
644 bufferSize
= gdbregs
.bytes() * 2 + 256;
645 buffer
= (char*)malloc(bufferSize
);
647 DPRINTF(GDBMisc
, "trap: PC=%#x NPC=%#x\n",
648 context
->readPC(), context
->readNextPC());
653 * The first entry to this function is normally through
654 * a breakpoint trap in kgdb_connect(), in which case we
655 * must advance past the breakpoint because gdb will not.
657 * On the first entry here, we expect that gdb is not yet
658 * listening to us, so just enter the interaction loop.
659 * After the debugger is "active" (connected) it will be
660 * waiting for a "signaled" message from us.
665 // Tell remote host that an exception has occurred.
666 snprintf((char *)buffer
, bufferSize
, "S%02x", type
);
669 // Stick frame regs into our reg cache.
673 datalen
= recv(data
, sizeof(data
));
674 data
[sizeof(data
) - 1] = 0; // Sentinel
681 // if this command came from a running gdb, answer it --
682 // the other guy has no way of knowing if we're in or out
683 // of this loop when he issues a "remote-signal".
684 snprintf((char *)buffer
, bufferSize
,
690 if (2 * gdbregs
.bytes() > bufferSize
)
691 panic("buffer too small");
693 mem2hex(buffer
, gdbregs
.regs
, gdbregs
.bytes());
698 p
= hex2mem(gdbregs
.regs
, p
, gdbregs
.bytes());
699 if (p
== NULL
|| *p
!= '\0')
714 if (val
< 0 && val
>= KGDB_NUMREGS
) {
719 gdbregs
.regs
[val
] = hex2i(&p
);
737 if (len
> bufferSize
) {
741 if (!acc(val
, len
)) {
746 if (read(val
, (size_t)len
, (char *)buffer
)) {
747 // variable length array would be nice, but C++ doesn't
748 // officially support those...
749 char *temp
= new char[2*len
+1];
750 mem2hex(temp
, buffer
, len
);
769 if (len
> datalen
- (p
- data
)) {
773 p
= hex2mem(buffer
, p
, bufferSize
);
778 if (!acc(val
, len
)) {
782 if (write(val
, (size_t)len
, (char *)buffer
))
809 context
->setNextPC(val
+ sizeof(MachInst
));
815 if (p
- data
< (ptrdiff_t)datalen
) {
818 context
->setNextPC(val
+ sizeof(MachInst
));
828 context
->setNextPC(val
+ sizeof(MachInst
));
834 if (p
- data
< (ptrdiff_t)datalen
) {
837 context
->setNextPC(val
+ sizeof(MachInst
));
844 if (*p
++ != ',') send("E0D");
846 if (*p
++ != ',') send("E0D");
849 DPRINTF(GDBMisc
, "clear %s, addr=%#x, len=%d\n",
850 break_type(subcmd
), val
, len
);
855 case '0': // software breakpoint
856 ret
= removeSoftBreak(val
, len
);
859 case '1': // hardware breakpoint
860 ret
= removeHardBreak(val
, len
);
863 case '2': // write watchpoint
864 case '3': // read watchpoint
865 case '4': // access watchpoint
871 send(ret
? "OK" : "E0C");
876 if (*p
++ != ',') send("E0D");
878 if (*p
++ != ',') send("E0D");
881 DPRINTF(GDBMisc
, "set %s, addr=%#x, len=%d\n",
882 break_type(subcmd
), val
, len
);
887 case '0': // software breakpoint
888 ret
= insertSoftBreak(val
, len
);
891 case '1': // hardware breakpoint
892 ret
= insertHardBreak(val
, len
);
895 case '2': // write watchpoint
896 case '3': // read watchpoint
897 case '4': // access watchpoint
903 send(ret
? "OK" : "E0C");
907 var
= string(p
, datalen
- 1);
918 case GDBSigCycleStep
:
925 // Unsupported command
926 DPRINTF(GDBMisc
, "Unsupported command: %s\n",
927 gdb_command(command
));
928 DDUMP(GDBMisc
, (uint8_t *)data
, datalen
);
934 DPRINTF(GDBMisc
, "Unknown command: %c(%#x)\n",
948 // Convert a hex digit into an integer.
949 // This returns -1 if the argument passed is no valid hex digit.
951 BaseRemoteGDB::digit2i(char c
)
953 if (c
>= '0' && c
<= '9')
955 else if (c
>= 'a' && c
<= 'f')
956 return (c
- 'a' + 10);
957 else if (c
>= 'A' && c
<= 'F')
959 return (c
- 'A' + 10);
964 // Convert the low 4 bits of an integer into an hex digit.
966 BaseRemoteGDB::i2digit(int n
)
968 return ("0123456789abcdef"[n
& 0x0f]);
971 // Convert a byte array into an hex string.
973 BaseRemoteGDB::mem2hex(void *vdst
, const void *vsrc
, int len
)
975 char *dst
= (char *)vdst
;
976 const char *src
= (const char *)vsrc
;
979 *dst
++ = i2digit(*src
>> 4);
980 *dst
++ = i2digit(*src
++);
985 // Convert an hex string into a byte array.
986 // This returns a pointer to the character following the last valid
987 // hex digit. If the string ends in the middle of a byte, NULL is
990 BaseRemoteGDB::hex2mem(void *vdst
, const char *src
, int maxlen
)
992 char *dst
= (char *)vdst
;
995 while (*src
&& maxlen
--) {
996 msb
= digit2i(*src
++);
999 lsb
= digit2i(*src
++);
1002 *dst
++ = (msb
<< 4) | lsb
;
1007 // Convert an hex string into an integer.
1008 // This returns a pointer to the character following the last valid
1011 BaseRemoteGDB::hex2i(const char **srcp
)
1013 const char *src
= *srcp
;
1017 while ((nibble
= digit2i(*src
)) >= 0) {