From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42171) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VOrNe-00081t-KE for qemu-devel@nongnu.org; Wed, 25 Sep 2013 11:52:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VOrNZ-0006Ps-VA for qemu-devel@nongnu.org; Wed, 25 Sep 2013 11:51:58 -0400 Received: from mail-lb0-f173.google.com ([209.85.217.173]:56675) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VOrNZ-0006Pb-NB for qemu-devel@nongnu.org; Wed, 25 Sep 2013 11:51:53 -0400 Received: by mail-lb0-f173.google.com with SMTP id o14so16883lbi.32 for ; Wed, 25 Sep 2013 08:51:52 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <5243035D.4080200@adacore.com> References: <1380041161-13266-1-git-send-email-chouteau@adacore.com> <1380041161-13266-4-git-send-email-chouteau@adacore.com> <5243035D.4080200@adacore.com> From: Peter Maydell Date: Thu, 26 Sep 2013 00:51:32 +0900 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH 3/3] Add ARM registers definitions in Monitor commands List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fabien Chouteau Cc: QEMU Trivial , QEMU Developers , =?UTF-8?Q?Andreas_F=C3=A4rber?= , Luiz Capitulino On 26 September 2013 00:38, Fabien Chouteau wrote: > On 09/25/2013 01:53 AM, Peter Maydell wrote: >> >> No, I really don't want to see another target #ifdef ladder, please. >> Put a 'static const MonitorDef *monitor_defs;' into CPUClass, >> and initialize it in each target's class init function, please. >> (You'll need to move the appropriate sections of the current >> static array in monitor.c plus the per-target functions that >> it references into target-*/cpu.c.) Look at gdb_num_core_regs >> as an example of where we made this kind of abstraction. >> > > I tried already. Where whould you put the declaration of MonitorDef type? It doesn't matter very much, but monitor.h seems the obvious place. You probably don't want qom/cpu.h to have to drag in monitor.h so a 'struct MonitorDef;' forward declaration in cpu.h will let you avoid that (we do that already for a few other structs). -- PMM