From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1434 invoked by alias); 13 Mar 2014 14:05:47 -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 1425 invoked by uid 89); 13 Mar 2014 14:05:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 X-HELO: mail-we0-f171.google.com Received: from mail-we0-f171.google.com (HELO mail-we0-f171.google.com) (74.125.82.171) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 13 Mar 2014 14:05:45 +0000 Received: by mail-we0-f171.google.com with SMTP id t61so899946wes.16 for ; Thu, 13 Mar 2014 07:05:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=7wVEn0ce8iTfXUg+rFLrBgUITAAESjMoyOcClXOgRKA=; b=UY2DT79DJv+/w2WsCGJIntEodQqA18HK5dliA2j1FnOXUbKfNXCSRUQSWJNDMh130m LJT6JQdKG+d+x/uT/Aa9VYbhFSGhQl6aFo4wzWN8a/7vISRA0rVzHGL37mp5YS3oiEJV 3s3gvxA8UGMGRz7ajsc6yNWBolz3PaH7s1K+p9n65CFt2Z+RxkoQ/RjterD212P8rJn9 q+haO+9M7FGV+El66ioodiGTG2KK8Ivc2k/angGmuenxhFqGkOutRsrfsTT26XaSSmvD 2voQ3G03VsUcSupb2jrA0V3TuLaECU4vM4lLkt1nv2IobH/CPKbY+nNled8wdT7rKz1u HTQA== X-Gm-Message-State: ALoCoQkWSS52K042AGGXWBNKsXbuD3//YxNXJkVY8XKVr8vNcmrt7A4t4gqHxYwpl8G/g8+gTiwd X-Received: by 10.180.126.38 with SMTP id mv6mr1816805wib.46.1394719541639; Thu, 13 Mar 2014 07:05:41 -0700 (PDT) Received: from [192.168.0.134] (cust64-dsl91-135-5.idnet.net. [91.135.5.64]) by mx.google.com with ESMTPSA id j8sm5916664wjn.13.2014.03.13.07.05.40 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 13 Mar 2014 07:05:40 -0700 (PDT) Message-ID: <5321BB33.6090109@embecosm.com> Date: Thu, 13 Mar 2014 14:05:00 -0000 From: Pierre Langlois User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: Joel Brobecker CC: gdb-patches@sourceware.org Subject: Re: [PATCH][PR breakpoints/16606] AVR8 breakpoint out of range, decrement pc after break References: <531A2316.5090507@embecosm.com> <20140310110809.GC4882@adacore.com> <531EFA75.10008@embecosm.com> <20140312080759.GD4882@adacore.com> In-Reply-To: <20140312080759.GD4882@adacore.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2014-03/txt/msg00314.txt.bz2 >> I just realized that support for multiple address spaces was added >> but never documented. >> So the way to solve the issue is to add the @code qualifier as such: >> >> (gdb) break * (@code void *) 0x10e >> >> And it will set the TYPE_CODE_SPACE instance flag to the type when >> calling integer_to_address. >> >> However, shouldn't @code be the default for breakpoints? > I am not really sure about that. I know my example is not going to be > the most frequent situation ever, but what if the code is data memory? > I admit I didn't know about the @code, is there an equivalent for > data pointers as well? If that were a yes, I think we could argue > that indeed, @code would be a better default, and look into what > it would take to make that happen. > I only just noticed the existence of the space qualifiers. So yes, there are both @code and @data qualifiers for all targets. We could potentially have @code being the default and then issuing break *(@data void*) 0xaddr if the architecture supports executing data memory. I realized none of these flags are set by default actually, the fact that break defaults to a data address on AVR is because when evaluating "*0x10e", the resulting value is given a type with a code TYPE_CODE_INT. The AVR target code interprets this as a data address. I'm investigating where setting a default address spaces could be implemented. Thank you for the comments