R: [PATCH] PR gdb/13519, disassemble command attempts to disassemble SRAM rather than program memory.
Message ID | AM4P191MB01004CA9EE57C5943FE0C065F7E90@AM4P191MB0100.EURP191.PROD.OUTLOOK.COM |
---|---|
State | New, archived |
Headers |
Received: (qmail 104136 invoked by alias); 15 Jun 2019 20:14:39 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: <gdb-patches.sourceware.org> List-Unsubscribe: <mailto:gdb-patches-unsubscribe-##L=##H@sourceware.org> List-Subscribe: <mailto:gdb-patches-subscribe@sourceware.org> List-Archive: <http://sourceware.org/ml/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-help@sourceware.org>, <http://sourceware.org/ml/#faqs> Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 104127 invoked by uid 89); 15 Jun 2019 20:14:38 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.0 required=5.0 tests=BAYES_00, FORGED_HOTMAIL_RCVD2, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.1 spammy=gdb-patches@sourceware.org, sk:gdbpat, U*gdb-patches, gdbpatchessourcewareorg X-HELO: EUR01-DB5-obe.outbound.protection.outlook.com Received: from mail-oln040092064068.outbound.protection.outlook.com (HELO EUR01-DB5-obe.outbound.protection.outlook.com) (40.92.64.68) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 15 Jun 2019 20:14:37 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tTo6douSm8O4xe/JiZ/P/lYLFJWa7A2SmMkIP5dheEU=; b=QM780uWO6A84puhb7H3VDUkhkpAL5TyeLnUnrulTH6dgpoUNuKj0FOLuG2Sh62C94fvF8ysDhZyKox1YKMV9Z/M0ErGDTwcyhBcfWsnTXd8Akf9uCt+bHvAr3hp4HiiFLsZnocAkRF9kJGxLpeRBe89nfK/J6aubFgICX0LTdtGzy4G/Y8Mbx9xmYLJLgHjvYL0GDRlJW9lp3ywAMUIqbTWtCGBReIYWGoxLVzhLEKTTEjlhuTj9kNxptOVLPGI4jlvrfY8pf0ie93OW18A9yTTdGg2XhHnPn+p2KVWqOUcprvm5xghMhrj5UR5ilWTF8AGMrpnD+kR+NyRuPnu2cA== Received: from VE1EUR01FT038.eop-EUR01.prod.protection.outlook.com (10.152.2.55) by VE1EUR01HT056.eop-EUR01.prod.protection.outlook.com (10.152.2.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1987.11; Sat, 15 Jun 2019 20:14:34 +0000 Received: from AM4P191MB0100.EURP191.PROD.OUTLOOK.COM (10.152.2.57) by VE1EUR01FT038.mail.protection.outlook.com (10.152.3.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1987.11 via Frontend Transport; Sat, 15 Jun 2019 20:14:34 +0000 Received: from AM4P191MB0100.EURP191.PROD.OUTLOOK.COM ([fe80::6918:8d94:3f41:cc86]) by AM4P191MB0100.EURP191.PROD.OUTLOOK.COM ([fe80::6918:8d94:3f41:cc86%4]) with mapi id 15.20.1987.014; Sat, 15 Jun 2019 20:14:34 +0000 From: cristiano de alti <cristiano_dealti@hotmail.com> To: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org> Subject: R: [PATCH] PR gdb/13519, disassemble command attempts to disassemble SRAM rather than program memory. Date: Sat, 15 Jun 2019 20:14:33 +0000 Message-ID: <AM4P191MB01004CA9EE57C5943FE0C065F7E90@AM4P191MB0100.EURP191.PROD.OUTLOOK.COM> References: <BLU436-SMTP174C641CBB21D15D7CDF01DF78B0@phx.gbl> In-Reply-To: <BLU436-SMTP174C641CBB21D15D7CDF01DF78B0@phx.gbl> x-ms-exchange-purlcount: 1 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable |
Commit Message
Cristiano
June 15, 2019, 8:14 p.m. UTC
Hi, Is there any chance this will be ever merged? See https://sourceware.org/bugzilla/show_bug.cgi?id=13519 Thanks, Cristiano
Comments
On 2019-06-15 4:14 p.m., cristiano de alti wrote: > Hi, > Is there any chance this will be ever merged? > See > > https://sourceware.org/bugzilla/show_bug.cgi?id=13519 > > Thanks, > Cristiano > > ________________________________ > Da: Cristiano De Alti <cristiano_dealti@hotmail.com> > Inviato: giovedì 17 marzo 2016 23:25 > A: gdb-patches@sourceware.org > Cc: Cristiano De Alti > Oggetto: [PATCH] PR gdb/13519, disassemble command attempts to disassemble SRAM rather than program memory. > > gdb/ChangeLog: > 2016-03-17 Cristiano De Alti <cristiano_dealti@hotmail.com> > > PR gdb/13519 > * avr-tdep.c (avr_integer_to_address): return data or > code address accordingly to the second 'type' argument > of the function. > --- > gdb/avr-tdep.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/gdb/avr-tdep.c b/gdb/avr-tdep.c > index 088fe51..993e92b 100644 > --- a/gdb/avr-tdep.c > +++ b/gdb/avr-tdep.c > @@ -362,7 +362,10 @@ avr_integer_to_address (struct gdbarch *gdbarch, > { > ULONGEST addr = unpack_long (type, buf); > > - return avr_make_saddr (addr); > + if (TYPE_DATA_SPACE (type)) > + return avr_make_saddr (addr); > + else > + return avr_make_iaddr (addr); > } > > static CORE_ADDR > -- > 1.7.10.4 > Hi Cristiano, This also changes the default behavior of the x (examine memory) command, is it expected? Before: $ ~/build/binutils-gdb/gdb/gdb a.out -ex "tar rem :1234" -ex "b main" -ex c (gdb) x 0x10 0x800010: 0x00000000 After: $ ~/build/binutils-gdb/gdb/gdb a.out -ex "tar rem :1234" -ex "b main" -ex c (gdb) x 0x10 0x10 <__vectors+16>: 0xc022c023 So while this fixes "disassemble" to use code/flash addresses (which makes sense), it changes the behavior for "x". I think that people are most likely interested in data/sram when using the "x" command (except maybe if using "x/i", as was mentioned in bug 13519). Simon
diff --git a/gdb/avr-tdep.c b/gdb/avr-tdep.c index 088fe51..993e92b 100644 --- a/gdb/avr-tdep.c +++ b/gdb/avr-tdep.c @@ -362,7 +362,10 @@ avr_integer_to_address (struct gdbarch *gdbarch, { ULONGEST addr = unpack_long (type, buf); - return avr_make_saddr (addr); + if (TYPE_DATA_SPACE (type)) + return avr_make_saddr (addr); + else + return avr_make_iaddr (addr); } static CORE_ADDR