From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt1-x842.google.com (mail-qt1-x842.google.com [IPv6:2607:f8b0:4864:20::842]) by sourceware.org (Postfix) with ESMTPS id 5FB563857C45 for ; Mon, 28 Sep 2020 20:12:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 5FB563857C45 Received: by mail-qt1-x842.google.com with SMTP id 19so1827226qtp.1 for ; Mon, 28 Sep 2020 13:12:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=P3tdTJZwEy3QGXZhrapjzn0a9MTjo57opdMvt8rmXx0=; b=Kr9xdvvSGHnNGkCHA1UTFSYz505unghKpAsymAAI65K6BSJzTJPgcKtAybTbBOPLyP Yc2eS5uXeN47/zJOkhk30dxJJlSQ4O1mBCjHoiHMlhJlBM8KvBySmPrVmS8R1S55JICs uTyDoHMhlCc/J6MpGATWFtUiZwqNSLnBEnODr1FskjpOamc1qk4dUE+dg6oVCYUr6Rkr yPTLvlJTaW7r+cFMf1nqPtz+CI7A1WOmV5li7j4nGrdplwFl2zW4ZgSGlz72gkqn/ndi 7D40Zdt78F//dzLlkmuhHzl1Q6fBumPzvMOsc+EX/4MJ0oyDU5S460O138jTG7Xr1q8B SpMg== X-Gm-Message-State: AOAM533WjsewwLGFign7B6tK5uz8BLwecBEu8c6lwemrc8scRfOGIdV/ EVl5MJvnnzEGvRT84ARgqKKTY/9Q3m92zQvoa5ZPMNm+bAyiIQ== X-Google-Smtp-Source: ABdhPJzlKzT/+cveEYsmgVVjCaHPG9ZyX9eVZDzeg5dIlTH0/ypzgJxNeLPxOFJd9ouokflkePtblWw5ksTMuGkQpeY= X-Received: by 2002:ac8:1787:: with SMTP id o7mr3304353qtj.322.1601323948615; Mon, 28 Sep 2020 13:12:28 -0700 (PDT) MIME-Version: 1.0 References: <20200925194913.1744541-1-tromey@adacore.com> <20200925194913.1744541-5-tromey@adacore.com> <87imbxhegh.fsf@tromey.com> In-Reply-To: <87imbxhegh.fsf@tromey.com> From: Christian Biesinger Date: Mon, 28 Sep 2020 22:11:50 +0200 Message-ID: Subject: Re: [PATCH v2 4/6] Remove some dead code from handle_search_memory To: Tom Tromey Cc: gdb-patches Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.4 required=5.0 tests=BAYES_00, DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Sep 2020 20:12:30 -0000 On Mon, Sep 28, 2020 at 9:46 PM Tom Tromey wrote: > > >>>>> "Christian" == Christian Biesinger writes: > > Christian> On Fri, Sep 25, 2020 at 9:49 PM Tom Tromey wrote: > >> +++ b/gdbserver/server.cc > >> @@ -1054,11 +1054,8 @@ handle_search_memory (char *own_buf, int packet_len) > >> > >> pattern = (gdb_byte *) malloc (packet_len); > >> if (pattern == NULL) > >> - { > >> - error ("Unable to allocate memory to perform the search"); > >> - strcpy (own_buf, "E00"); > >> - return; > > Christian> I don't know much about gdbserver but if this code was trying to send > Christian> an error back maybe that code is actually needed? > > 'error' is noreturn, so I removed that code since it was dead. > Maybe whatever catches the exception sends an error. Yeah sorry, I understand that your patch doesn't change what this function does, I was just wondering if both the old and new code have a bug that it should send an error but doesn't. Christian