From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 34634 invoked by alias); 20 Jan 2016 23:39:56 -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 34552 invoked by uid 89); 20 Jan 2016 23:39:55 -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,T_FILL_THIS_FORM_SHORT autolearn=ham version=3.3.2 spammy=sk:address, Hx-languages-length:2390, H*r:209.85.192 X-HELO: mail-pf0-f202.google.com Received: from mail-pf0-f202.google.com (HELO mail-pf0-f202.google.com) (209.85.192.202) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 20 Jan 2016 23:39:54 +0000 Received: by mail-pf0-f202.google.com with SMTP id 65so2419558pfd.0 for ; Wed, 20 Jan 2016 15:39:54 -0800 (PST) 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 :content-type; bh=L0fjfoFacw11hs1aB/F0pa00BfJgvWZtIjDKfjA2DY4=; b=AXtlYSMTgCacmUb1GoSeJlqBoLAT9dL0yNYx2KCGeW333pXuCyXTBZs3xHMIblw2am ukRJzhq17gJfxg9F4stY5Z2NYgsgukYq/TDV+VLt9FFx3cw16XW4vF4q610RDf75Sxj+ QlymmdzHrES+kNNafEQAIHEUG2uTtsFSZ8h8W9moRDwa2J4h9yXPSEyDBbJw4YP7B9A/ QWEk4RxxAPDhJM7rANYOsvFmxSkZsapjFm1BNGyCctov1HmBrKCOIbbzxY2oAXeeJ4jB rhWh664ALLAhQDtmqwO3pQNfF6ZRxUQTQaD5EPWTKYn6mvmZgT1lX39RnW10fl3UaCBe PtyA== X-Gm-Message-State: AG10YOTWv0JPLUDhe2Ydc7Vf/Q3mXaWR3/SgZDeRN+Gpy/WzHGdpblnqwUXWpeLQirYw+1ra+Q== MIME-Version: 1.0 X-Received: by 10.66.100.129 with SMTP id ey1mr32477736pab.18.1453333192379; Wed, 20 Jan 2016 15:39:52 -0800 (PST) Message-ID: <047d7bd91664ac4a4a0529cc80a6@google.com> Date: Wed, 20 Jan 2016 23:39:00 -0000 Subject: Re: [RFA] Fix regression introduced in "break *" by explicit location patches (was: "Re: [PATCH v6 4/9] Explicit locations: introduce address locations") From: Doug Evans To: Joel Brobecker Cc: Keith Seitz , gdb-patches@sourceware.org Content-Type: text/plain; charset=UTF-8; format=flowed; delsp=yes X-IsSubscribed: yes X-SW-Source: 2016-01/txt/msg00497.txt.bz2 Joel Brobecker writes: > Hi Keith, > > What do you think of the attached patch? There is also a testcase, > which is slightly different from the scenario that triggered this > exchange, but which also has the advantage of not requiring PIE, > which makes the test a little more universal, I think. > > gdb/ChangeLog: > > * location.h (new_address_location): Add new parameters > "addr_string" and "addr_string_len". > (get_address_string_location): Add declaration. > * location.c (new_address_location): Add new parameters > "addr_string" and "addr_string_len". If not NULL, store > a copy of the addr_string in the new location as well. > (get_address_string_location): New function. > (string_to_event_location): Update call to new_address_location. > * linespec.c (event_location_to_sals) : > Save the event location in the parser's state before > passing it to convert_address_location_to_sals. > * breakpoint.c (create_thread_event_breakpoint): Update call > to new_address_location. > (init_breakpoint_sal): Get the event location's string, if any, > and use it to update call to new_address_location. > * python/py-finishbreakpoint.c (bpfinishpy_init): > Update call to new_address_location. > * spu-tdep.c (spu_catch_start): Likewise. > > * config/djgpp/fnchange.lst: Add entries for > gdb/testsuite/gdb.base/break-fun-addr1.c and > gdb/testsuite/gdb.base/break-fun-addr2.c. > > gdb/testsuite/ChangeLog: > > * gdb.base/break-fun-addr.exp: New file. > * gdb.base/break-fun-addr1.c: New file. > * gdb.base/break-fun-addr2.c: New file. > > Tested on x86_64-linux. Hi. One nit. >... > diff --git a/gdb/location.c b/gdb/location.c > index 37285f3..e43ebf1 100644 > --- a/gdb/location.c > +++ b/gdb/location.c >... > @@ -134,6 +137,15 @@ get_address_location (const struct event_location *location) > > /* See description in location.h. */ > > +const char * > +get_address_string_location (const struct event_location *location) > +{ > + gdb_assert (EL_TYPE (location) == ADDRESS_LOCATION); > + return EL_STRING (location); > +} > + > +/* See description in location.h. */ > + Given that the argument must be an address location, "get_address_location_string" reads better to me. LGTM with that change.