From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt1-x836.google.com (mail-qt1-x836.google.com [IPv6:2607:f8b0:4864:20::836]) by sourceware.org (Postfix) with ESMTPS id 00B883850412 for ; Mon, 26 Oct 2020 13:55:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 00B883850412 Received: by mail-qt1-x836.google.com with SMTP id e6so6687586qtw.10 for ; Mon, 26 Oct 2020 06:55:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=eSTAkn2eTkfvfcJItiTCK4sj0CkLeQ6MwTgaFHU1voY=; b=E2BRx09Puf+3CTMtqF2L065+f9n+uRhhHezFNvMg0Jnig2PhH2DV3TerQSFV74W1lX AF8UMaYcQc3G9Bnga0Yn9PvCvn3SP8y0ZL3W5Uai7B4198udBxVgkieZqQIbmh+/oXOA q277128jpHIVzPVGyqXT7pMzPso2iXjJ21tjISZLjYP89YB7Jff97LXMM62wBi9eY0TV VYhYkUM/nNiwKcU8aYQvSwO+8DPyq7NebDydNoLYPmWB//onZzUy3OWUSu2rsiviPw4b H3jFvnsiI8NyvpQ7E8yzbj4ArXB1b7hIE9Eg+L3IYahPqC0vXocbVYXHBfk/JZEdfkBb 1q7w== X-Gm-Message-State: AOAM530M4SnLMYE5Hm5pq6dRCPY8O6hri2wECr83mwcsSpOH5oztW58L MxHjddVnfoKNY0TbJYfmIam/6jDbJ/hIVA== X-Google-Smtp-Source: ABdhPJwVlQVyRdiG1K5t4fU8ZPgQaLoKqgVcAq/w0fD9ILAXO7HTIACt8+uYbUP4DKRWQf/QVzyaBg== X-Received: by 2002:ac8:7a8e:: with SMTP id x14mr16509133qtr.202.1603720519078; Mon, 26 Oct 2020 06:55:19 -0700 (PDT) Received: from ?IPv6:2804:7f0:8284:1487:e8:f2cf:c3e1:1857? ([2804:7f0:8284:1487:e8:f2cf:c3e1:1857]) by smtp.gmail.com with ESMTPSA id i22sm6495376qki.74.2020.10.26.06.55.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 26 Oct 2020 06:55:18 -0700 (PDT) Subject: Re: Question ARM sim target and Cortex M To: Fredrik Hederstierna , "gdb@sourceware.org" References: From: Luis Machado Message-ID: <35f9bfad-d3ea-3326-55a9-d0fbd256f0ff@linaro.org> Date: Mon, 26 Oct 2020 10:55:15 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Oct 2020 13:55:21 -0000 Hi Fredrik, On 10/24/20 6:02 AM, Fredrik Hederstierna via Gdb wrote: > Hi, > > I have a question about using ARM target simulator and bare metal Cortex M elf. > > I tried to start my arm-none-eabi with my program: > > $ arm-none-eabi-gdb myprog.elf > ... > (gdb) target sim > Connected to the simulator. > (gdb) load > Loading section .text, size 0x549f0 lma 0x2800 > Loading section .data, size 0x934 lma 0x571f0 > Loading section .ARM.exidx, size 0x8 lma 0x57b24 > Start address 0x28ff > Transfer rate: 2791776 bits in <1 sec. > (gdb) run > Starting program: /home/fredrik/build/myprog.elf > Unknown machine type '22'; please update sim_create_inferior. > [Inferior 1 (process 42000) exited normally] > (gdb) > > Looking in I see missing handling alot of newer targets > arm_5? > Looking in : > > bfd/bfd-in2.h:#define bfd_mach_arm_5TEJ 14 > bfd/bfd-in2.h:#define bfd_mach_arm_6 15 > bfd/bfd-in2.h:#define bfd_mach_arm_6KZ 16 > bfd/bfd-in2.h:#define bfd_mach_arm_6T2 17 > bfd/bfd-in2.h:#define bfd_mach_arm_6K 18 > bfd/bfd-in2.h:#define bfd_mach_arm_7 19 > bfd/bfd-in2.h:#define bfd_mach_arm_6M 20 > bfd/bfd-in2.h:#define bfd_mach_arm_6SM 21 > bfd/bfd-in2.h:#define bfd_mach_arm_7EM 22 > bfd/bfd-in2.h:#define bfd_mach_arm_8 23 > bfd/bfd-in2.h:#define bfd_mach_arm_8R 24 > bfd/bfd-in2.h:#define bfd_mach_arm_8M_BASE 25 > bfd/bfd-in2.h:#define bfd_mach_arm_8M_MAIN 26 > bfd/bfd-in2.h:#define bfd_mach_arm_8_1M_MAIN 27 > > My target is Cortex-M4 so its ID '22' meaning , > cannot I run Cortex-M4 in target simulator, or what do I do wrong here? > Are there more targets that could be added in eg , or am I looking in the wrong place? > > Thanks! BR Fredrik > Overall, the ARM/AArch64 sim targets should not be considered up-to-date nor complete. In fact, I think they are fairly outdated and shouldn't be considered for any serious simulator-based work/testing. Only casual trivial testing. I'd recommend QEMU instead, which is much better supported in terms of features. Of course, folks are welcome to update the sim targets.