From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 2FC923857029 for ; Mon, 21 Aug 2023 09:31:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2FC923857029 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1692610295; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Nbvu49IdC2Jn8zQ+UMOY97lxWWgfN5mToi8idaX5dr8=; b=aLCP0laRNTCO86PbL79QgL49HIzz/+t81bZ/deFVMNvQ4hItzFroX32DhULKGL+reYLOML Kf0SSj61Utt8DGZvwIUjnk2KcvzGKr4bEA9MU105L42rh9JkOJH6Z9KiEcPZHsZWV6RY+K DnhXfFaMFSQRNOnpd/AdQdstKc6m8IA= Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-594-fv144ZvjMsm1X8Vx_N2KKA-1; Mon, 21 Aug 2023 05:31:34 -0400 X-MC-Unique: fv144ZvjMsm1X8Vx_N2KKA-1 Received: by mail-ej1-f71.google.com with SMTP id a640c23a62f3a-99cb1b83eacso405487466b.1 for ; Mon, 21 Aug 2023 02:31:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692610293; x=1693215093; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Nbvu49IdC2Jn8zQ+UMOY97lxWWgfN5mToi8idaX5dr8=; b=W6Jcn+e67Yil8kQkC9+JJkiKQiizr85nfhxZnJ7ZVAK0BFktdX+yV7ysvYauCspC8W 9MbchqnC+H3TozppnqM8QV+2MC4NzzGtv7osrlS7FIydDMNyIYStROVuyAbcEZ2zCx1c BPyk08+fjJm0WDIFPF7y0hnEneOBockeqy6LI0l2KZKOk3p48BsVelCHkRqnycB0b0DA CC745cS5WkZwPhxJ/siwN8YP5H68Ujq2Uon9afpECCS21t4vYHJ4kvfVlZVSfCWqMz3X E6nJLSp6wV8QdGrTuf4llpdFHM/0+tLA+RLfnqHCUuQKBNy/C7OC6ErSINqGDoHE2FNW rN+g== X-Gm-Message-State: AOJu0Yz7xuV05REqlDeUcjzsO3RS9oCiPvvymsCvdwDMY83iWhjd5A4p 3yFIeYDQy7ZXWSNaY6/P+BdRfPr5ElPFlDkhO8Cu2Wqg3NU1LrQuTHQ+EpD4eoJbjpFDSzp5dpW 0gVCoA/KSqsHfV4T5618LNZKskvCUBWQcBXxnDasEUW79OmOdsDDislxnY6SkCGLssVv15pr6W8 Zzhcu9tQ== X-Received: by 2002:a17:907:2bca:b0:99c:55c5:1c6e with SMTP id gv10-20020a1709072bca00b0099c55c51c6emr6903438ejc.8.1692610293305; Mon, 21 Aug 2023 02:31:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IErI5ZW4jkyM1Cj91Y4OuoOILj5ndWVxlqJ9szWDcjOTRxrFUvX/0AFF9l3O+fCPzFc9mKNaQ== X-Received: by 2002:a17:907:2bca:b0:99c:55c5:1c6e with SMTP id gv10-20020a1709072bca00b0099c55c51c6emr6903417ejc.8.1692610292938; Mon, 21 Aug 2023 02:31:32 -0700 (PDT) Received: from localhost ([31.111.84.232]) by smtp.gmail.com with ESMTPSA id h6-20020a1709063c0600b0099b921de301sm6226449ejg.159.2023.08.21.02.31.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Aug 2023 02:31:32 -0700 (PDT) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: Pedro Alves , Andrew Burgess Subject: [PATCH 2/3] gdb: remove the silent parameter from exit_inferior_1 and cleanup Date: Mon, 21 Aug 2023 10:31:26 +0100 Message-Id: <7f17b35579a7b5130db2ab44f2077a41de95d6e3.1692609662.git.aburgess@redhat.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: After the previous commit, exit_inferior_1 no longer makes use of the silent parameter. This commit removes this parameter and cleans up the callers. After doing this exit_inferior_1, exit_inferior, and exit_inferior_silent are all equivalent, so rename exit_inferior_1 to exit_inferior and delete exit_inferior_silent, update all the callers. Also I spotted the declaration exit_inferior_num_silent in inferior.h, but this function is not defined anywhere, so I deleted the declaration. There should be no user visible changes after this commit. --- gdb/bsd-kvm.c | 2 +- gdb/corelow.c | 2 +- gdb/inferior.c | 23 +++++------------------ gdb/inferior.h | 7 +++---- gdb/infrun.c | 2 +- gdb/tracectf.c | 2 +- gdb/tracefile-tfile.c | 2 +- 7 files changed, 13 insertions(+), 27 deletions(-) diff --git a/gdb/bsd-kvm.c b/gdb/bsd-kvm.c index 49041ef99bf..7fb51dcc7f2 100644 --- a/gdb/bsd-kvm.c +++ b/gdb/bsd-kvm.c @@ -154,7 +154,7 @@ bsd_kvm_target::close () bsd_kvm_corefile.clear (); switch_to_no_thread (); - exit_inferior_silent (current_inferior ()); + exit_inferior (current_inferior ()); } static LONGEST diff --git a/gdb/corelow.c b/gdb/corelow.c index 46bb1077b6d..4d692dc53e6 100644 --- a/gdb/corelow.c +++ b/gdb/corelow.c @@ -328,7 +328,7 @@ core_target::clear_core () { switch_to_no_thread (); /* Avoid confusion from thread stuff. */ - exit_inferior_silent (current_inferior ()); + exit_inferior (current_inferior ()); /* Clear out solib state while the bfd is still open. See comments in clear_solib in solib.c. */ diff --git a/gdb/inferior.c b/gdb/inferior.c index 7220b704f20..cf4caa923cf 100644 --- a/gdb/inferior.c +++ b/gdb/inferior.c @@ -301,11 +301,10 @@ notify_inferior_disappeared (inferior *inf) gdb::observers::inferior_exit.notify (inf); } -/* If SILENT then be quiet -- don't announce a inferior exit, or the - exit of its threads. */ +/* See inferior.h. */ -static void -exit_inferior_1 (struct inferior *inf, int silent) +void +exit_inferior (struct inferior *inf) { inf->clear_thread_list (); @@ -335,27 +334,15 @@ exit_inferior_1 (struct inferior *inf, int silent) reinit_frame_cache (); } -void -exit_inferior (inferior *inf) -{ - exit_inferior_1 (inf, 0); -} - -void -exit_inferior_silent (inferior *inf) -{ - exit_inferior_1 (inf, 1); -} - /* See inferior.h. */ void detach_inferior (inferior *inf) { - /* Save the pid, since exit_inferior_1 will reset it. */ + /* Save the pid, since exit_inferior will reset it. */ int pid = inf->pid; - exit_inferior_1 (inf, 0); + exit_inferior (inf); if (print_inferior_events) gdb_printf (_("[Inferior %d (%s) detached]\n"), diff --git a/gdb/inferior.h b/gdb/inferior.h index c8429b86268..04672582984 100644 --- a/gdb/inferior.h +++ b/gdb/inferior.h @@ -704,12 +704,11 @@ extern void delete_inferior (struct inferior *todel); /* Delete an existing inferior list entry, due to inferior detaching. */ extern void detach_inferior (inferior *inf); +/* Notify observers and interpreters that INF has gone away. Reset the INF + object back to an default, empty, state. Clear register and frame + caches. */ extern void exit_inferior (inferior *inf); -extern void exit_inferior_silent (inferior *inf); - -extern void exit_inferior_num_silent (int num); - extern void inferior_appeared (struct inferior *inf, int pid); /* Search function to lookup an inferior of TARG by target 'pid'. */ diff --git a/gdb/infrun.c b/gdb/infrun.c index 72852e63906..4730d290442 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -1328,7 +1328,7 @@ follow_exec (ptid_t ptid, const char *exec_file_target) following_inferior = add_inferior_with_spaces (); swap_terminal_info (following_inferior, execing_inferior); - exit_inferior_silent (execing_inferior); + exit_inferior (execing_inferior); following_inferior->pid = pid; } diff --git a/gdb/tracectf.c b/gdb/tracectf.c index 0ed2092c32b..1f3ec58227f 100644 --- a/gdb/tracectf.c +++ b/gdb/tracectf.c @@ -1187,7 +1187,7 @@ ctf_target::close () trace_dirname.reset (); switch_to_no_thread (); /* Avoid confusion from thread stuff. */ - exit_inferior_silent (current_inferior ()); + exit_inferior (current_inferior ()); trace_reset_local_state (); } diff --git a/gdb/tracefile-tfile.c b/gdb/tracefile-tfile.c index 59055e7ea1a..3440f375021 100644 --- a/gdb/tracefile-tfile.c +++ b/gdb/tracefile-tfile.c @@ -616,7 +616,7 @@ tfile_target::close () gdb_assert (trace_fd != -1); switch_to_no_thread (); /* Avoid confusion from thread stuff. */ - exit_inferior_silent (current_inferior ()); + exit_inferior (current_inferior ()); ::close (trace_fd); trace_fd = -1; -- 2.25.4