From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19169 invoked by alias); 5 Mar 2011 11:18:00 -0000 Received: (qmail 19160 invoked by uid 22791); 5 Mar 2011 11:17:59 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,TW_BJ,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 05 Mar 2011 11:17:52 +0000 Received: (qmail 31980 invoked from network); 5 Mar 2011 11:17:50 -0000 Received: from unknown (HELO scottsdale.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 5 Mar 2011 11:17:50 -0000 From: Pedro Alves To: Jan Kratochvil Subject: Re: [patch] [gdbserver] Do not crash on file load without inferior Date: Sat, 05 Mar 2011 11:18:00 -0000 User-Agent: KMail/1.13.5 (Linux/2.6.35-27-generic; KDE/4.6.0; x86_64; ; ) Cc: Marc Khouzam , "'gdb-patches@sourceware.org'" References: <20110224114001.GA24673@host1.dyn.jankratochvil.net> <201103042205.51281.pedro@codesourcery.com> <20110305041102.GA16509@host1.jankratochvil.net> In-Reply-To: <20110305041102.GA16509@host1.jankratochvil.net> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201103051117.48593.pedro@codesourcery.com> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-03/txt/msg00364.txt.bz2 On Saturday 05 March 2011 04:11:03, Jan Kratochvil wrote: > Given how cheap is to run the testsuite I do not think it is worth spending > any human effort on coding without having the testsuite results available. This passes the testsuite without regressions for me, and I confirmed the new test fails with the gdb hunk omitted. Comments? -- Pedro Alves gdb/ 2011-03-05 Pedro Alves * remote.c (remote_check_symbols): Skip if the target has no execution. gdb/testsuite/ 2011-03-05 Jan Kratochvil * gdb.server/ext-run.exp (load new file without any gdbserver inferior): New test. --- gdb/remote.c | 11 ++++++++++- gdb/testsuite/gdb.server/ext-run.exp | 5 +++++ 2 files changed, 15 insertions(+), 1 deletion(-) Index: src/gdb/remote.c =================================================================== --- src.orig/gdb/remote.c 2011-03-05 10:19:07.000000000 +0000 +++ src/gdb/remote.c 2011-03-05 10:54:28.582530001 +0000 @@ -3435,10 +3435,19 @@ remote_check_symbols (struct objfile *ob struct minimal_symbol *sym; int end; + /* The remote side has no concept of inferiors that aren't running + yet, it only knows about running processes. If we're connected + but our current inferior is not running, we should not invite the + remote target to request symbol lookups related to its + (unrelated) current process. */ + if (!target_has_execution) + return; + if (remote_protocol_packets[PACKET_qSymbol].support == PACKET_DISABLE) return; - /* Make sure the remote is pointing at the right process. */ + /* Make sure the remote is pointing at the right process. Note + there's no way to select "no process". */ set_general_process (); /* Allocate a message buffer. We can't reuse the input buffer in RS, Index: src/gdb/testsuite/gdb.server/ext-run.exp =================================================================== --- src.orig/gdb/testsuite/gdb.server/ext-run.exp 2011-03-05 10:18:39.000000000 +0000 +++ src/gdb/testsuite/gdb.server/ext-run.exp 2011-03-05 10:49:00.772529995 +0000 @@ -60,4 +60,9 @@ if { [istarget *-*-linux*] } { } gdb_test "kill" "" "kill" "Kill the program being debugged.*" "y" + +gdb_load $binfile +gdb_test "monitor help" "The following monitor commands.*" \ + "load new file without any gdbserver inferior" + gdb_test_no_output "monitor exit"