From patchwork Fri Apr 12 17:51:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 88442 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3DFD1385841F for ; Fri, 12 Apr 2024 17:51:33 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by sourceware.org (Postfix) with ESMTPS id 354493861021 for ; Fri, 12 Apr 2024 17:50:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 354493861021 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 354493861021 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712944261; cv=none; b=WXSfr0OcDsBPnpvxiia6bIgE75xgbJg9B2fNXofhlCWEpQxqcHJFLandJ5b8JmPBiGLYCTdvRxPocJZyQsypDS7ssnnCBYXczVFwI9S8GfJ9SVVLujo7bBddOjkxLNy2Z2la4mFao2cAdE0ZHuJWVpHXcQ9kCiz3CE2HuiGL0YE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712944261; c=relaxed/simple; bh=IWDaysP/QuVdLv1HglKAO0soudKs0mJy51Zi6E9ftP0=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:From: To:Subject:Date:Message-Id:MIME-Version; b=MOsAJJQuJEUKBhXALW59Kr5jc+8A4oY826QitovbR1m1bfqg2X9s/GU2NWe/aTnRXBADeoiYNyT034HNSXHSiIbKAC+shZ5GRgcWIqHYkE4V7LThAyZ81kQ69ZNlxiQCitKfo6PaJQx2r2wp/vQf3bs1ca6hNtB3IoCKhuWQDeQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id EE3471F7F5 for ; Fri, 12 Apr 2024 17:50:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1712944258; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=h9JVZg2JPGhxPe1fgNDj5WvHVxq/UXrKApM5nmAbMV8=; b=wr6BYyLmzJT37aIG/JqBAEAtQJgyP3PcQOWhPp2no29M6+Tn0mT6W/rF6kbwwyYY5atdS2 QmRkoQ3ONIKvNRcq4XmtK2+JZBprmnyWI4jtzWAqRnCfjlWyAWfsjSaTbWZ7/oFdGFj1ZP IQ7C2Dj5LOoKzTOxSqjss1FT49YjRvw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1712944258; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=h9JVZg2JPGhxPe1fgNDj5WvHVxq/UXrKApM5nmAbMV8=; b=ek6r9Wuhf8NW6ffjBSMo7QLyvqGitK2q7qrfJitO71Z3yh0BaF1Qvhw2kY+kE3BCfajwJy M4A1WvV7BmoPnNCw== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1712944256; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=h9JVZg2JPGhxPe1fgNDj5WvHVxq/UXrKApM5nmAbMV8=; b=pPsogWQE+hIcB6CJa4U/I62zxlZfvF/7U8OF/U0YexhTJ4XEZP7oy97Ny3WUz3pOWheMum 8JEn5ftfYGI3CdlukrnShJfiie+Jq3H651XpIBfAZgATbfZRHFxYBIdNjykwnzESlOZnew KOZ5aZwP9SsTcn4vPRPvH8dHzQpnfYE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1712944256; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=h9JVZg2JPGhxPe1fgNDj5WvHVxq/UXrKApM5nmAbMV8=; b=zh1w2JST2pX6drYDaETNm9xNGzMfSl97cAPQWkZnCEWE34wH1RMxVO9/EpW91EI53e7C6j idzcQO9mHOuwwsBw== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id D28D61377F for ; Fri, 12 Apr 2024 17:50:56 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id iOupMYB0GWYtMQAAD6G6ig (envelope-from ) for ; Fri, 12 Apr 2024 17:50:56 +0000 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [PATCH 1/2] [gdb/testsuite] Simplify gdb.server/server-kill-python.exp Date: Fri, 12 Apr 2024 19:51:00 +0200 Message-Id: <20240412175101.9154-1-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 X-Spam-Level: X-Spamd-Result: default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; FUZZY_BLOCKED(0.00)[rspamd.com]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; ARC_NA(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_NONE(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[gdb-patches@sourceware.org]; RCVD_TLS_ALL(0.00)[] X-Spam-Score: -2.80 X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, 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 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org In test-case gdb.server/server-kill-python.exp we have: ... if {[gdb_spawn_with_cmdline_opts \ "-quiet -iex \"set height 0\" -iex \"set width 0\" -ex \"source $host_file1\""] != 0} { fail "spawn" return } ... I reproduced the problem by reverting the fix at the commit adding both the fix and the test-case, and the reproduced the same problem using: ... (gdb) source $host_file1 ... so there doesn't seem to be a specific need to source the python file using "-ex". Simplify the test-case by sourcing the python file using send_gdb. This also allow us to simplify the python script. Tested on x86_64-linux. --- gdb/testsuite/gdb.server/server-kill-python.exp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) base-commit: 3d67591c6ff0443e36cbc38ece082cc240e87bf6 diff --git a/gdb/testsuite/gdb.server/server-kill-python.exp b/gdb/testsuite/gdb.server/server-kill-python.exp index ebf6176ebba..87f9b56bd39 100644 --- a/gdb/testsuite/gdb.server/server-kill-python.exp +++ b/gdb/testsuite/gdb.server/server-kill-python.exp @@ -48,8 +48,6 @@ puts $fd \ "import gdb def do_gdb_stuff (): - gdb.execute ('file $host_binfile') - gdb.execute ('target $gdbserver_protocol $gdbserver_gdbport') gdb.execute ('break $srcfile:$break_linenr') gdb.execute ('continue') gdb.execute ('p server_pid') @@ -63,11 +61,15 @@ set host_file1 [gdb_remote_download host $file1] # Now start GDB, sourcing the python command file we generated above. # Set the height and width so we don't end up at a paging prompt. if {[gdb_spawn_with_cmdline_opts \ - "-quiet -iex \"set height 0\" -iex \"set width 0\" -ex \"source $host_file1\""] != 0} { + "-quiet -iex \"set height 0\" -iex \"set width 0\""] != 0} { fail "spawn" return } +gdb_load $binfile +gdb_target_cmd $gdbserver_protocol $gdbserver_gdbport +send_gdb "source $host_file1\n" + # Get the gdbserver PID. set gdbserver_pid 0