From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 114527 invoked by alias); 6 Oct 2015 07:26:00 -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 114508 invoked by uid 89); 6 Oct 2015 07:25:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: SJOEDG01.corp.atmel.com Received: from nasmtp02.atmel.com (HELO SJOEDG01.corp.atmel.com) (204.2.163.16) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Tue, 06 Oct 2015 07:25:58 +0000 Received: from apsmtp01.atmel.com (10.168.254.30) by sjoedg01.corp.atmel.com (10.64.253.30) with Microsoft SMTP Server (TLS) id 14.3.235.1; Tue, 6 Oct 2015 00:33:31 -0700 Received: from PENCHT01.corp.atmel.com (10.168.5.161) by apsmtp01.corp.atmel.com (10.168.254.30) with Microsoft SMTP Server (TLS) id 14.3.235.1; Tue, 6 Oct 2015 15:25:32 +0800 Received: from penmbx02.corp.atmel.com ([fe80::b4e4:e0f6:b17c:e55f]) by PENCHT01.corp.atmel.com ([fe80::95df:d3d0:4452:28e3%12]) with mapi id 14.03.0235.001; Tue, 6 Oct 2015 15:25:54 +0800 From: "Sivanupandi, Pitchumani" To: "gdb-patches@sourceware.org" CC: Andrew Burgess , Denis Chertykov , "uweigand@de.ibm.com" Subject: [patch] parse load_offset (bias) of restore command as long Date: Tue, 06 Oct 2015 07:26:00 -0000 Message-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-SW-Source: 2015-10/txt/msg00049.txt.bz2 Hi, Following failures are noticed for avr-gdb. This may be the case for targets like AVR which has integer_to_address hook defined. FAIL: gdb.base/dump.exp: struct copy, srec; value restored ok=20 FAIL: gdb.base/dump.exp: struct copy, ihex; value restored ok=20 FAIL: gdb.base/dump.exp: struct copy, tekhex; value restored ok These tests are failed because load_offset(bias) of restore command parsed as address. command: restore filename [binary] bias start end Except binary, other BFDs have a built-in location; gdb restores content at offset 'bias' from that location. So, 'bias' of 'restore' command should be parsed as address only when the file is binary. Below patch changes gdb to parse 'bias' as long if the file is not binary. diff --git a/gdb/cli/cli-dump.c b/gdb/cli/cli-dump.c index 931bb4a..8dd2009 100644 --- a/gdb/cli/cli-dump.c +++ b/gdb/cli/cli-dump.c @@ -596,8 +596,9 @@ restore_command (char *args_in, int from_tty) } /* Parse offset (optional). */ if (args !=3D NULL && *args !=3D '\0') - data.load_offset =3D - parse_and_eval_address (scan_expression_with_cleanup (&args, NULL)); + data.load_offset =3D binary_flag ? + parse_and_eval_address (scan_expression_with_cleanup (&args, NULL))= : + parse_and_eval_long (scan_expression_with_cleanup (&args, NULL)); if (args !=3D NULL && *args !=3D '\0') { /* Parse start address (optional). */ If ok, could someone commit please? I don't have commit access. Regards, Pitchumani gdb/ChangeLog 2015-10-05 Pitchumani Sivanupandi * cli/cli-dump.c (restore_command): Parse load_offset (bias) as address only when the file is binary.