From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 105976 invoked by alias); 15 Mar 2016 20:30:33 -0000 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 Received: (qmail 105966 invoked by uid 89); 15 Mar 2016 20:30:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=H*M:sk:e89a8ff, H*MI:sk:e89a8ff X-HELO: mail-pf0-f201.google.com Received: from mail-pf0-f201.google.com (HELO mail-pf0-f201.google.com) (209.85.192.201) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Tue, 15 Mar 2016 20:30:22 +0000 Received: by mail-pf0-f201.google.com with SMTP id 4so4020829pfd.0 for ; Tue, 15 Mar 2016 13:30:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:message-id:date:subject:from:to:cc; bh=adWGnWgFfCD2eOdXTQfs5hJTXNfINnNy4udTrSgXuKk=; b=CwLwPxci6g6ll9r25oeLO/GEi4LKTNiBH8utPuQo46vuj9DlWRszxC6Y21MtJ4JDoY hn+PAO+SIxCtXKjR6hpToMxwI4+EvHniy62C/0oduwcxSE27pWwVe/9eNM8f6EEcatkS o5kVM35TeEI8sOMCbpGovhhQTI+F6kO4otCjB79vp9bMyirWn/efh5PapdNdM+oZu4lX P5D8LhoUQJw5tgUoyI8ODh4zAuEJyGCTHKcL8i99z6uR7Q4F0FFqMGRQspQVy4gkwZ0H rK3QX8XjwLJPnneF8eQuCy3Ah5JXEGYu1PyjgS0dHVYHaMhNZisiozKxj/bFfrN4x1/b Ydag== X-Gm-Message-State: AD7BkJJfWv5M6cmxh2f83BbpK0Gkt/BpsjWcaD/2bbuORonZ5+V8+0jA9UCa7hvS7wiM6rzEkg== MIME-Version: 1.0 X-Received: by 10.66.119.197 with SMTP id kw5mr24280089pab.15.1458073821035; Tue, 15 Mar 2016 13:30:21 -0700 (PDT) Message-ID: Date: Tue, 15 Mar 2016 20:30:00 -0000 Subject: Re: [PATCH v4] PR 18303, Tolerate malformed input for lookup_symbol-called functions. From: Doug Evans To: Don Breazeal Cc: Content-Type: text/plain; charset=UTF-8; format=flowed; delsp=yes X-IsSubscribed: yes X-SW-Source: 2016-03/txt/msg00244.txt.bz2 Don Breazeal writes: > Apologies -- the previous version of this patch was missing one file, > added here. Sorry for the noise. > --Don > > ---V3 Comment--- > This patch differs from v2 in that the new test gdb.linespec/ls-errs-cp.exp > is gone, and instead (per Pedro's suggestion) gdb.linespec/ls-errs.exp has > been modified to test both C & C++, and to incorporate the small amount of > extra testing from ls-errs-cp.exp. > > It also includes, unchanged from the previous version of the patch: > > * an updated version of the alternate fix that Keith proposed for my > patch that addressed PR breakpoints/18303. Doug has approved (in > concept, at least) the code portion of the patch. > > * a couple of other new tests of colons in linespecs. > > Thanks, > --Don > > ----------- > lookup_symbol is often called with user input. Consequently, any > function called from lookup_symbol{,_in_language} should attempt to > deal with malformed input gracefully. After all, malformed user > input is not a programming/API error. > > This patch does not attempt to find/correct all instances of this. It > only fixes locations in the code that trigger test suite failures. > > This patch fixes PR breakpoints/18303, "Assertion: -breakpoint-insert > with windows paths of file in non-current directory". > > The patch includes three new tests related to this. One is just > gdb.linespec/ls-errs.exp copied and converted to use C++ instead of C, and > to add a case using a file name containing a Windows-style logical drive > specifier. The others include an MI test to provide a regression test for > the specific case reported in PR 18303, and a C++ test for proper error > handling of access to a program variable when using a file scope specifier > that refers to a non-existent file. > > Tested on x86_64 native Linux. > > gdb/ChangeLog > 2016-01-28 Keith Seitz > > PR breakpoints/18303 > * cp-namespace.c (cp_lookup_bare_symbol): Change assertion to > look for "::" instead of simply ":". > (cp_search_static_and_baseclasses): Return null_block_symbol for > malformed input. > Remove assertions. > * cp-support.c (cp_find_first_component_aux): Do not return > a prefix length for ':' unless the next character is also ':'. > > gdb/testsuite/ChangeLog > 2016-01-28 Don Breazeal > > * gdb.cp/scope-err.cc: New test program. > * gdb.cp/scope-err.exp: New test script. > * gdb.linespec/ls-errs.c (myfunction): Expanded to have multiple > lines and "set breakpoint here" comment. > * gdb.linespec/ls-errs.exp: Added C++ testing and new test case. > * gdb.mi/mi-linespec-err-cp.cc: New test program. > * gdb.mi/mi-linespec-err-cp.exp: New test script. >... Hi. LGTM