From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 68307 invoked by alias); 22 Jan 2018 15:28:29 -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 68220 invoked by uid 89); 22 Jan 2018 15:28:29 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=H*r:sk:static. X-HELO: mail-wr0-f175.google.com Received: from mail-wr0-f175.google.com (HELO mail-wr0-f175.google.com) (209.85.128.175) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 22 Jan 2018 15:28:27 +0000 Received: by mail-wr0-f175.google.com with SMTP id v15so6265493wrb.8 for ; Mon, 22 Jan 2018 07:28:26 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=rSh/UJbu0y47Njbq9YXd42dHnwczAvaxa02KGP5ioIk=; b=QLKAYe904LcOjGuMODfUEkHOAIxSzenjmFMjt0jlOWp309NS3fouUdDZIeynvugGcp MgsVUCrv2CgyvUS5JXZF8qzhnzuLkvtKQhK8/MKN+W8ZSDiHIpAEjLA3pQGbvLbUMtDF VhdQFUBIkc66ITIrChqp+HF9f3HCABcQtruvhImKfY03IqDv2X0VnJhU26IGCyPgMJjH PEB7tdEEqgBLrPLt3zwW6JdQouSfdo99QszXH7FkSInRcK8Em5EECymWV1jKoCQ/O3bf 1VOoYqi1b30ygjUecz+T4NyQpCMJd7GcqECDhHQjPmKd5tMBnhUFplxK3gnTVg9fBYbE 61HQ== X-Gm-Message-State: AKwxytfUbpAz7h3X7iqpBbQ333KBmfJMD0GgqX5SpB9tbvQfB8YFs3Qi 8H11D6yr77wQaTSqGiYexKM= X-Google-Smtp-Source: AH8x2259Pu0bOfoXyVfaygjT6I/gNy+HiFfG2DVtmX+G3po+itZ8iYyt2agdo9eb9ODMM8/Uk5IqmQ== X-Received: by 10.223.184.120 with SMTP id u53mr3985933wrf.99.1516634905104; Mon, 22 Jan 2018 07:28:25 -0800 (PST) Received: from E107787-LIN (static.42.136.251.148.clients.your-server.de. [148.251.136.42]) by smtp.gmail.com with ESMTPSA id u33sm18008778wrc.83.2018.01.22.07.28.23 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Mon, 22 Jan 2018 07:28:23 -0800 (PST) From: Yao Qi To: Alan Hayward Cc: "gdb-patches\@sourceware.org" , nd Subject: Re: [PATCH 3/6] : Update dat files with arch and osabi References: <737CEA28-7C3E-4A3C-AE7C-C0139A84FAC8@arm.com> <6D4AA708-D4CE-42E6-8D84-54E6B292DB0B@arm.com> Date: Mon, 22 Jan 2018 15:28:00 -0000 In-Reply-To: <6D4AA708-D4CE-42E6-8D84-54E6B292DB0B@arm.com> (Alan Hayward's message of "Mon, 22 Jan 2018 13:22:08 +0000") Message-ID: <86lggpewvg.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2018-01/txt/msg00445.txt.bz2 Alan Hayward writes: > If you remove this patch, but keep all the rest of the series, then the p= orts > using the new style target descriptions will segfault when printing the x= ml > in print_xml_feature::visit_pre() because the -generated.c files do not > contain an arch or osabi. Can you elaborate how does that happen? New style target description doesn't use anything from -generated.c files. Note that there is even no -generated.c files in gdbserver build directory when gdb is in release mode (bfd/development.sh:development is false). > > The segfault happens on gdbserver init because the -generated.c functions > are calling tdesc_get_features_xml(). I still don't see why -generated.c functions call tdesc_get_features_xml. For new style target description, it already generate osabi and arch (see tdesc_get_features_xml path tdesc->xmltarget =3D=3D NULL). For old style target description, arch and osabi is from xml file. Take i386-avx-linux-generated.c for example, static const char *xmltarget_i386_avx_linux =3D "i386-avx-linux.xml"; #ifndef IN_PROCESS_AGENT result->expedite_regs =3D expedite_regs_i386_avx_linux; result->xmltarget =3D xmltarget_i386_avx_linux; #endif osabi and arch is specified in features/i386/i386-avx-linux.xml, i386 GNU/Linux > Thinking about it, I will remove this call from -generated. > That fixes the bug. > > This leaves a question: > Is it required that the generated target descriptions have the osabi and = arch? > If it does not need this information, then I will delete this patch. If by "the generated target descriptions", you mean *-generated.c files in gdbserver build directory, yes, they don't have osabi and arch. As I said above, arch and osabi, if any, are specified in the xml files. --=20 Yao (=E9=BD=90=E5=B0=A7)