From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29370 invoked by alias); 28 Oct 2013 21:51:25 -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 29361 invoked by uid 89); 28 Oct 2013 21:51:24 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-ve0-f178.google.com Received: from mail-ve0-f178.google.com (HELO mail-ve0-f178.google.com) (209.85.128.178) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Mon, 28 Oct 2013 21:51:22 +0000 Received: by mail-ve0-f178.google.com with SMTP id jy13so6651127veb.9 for ; Mon, 28 Oct 2013 14:51:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=81N0WPXZoBVXYmjRs71R48JyxHmt+KjeSr+VBZ7swy4=; b=QQh2hkEdkC++U/OJK9W0hHsKA9htQQGw3eHoxp+FahNbeSHHd18xrDrAEGDVyRbgE0 o/QeBLE7uQop+GxtdiOdrzLXAwbhdxO+E9hYiPI1kWgXuDyctxl3AJRSGuJzimaia3oo 3hMY5fBs/tNd1GQLI2dFZYwxax8TsttS/hUxUU4V8fCTiZC9vuMch2NXGRzu8KJVcU2u 8tEbWkQb8tyPhA3Y8bLcWNwuB0QChUuK9o6AmDsOBQrNEyXLkyTlu8qvN3O5aCIuD9Gm ANsQvnrEfE2J3Ig0IMUHG/ArsUUISedvAaka4nPBhFb0BL0illNOqaPM3/mlyb/QiorR FoDQ== X-Gm-Message-State: ALoCoQnZdCky/zEAYPr70HFZ5h6OvHBawFQVWzXFLyqwzbpQRzr5Tx/8xTfoh5DhqQw3LztQsG6ELYnDj7eWMbgpR4bg1TreKbF4Juyo+kGhgk7tETgCRCT6IV9/cWW1I8QlFGxIKoyMKTRCZx+WoACTbtSY9M5GG1VUUHRDRlvonDudjr4SbE3dxz1u1JACl0Lzxpq0aYdm0SJuZdbWQGEb+WukoiI0zQ== MIME-Version: 1.0 X-Received: by 10.58.255.233 with SMTP id at9mr3220207ved.20.1382997080484; Mon, 28 Oct 2013 14:51:20 -0700 (PDT) Received: by 10.52.237.232 with HTTP; Mon, 28 Oct 2013 14:51:20 -0700 (PDT) In-Reply-To: <1382516855-32218-3-git-send-email-yao@codesourcery.com> References: <1382516855-32218-1-git-send-email-yao@codesourcery.com> <1382516855-32218-3-git-send-email-yao@codesourcery.com> Date: Mon, 28 Oct 2013 21:51:00 -0000 Message-ID: Subject: Re: [PATCH 2/5] Associate target_dcache to address_space. From: Doug Evans To: Yao Qi Cc: gdb-patches Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes X-SW-Source: 2013-10/txt/msg00886.txt.bz2 On Wed, Oct 23, 2013 at 1:27 AM, Yao Qi wrote: > Hi, > Nowadays, 'target_dcache' is a global variable in GDB, which is not > necessary. It can be a per-address-space variable. In this patch, we > add a new structure 'target_dcache', which includes all dcaches of > target and all of them are per-address-space. > > There is one field 'general' which is equivalent to current > variable 'target_dcache'. I thought to name it 'stack', but it also > cache memory regions marked by attributes, I choose 'general'. > > gdb: > > 2013-10-23 Yao Qi > > * progspace.h (struct address_space): Declare. > (current_address_space): New macro. > * target.c (target_dcache_aspace_key): New. > (target_dcache): Delete. > (struct target_dcache): New. > (target_dcache_alloc): New function. > (target_dcache_xfree): New function. > (target_dcache_get): New function. > (target_dcache_cleanup)): New function. > (target_dcache_invalidate): Update. > (memory_xfer_partial_1): Update. > (initialize_targets): Initialize target_dcache_aspace_key. > [...] > +/* Allocate an instance of struct target_dcache. */ > + > +static struct target_dcache * > +target_dcache_alloc (void) > +{ > + struct target_dcache *dcache = xmalloc (sizeof (*dcache)); > + > + dcache->general = dcache_init (); > + > + return dcache; > +} I think more work is needed here. I looked for it in the patch series, apologies if I missed it! Consider "info dcache" and "set dcache size,line-size". They use a nasty global, last_cache, which needs to go away. Plus, we need to specify their semantics in a cache-per-address-space world.