From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 90614 invoked by alias); 21 Jun 2017 09:47:14 -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 90137 invoked by uid 89); 21 Jun 2017 09:47:13 -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=Hx-languages-length:1615, Being, H*r:sk:static. X-HELO: mail-io0-f193.google.com Received: from mail-io0-f193.google.com (HELO mail-io0-f193.google.com) (209.85.223.193) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 21 Jun 2017 09:47:11 +0000 Received: by mail-io0-f193.google.com with SMTP id m19so17125ioe.1 for ; Wed, 21 Jun 2017 02:47:11 -0700 (PDT) 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=fqZVPjtJtrBXU41gM2fq+YS9aPV9DbsmNitG1MnKXao=; b=hpIdnQEP/7p066/nJXZ2gsHjR9/nG+MJEcTjVXSY+S3ox25EBw3Qb7yc5ZY1tTqGSS SAjs05cPUxoYlC+gOV6kT7H7AuxCn5pTuFz2hqnFNBqGXn7QBp5djo6bpu/xw7DyMn6W 7F/Dis1Lktfak2YJIlPbbx9Nh0gHv5ppFwgQOUX2rKHQ5x/vswunLfjSRgiXkceNDbem EsTDJK+4OByQkOkxOs4iBYw+vnF8tNaHtg9puyVD9bE4mtZL2ozDtzGfB0AAYTaNhtlk bzyXGXZqJx4JxHlvyafAByetR1UpCr7YkoVld8iid/9s6vSs/gIxPfRFnaDLcFDGLSSU xKtA== X-Gm-Message-State: AKS2vOyCy2cI/5edkx4uwbUqZOW9xlevbqmit1K44EuwSB4XNYsWs8w1 6HzkFucCXX7ATaT5 X-Received: by 10.107.138.81 with SMTP id m78mr31236720iod.60.1498038429722; Wed, 21 Jun 2017 02:47:09 -0700 (PDT) Received: from E107787-LIN (static.42.136.251.148.clients.your-server.de. [148.251.136.42]) by smtp.gmail.com with ESMTPSA id v22sm941148ioi.54.2017.06.21.02.47.08 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Wed, 21 Jun 2017 02:47:09 -0700 (PDT) From: Yao Qi To: Wei-min Pan Cc: gdb-patches@sourceware.org Subject: Re: [PATCH v2] gdb: ADI support References: <1497655802-111684-1-git-send-email-weimin.pan@oracle.com> <86o9ti4wa1.fsf@gmail.com> <59496067.5040008@oracle.com> Date: Wed, 21 Jun 2017 09:47:00 -0000 In-Reply-To: <59496067.5040008@oracle.com> (Wei-min Pan's message of "Tue, 20 Jun 2017 10:50:31 -0700") Message-ID: <86d19xhdv0.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: 2017-06/txt/msg00585.txt.bz2 Wei-min Pan writes: >> The new file sparc64-adi-tdep.c should be merged into the existing >> sparc64-tdep.c. The file name schema in GDB is ARCH-OSABI-tdep.c. >> Since adi is a new hardware feature rather than an OSABI, it should be >> put in sparc64-tdep.c >>=20=20=20 > > Originally it was part of sparc64-tdep.c. But our engineer thought > it's cleaner to make it a > separate source file. Being new to the gnu world, I believe following > the file name schema > is the way to go. Thanks. > That is the current file name convention we have to follow, however, I personally prefer putting them into separated files. Let me post a mail to ask this. >> >> You can't access /proc in *-tdep.c file, because it is also compiled for >> cross-debugger. The rule in general is to move it to sparc64-linux-nat.= c. >>=20=20=20 > It's nice to know. Will look into it. BTW is there any document that > specifies/defines these rules for > *-tdep.c and *-nat.c files? I was puzzled by this for several years when I started on GDB :) The most relevant one is https://sourceware.org/gdb/wiki/Internals%20Native-Debugging In short, anything required in native debugging (gdb and program are running on the same machine) should be put in *-nat.c. The rest of things related to this arch should be put into *-tdep.c. Note some ports have *-linux-nat.c and *-linux-tdep.c, the former is about anything required in Linux native debugging (gdb and the program is running on the same Linux machine), while the latter is about debugging a program running on Linux of that arch. --=20 Yao (=E9=BD=90=E5=B0=A7)