Skip to content

Commit b9b0a27

Browse files
committed
Make many instances of "gdb" refer to "debugger" instead
1 parent 96f0656 commit b9b0a27

File tree

1 file changed

+41
-41
lines changed

1 file changed

+41
-41
lines changed

src/GdbServerConnection.cc

+41-41
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ static bool poll_socket(const ScopedFd& sock_fd, short events, int timeoutMs) {
147147

148148
int ret = poll(&pfd, 1, timeoutMs);
149149
if (ret < 0 && errno != EINTR) {
150-
LOG(info) << "gdb socket has been closed";
150+
LOG(info) << "debugger socket has been closed";
151151
}
152152
return ret > 0;
153153
}
@@ -171,7 +171,7 @@ void GdbServerConnection::read_data_once() {
171171
uint8_t buf[4096];
172172
nread = read(sock_fd, buf, sizeof(buf));
173173
if (nread <= 0) {
174-
LOG(info) << "Could not read data from gdb socket, "
174+
LOG(info) << "Could not read data from debugger socket, "
175175
"marking connection as closed";
176176
connection_alive_ = false;
177177
} else {
@@ -193,7 +193,7 @@ void GdbServerConnection::write_flush() {
193193
nwritten = write(sock_fd, outbuf.data() + write_index,
194194
outbuf.size() - write_index);
195195
if (nwritten < 0) {
196-
LOG(info) << "Could not write data to gdb socket, "
196+
LOG(info) << "Could not write data to debugger socket, "
197197
"marking connection as closed";
198198
connection_alive_ = false;
199199
outbuf.clear();
@@ -294,7 +294,7 @@ void GdbServerConnection::write_hex_bytes_packet(const uint8_t* bytes, size_t le
294294

295295
static void parser_assert(bool cond) {
296296
if (!cond) {
297-
fputs("Failed to parse gdb request\n", stderr);
297+
fputs("Failed to parse debugger request\n", stderr);
298298
DEBUG_ASSERT(false);
299299
exit(2);
300300
}
@@ -543,7 +543,7 @@ bool GdbServerConnection::xfer(const char* name, char* args) {
543543
++args;
544544
}
545545

546-
LOG(debug) << "gdb asks us to transfer " << name << " mode=" << mode
546+
LOG(debug) << "debugger asks us to transfer " << name << " mode=" << mode
547547
<< ", annex=" << annex << ", offset=" << offset << " len=" << len;
548548

549549
if (!strcmp(name, "auxv")) {
@@ -672,7 +672,7 @@ bool GdbServerConnection::query(char* payload) {
672672
name = payload;
673673

674674
if (strstr(name, "RRCmd") == name) {
675-
LOG(debug) << "gdb requests rr cmd: " << name;
675+
LOG(debug) << "debugger requests rr cmd: " << name;
676676
req = GdbRequest(DREQ_RR_CMD);
677677
parser_assert(args && *args);
678678
char* endp = strchr(args, ':');
@@ -696,19 +696,19 @@ bool GdbServerConnection::query(char* payload) {
696696
return true;
697697
}
698698
if (!strcmp(name, "C")) {
699-
LOG(debug) << "gdb requests current thread ID";
699+
LOG(debug) << "debugger requests current thread ID";
700700
req = GdbRequest(DREQ_GET_CURRENT_THREAD);
701701
return true;
702702
}
703703
if (!strcmp(name, "Attached")) {
704-
LOG(debug) << "gdb asks if this is a new or existing process";
704+
LOG(debug) << "debugger asks if this is a new or existing process";
705705
/* Tell gdb this is an existing process; it might be
706706
* (see emergency_debug()). */
707707
write_packet("1");
708708
return false;
709709
}
710710
if (!strcmp(name, "fThreadInfo")) {
711-
LOG(debug) << "gdb asks for thread list";
711+
LOG(debug) << "debugger asks for thread list";
712712
req = GdbRequest(DREQ_GET_THREAD_LIST);
713713
return true;
714714
}
@@ -717,7 +717,7 @@ bool GdbServerConnection::query(char* payload) {
717717
return false;
718718
}
719719
if (!strcmp(name, "GetTLSAddr")) {
720-
LOG(debug) << "gdb asks for TLS addr";
720+
LOG(debug) << "debugger asks for TLS addr";
721721
req = GdbRequest(DREQ_TLS);
722722
req.target = parse_threadid(args, &args);
723723
parser_assert(*args == ',');
@@ -732,7 +732,7 @@ bool GdbServerConnection::query(char* payload) {
732732
return true;
733733
}
734734
if (!strcmp(name, "Offsets")) {
735-
LOG(debug) << "gdb asks for section offsets";
735+
LOG(debug) << "debugger asks for section offsets";
736736
req = GdbRequest(DREQ_GET_OFFSETS);
737737
req.target = query_thread;
738738
return true;
@@ -744,7 +744,7 @@ bool GdbServerConnection::query(char* payload) {
744744
}
745745
if (!strcmp(name, "Supported")) {
746746
/* TODO process these */
747-
LOG(debug) << "gdb supports " << args;
747+
LOG(debug) << "debugger supports " << args;
748748

749749
multiprocess_supported_ = strstr(args, "multiprocess+") != nullptr;
750750
hwbreak_supported_ = strstr(args, "hwbreak+") != nullptr;
@@ -774,7 +774,7 @@ bool GdbServerConnection::query(char* payload) {
774774
}
775775
if (!strcmp(name, "Symbol")) {
776776
#ifdef PROC_SERVICE_H
777-
LOG(debug) << "gdb is ready for symbol lookups";
777+
LOG(debug) << "debugger is ready for symbol lookups";
778778
const char* colon = strchr(args, ':');
779779
parser_assert(colon != nullptr);
780780
req = GdbRequest(DREQ_QSYMBOL);
@@ -789,7 +789,7 @@ bool GdbServerConnection::query(char* payload) {
789789
req.sym().name = decode_ascii_encoded_hex_str(args);
790790
return true;
791791
#else
792-
LOG(debug) << "gdb is ready for symbol lookups, but we don't support them";
792+
LOG(debug) << "debugger is ready for symbol lookups, but we don't support them";
793793
write_packet("");
794794
return false;
795795
#endif
@@ -807,7 +807,7 @@ bool GdbServerConnection::query(char* payload) {
807807
return true;
808808
}
809809
if (!strcmp(name, "TStatus")) {
810-
LOG(debug) << "gdb asks for trace status";
810+
LOG(debug) << "debugger asks for trace status";
811811
/* XXX from the docs, it appears that we should reply
812812
* with "T0" here. But if we do, gdb keeps bothering
813813
* us with trace queries. So pretend we don't know
@@ -839,15 +839,15 @@ bool GdbServerConnection::query(char* payload) {
839839
read_binary_data((const uint8_t*)args, inbuf.data() + packetend,
840840
req.mem().data);
841841

842-
LOG(debug) << "gdb searching memory (addr=" << HEX(req.mem().addr)
842+
LOG(debug) << "debugger searching memory (addr=" << HEX(req.mem().addr)
843843
<< ", len=" << req.mem().len << ")";
844844
return true;
845845
}
846846
write_packet("");
847847
return false;
848848
}
849849

850-
UNHANDLED_REQ() << "Unhandled gdb query: q" << name;
850+
UNHANDLED_REQ() << "Unhandled debugger query: q" << name;
851851
return false;
852852
}
853853

@@ -890,7 +890,7 @@ bool GdbServerConnection::set_var(char* payload) {
890890
return false;
891891
}
892892

893-
UNHANDLED_REQ() << "Unhandled gdb set: Q" << name;
893+
UNHANDLED_REQ() << "Unhandled debugger set: Q" << name;
894894
return false;
895895
}
896896

@@ -911,7 +911,7 @@ bool GdbServerConnection::process_bpacket(char* payload) {
911911
req.cont().actions.push_back(GdbContAction(ACTION_STEP, resume_thread));
912912
return true;
913913
} else {
914-
UNHANDLED_REQ() << "Unhandled gdb bpacket: b" << payload;
914+
UNHANDLED_REQ() << "Unhandled debugger bpacket: b" << payload;
915915
return false;
916916
}
917917
}
@@ -1038,7 +1038,7 @@ bool GdbServerConnection::process_vpacket(char* payload) {
10381038
}
10391039

10401040
if (!strcmp("Cont?", name)) {
1041-
LOG(debug) << "gdb queries which continue commands we support";
1041+
LOG(debug) << "debugger queries which continue commands we support";
10421042
write_packet("vCont;c;C;s;S;");
10431043
return false;
10441044
}
@@ -1048,7 +1048,7 @@ bool GdbServerConnection::process_vpacket(char* payload) {
10481048
// assume that this kill request is being made because
10491049
// a "vRun" restart is coming right up. We know how
10501050
// to implement vRun, so we'll ignore this one.
1051-
LOG(debug) << "gdb asks us to kill tracee(s); ignoring";
1051+
LOG(debug) << "debugger asks us to kill tracee(s); ignoring";
10521052
write_packet("OK");
10531053
return false;
10541054
}
@@ -1062,7 +1062,7 @@ bool GdbServerConnection::process_vpacket(char* payload) {
10621062
*args++ = '\0';
10631063
}
10641064
if (strlen(filename)) {
1065-
FATAL() << "gdb wants us to run the exe image `" << filename
1065+
FATAL() << "debugger wants us to run the exe image `" << filename
10661066
<< "', but we don't support that.";
10671067
}
10681068
if (!args) {
@@ -1163,7 +1163,7 @@ bool GdbServerConnection::process_vpacket(char* payload) {
11631163
}
11641164
}
11651165

1166-
UNHANDLED_REQ() << "Unhandled gdb vpacket: v" << name;
1166+
UNHANDLED_REQ() << "Unhandled debugger vpacket: v" << name;
11671167
return false;
11681168
}
11691169

@@ -1188,7 +1188,7 @@ bool GdbServerConnection::process_packet() {
11881188
inbuf.data() + packetend));
11891189

11901190
if (INTERRUPT_CHAR == inbuf[0]) {
1191-
LOG(debug) << "gdb requests interrupt";
1191+
LOG(debug) << "debugger requests interrupt";
11921192
req = GdbRequest(DREQ_INTERRUPT);
11931193
inbuf.erase(inbuf.begin());
11941194
return true;
@@ -1205,21 +1205,21 @@ bool GdbServerConnection::process_packet() {
12051205
ret = process_bpacket(payload);
12061206
break;
12071207
case 'c':
1208-
LOG(debug) << "gdb is asking to continue";
1208+
LOG(debug) << "debugger is asking to continue";
12091209
req = GdbRequest(DREQ_CONT);
12101210
req.cont().run_direction = RUN_FORWARD;
12111211
req.cont().actions.push_back(GdbContAction(ACTION_CONTINUE));
12121212
ret = true;
12131213
break;
12141214
case 'D':
1215-
LOG(debug) << "gdb is detaching from us";
1215+
LOG(debug) << "debugger is detaching from us";
12161216
req = GdbRequest(DREQ_DETACH);
12171217
ret = true;
12181218
break;
12191219
case 'g':
12201220
req = GdbRequest(DREQ_GET_REGS);
12211221
req.target = query_thread;
1222-
LOG(debug) << "gdb requests registers";
1222+
LOG(debug) << "debugger requests registers";
12231223
ret = true;
12241224
break;
12251225
case 'G':
@@ -1239,12 +1239,12 @@ bool GdbServerConnection::process_packet() {
12391239
req.target = parse_threadid(payload, &payload);
12401240
parser_assert('\0' == *payload);
12411241

1242-
LOG(debug) << "gdb selecting " << req.target;
1242+
LOG(debug) << "debugger selecting " << req.target;
12431243

12441244
ret = true;
12451245
break;
12461246
case 'k':
1247-
LOG(info) << "gdb requests kill, exiting";
1247+
LOG(info) << "debugger requests kill, exiting";
12481248
write_packet("OK");
12491249
exit(0);
12501250
case 'm':
@@ -1255,7 +1255,7 @@ bool GdbServerConnection::process_packet() {
12551255
req.mem().len = strtoul(payload, &payload, 16);
12561256
parser_assert('\0' == *payload);
12571257

1258-
LOG(debug) << "gdb requests memory (addr=" << HEX(req.mem().addr)
1258+
LOG(debug) << "debugger requests memory (addr=" << HEX(req.mem().addr)
12591259
<< ", len=" << req.mem().len << ")";
12601260

12611261
ret = true;
@@ -1273,7 +1273,7 @@ bool GdbServerConnection::process_packet() {
12731273
req.target = query_thread;
12741274
req.reg().name = GdbRegister(strtoul(payload, &payload, 16));
12751275
parser_assert('\0' == *payload);
1276-
LOG(debug) << "gdb requests register value (" << req.reg().name << ")";
1276+
LOG(debug) << "debugger requests register value (" << req.reg().name << ")";
12771277
ret = true;
12781278
break;
12791279
case 'P':
@@ -1298,7 +1298,7 @@ bool GdbServerConnection::process_packet() {
12981298
req = GdbRequest(DREQ_GET_IS_THREAD_ALIVE);
12991299
req.target = parse_threadid(payload, &payload);
13001300
parser_assert('\0' == *payload);
1301-
LOG(debug) << "gdb wants to know if " << req.target << " is alive";
1301+
LOG(debug) << "debugger wants to know if " << req.target << " is alive";
13021302
ret = true;
13031303
break;
13041304
case 'v':
@@ -1315,7 +1315,7 @@ bool GdbServerConnection::process_packet() {
13151315
req.mem().data);
13161316
parser_assert(req.mem().len == req.mem().data.size());
13171317

1318-
LOG(debug) << "gdb setting memory (addr=" << HEX(req.mem().addr)
1318+
LOG(debug) << "debugger setting memory (addr=" << HEX(req.mem().addr)
13191319
<< ", len=" << req.mem().len
13201320
<< ", data=" << to_string(req.mem().data, 32) << ")";
13211321

@@ -1359,26 +1359,26 @@ bool GdbServerConnection::process_packet() {
13591359
}
13601360
parser_assert('\0' == *payload);
13611361

1362-
LOG(debug) << "gdb requests " << ('Z' == request ? "set" : "remove")
1362+
LOG(debug) << "debugger requests " << ('Z' == request ? "set" : "remove")
13631363
<< "breakpoint (addr=" << HEX(req.watch().addr)
13641364
<< ", len=" << req.watch().kind << ")";
13651365

13661366
ret = true;
13671367
break;
13681368
}
13691369
case '!':
1370-
LOG(debug) << "gdb requests extended mode";
1370+
LOG(debug) << "debugger requests extended mode";
13711371
write_packet("OK");
13721372
ret = false;
13731373
break;
13741374
case '?':
1375-
LOG(debug) << "gdb requests stop reason";
1375+
LOG(debug) << "debugger requests stop reason";
13761376
req = GdbRequest(DREQ_GET_STOP_REASON);
13771377
req.target = query_thread;
13781378
ret = true;
13791379
break;
13801380
default:
1381-
UNHANDLED_REQ() << "Unhandled gdb request '" << inbuf[1] << "'";
1381+
UNHANDLED_REQ() << "Unhandled debugger request '" << inbuf[1] << "'";
13821382
ret = false;
13831383
}
13841384
/* Erase the newly processed packet from the input buffer. The checksum
@@ -1402,7 +1402,7 @@ void GdbServerConnection::notify_no_such_thread(const GdbRequest& req) {
14021402
* didn't notify gdb. Either way, the user should restart
14031403
* their debugging session. */
14041404
LOG(error) << "Targeted thread no longer exists; this is the result of "
1405-
"either a gdb or\n"
1405+
"either a debugger or\n"
14061406
"rr bug. Please restart your debugging session and avoid "
14071407
"doing whatever\n"
14081408
"triggered this bug.";
@@ -1443,7 +1443,7 @@ GdbRequest GdbServerConnection::get_request() {
14431443
#endif
14441444

14451445
if (!sniff_packet() && req.is_resume_request()) {
1446-
/* There's no new request data available and gdb has
1446+
/* There's no new request data available and the debugger has
14471447
* already asked us to resume. OK, do that (or keep
14481448
* doing that) now. */
14491449
return req;
@@ -1452,7 +1452,7 @@ GdbRequest GdbServerConnection::get_request() {
14521452
while (true) {
14531453
/* There's either new request data, or we have nothing
14541454
* to do. Either way, block until we read a complete
1455-
* packet from gdb. */
1455+
* packet from the debugger. */
14561456
read_packet();
14571457

14581458
if (!connection_alive_) {
@@ -1464,7 +1464,7 @@ GdbRequest GdbServerConnection::get_request() {
14641464
* so the target has to do something. */
14651465
return req;
14661466
}
1467-
/* The packet we got was "internal", gdb details.
1467+
/* The packet we got was "internal", debugger details.
14681468
* Nothing for the target to do yet. Keep waiting. */
14691469
}
14701470
}

0 commit comments

Comments
 (0)