From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 106651 invoked by alias); 5 Mar 2019 20:15:53 -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 105181 invoked by uid 89); 5 Mar 2019 20:15:41 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy=H*MI:sk:2019030 X-HELO: mail-wr1-f49.google.com Received: from mail-wr1-f49.google.com (HELO mail-wr1-f49.google.com) (209.85.221.49) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 05 Mar 2019 20:15:38 +0000 Received: by mail-wr1-f49.google.com with SMTP id t18so10909661wrx.2 for ; Tue, 05 Mar 2019 12:15:26 -0800 (PST) Return-Path: Received: from ?IPv6:2001:8a0:f913:f700:4c97:6d52:2cea:997b? ([2001:8a0:f913:f700:4c97:6d52:2cea:997b]) by smtp.gmail.com with ESMTPSA id f68sm817352wmg.5.2019.03.05.12.15.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Mar 2019 12:15:23 -0800 (PST) Subject: Re: [RFC] Change the_dummy_target to be a global To: Tom Tromey , gdb-patches@sourceware.org References: <20190304204100.27702-1-tromey@adacore.com> From: Pedro Alves Message-ID: <38644529-a5d6-1e24-97f8-b13b30bb87dd@redhat.com> Date: Tue, 05 Mar 2019 20:15:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20190304204100.27702-1-tromey@adacore.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2019-03/txt/msg00071.txt.bz2 On 03/04/2019 08:41 PM, Tom Tromey wrote: > While debugging gdb, I printed the target stack and got: > > (top-gdb) p g_target_stack > $10 = { > m_top = thread_stratum, > m_stack = {0x142b0b0, 0x13da600 , 0x1c70690, 0x13d63b0 , 0x0, 0x0, 0x0} > } > > (This is clearly from before the change to make ravenscar > multi-target-capable.) > > Here, 0x142b0b0 is the singleton dummy target. It seems to me that > since this is always a singleton, it would be a bit nicer if it were a > global, so that it would be noted in the above. > > This patch implements this idea, and now I get: > > (top-gdb) p g_target_stack > $2 = { > m_top = dummy_stratum, > m_stack = {0x1f1b040 , 0x0, 0x0, 0x0, 0x0, 0x0, 0x0} > } > > I did not do the same for the debug target. It didn't seem as useful > to me. > > gdb/ChangeLog > 2019-03-04 Tom Tromey > > * target.c (the_dummy_target): Move later. Change type to > "dummy_target". > (initialize_targets): Don't initialize the_dummy_target. Yes, I think that's fine. At some point in the multi-target branch I made a change like that, but the current state of the branch it's back to being heap-allocated. I'm not seeing any reason that requires that, though. I replicated the change on top of the branch and ran the new multi-target tests, and they all still passed. Thanks, Pedro Alves