From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) by sourceware.org (Postfix) with ESMTPS id 832103858D33 for ; Thu, 23 May 2024 12:14:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 832103858D33 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 832103858D33 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::636 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1716466490; cv=none; b=cQntUFZDclWARRQR5oGUxefdatj2rR8HOsgreTAktxkEZrSF5EqOUBpVk3s3O32nTeW4W+MCQCUtDtqy4RJFT8eXzOVMmcTDvUSDFk0oCLGl1lAqeNG4NZeptUjVuI7SJIu+OH07R7CMTSZYcyMguKiqf4wYnJP2kGCblbZ54sI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1716466490; c=relaxed/simple; bh=c+USa5gS50ovAwy8Z+LIM6WLhaHMDPvUbHC5AghS+Pc=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=bEzp4Xs9f3SdTDfu+B7FrIeVSKtuIkwtmAJDGaJst+9303ddlFxFRIMUj+c/PjdB+tvzm4QIwRj/wcH30fhG4DqS7h1/k7+z8fqcfjLaKPunVIrBAhtvJnsV4joM0oCRzf8l+xLaifad6kJnYM4HCdvzcDy2cHwyOMhs0wVw4zs= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-1f3434c36baso3759125ad.2 for ; Thu, 23 May 2024 05:14:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1716466487; x=1717071287; darn=sourceware.org; h=mime-version:message-id:date:user-agent:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=CFQCYo2y0ZA9NUm9ELgCxM2ohtnHg9OffQ9IEHTb5Bs=; b=SoPcCRhJKy5a98QsroR0rf9ELGiAOgiX8zZRaQqPQd6RrtMj6jqX8RXbDlElAxeVsM INi0ARxMecSs/Ls2IWb20N/MS9RTOvsRZZ3CDKguFykZTB+zHesGb5p9euNQengrxEcH 1tFxHidjCPDvCbGuU6e+HVTGeTDyfPPaTuhYhDNTFIyp2mVTq/nwb3wVlXw1citNd2ee VlzmV/lyOfRt2MTU22YZEolD3/W1EbghT529YOQE1rPXcnetINlX3yFpvSY608wJgiaS a7Wm27ANrjYwZerRrTqNAR2MetSj8hot8DXwnxVJ04wri/mJrgoi3UtLTCl8vfuD9V8d VGDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716466487; x=1717071287; h=mime-version:message-id:date:user-agent:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=CFQCYo2y0ZA9NUm9ELgCxM2ohtnHg9OffQ9IEHTb5Bs=; b=N1UbkhJF7eE8GVYPht3A2rdWe4umUbQYobQ1KiwAZedVFXFTI4oIDfsU8tEUdtu5Xt terquRWBYAgLp+Z7W64lknNW2EaLs6e8RQhVldiX7Az9Asm88Tm86/tbEym9N7ZjbXeq oZNi23Jcunxra3LHmhepjSnD2/3eDxYJ3RT3zsKPUqvch3ykavhBD6BBt/y1hnNIGFr7 d2psT6PI6ooGPn7SjXnlXlrfI7kP+CEZNYBYYpBNZ40qHe59g15t7XAmOTgozBCnXBqN 6NTjGDpOr7kSrGa55c63y/W1/MeqSZftuhHowG1vF4/d6dn8Nw9fGq73AALK3fHQz7nW 105g== X-Gm-Message-State: AOJu0YylmCE3oXYbnvQG7u+8R68PGasR0sw7RcoQN2oEVlBbCFDJuqIp uWAK9/GinN1/CdsweQioq29b4B51MqbTcj+SoEHjLDeB9lNEN6v91mYwoYtvyU4= X-Google-Smtp-Source: AGHT+IFLnkHV1zs8FNGRd1Bp1ytv0+/3h2Ghjx/+8dcVNdON0I0jhyaPlidGUe9crA7GkgLUSfZjaQ== X-Received: by 2002:a17:902:f68e:b0:1f2:f842:491c with SMTP id d9443c01a7336-1f31c9f6852mr57376445ad.57.1716466487430; Thu, 23 May 2024 05:14:47 -0700 (PDT) Received: from localhost ([2804:14d:7e39:8470:245a:d549:be9f:ab33]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f33b4e46edsm12782415ad.271.2024.05.23.05.14.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 May 2024 05:14:46 -0700 (PDT) From: Thiago Jung Bauermann To: Luis Machado Cc: gdb-patches@sourceware.org, Christophe Lyon , Guinevere Larsen , Pedro Alves Subject: Re: [PATCH v4 2/3] gdb/aarch64: Add record support for MOPS instructions. In-Reply-To: <06075509-52da-4698-8426-53177fbe7c4c@arm.com> (Luis Machado's message of "Thu, 23 May 2024 12:42:48 +0100") References: <20240523035124.2639220-1-thiago.bauermann@linaro.org> <20240523035124.2639220-3-thiago.bauermann@linaro.org> <06075509-52da-4698-8426-53177fbe7c4c@arm.com> User-Agent: mu4e 1.12.4; emacs 29.3 Date: Thu, 23 May 2024 09:14:43 -0300 Message-ID: <87fru8sp1o.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Luis Machado writes: > On 5/23/24 04:51, Thiago Jung Bauermann wrote: >> +/* Record handler for Memory Copy and Memory Set instructions. */ >> + >> +static unsigned int >> +aarch64_record_memcopy_memset (aarch64_insn_decode_record *aarch64_insn_r) >> +{ >> + if (record_debug) >> + debug_printf ("Process record: memory copy and memory set\n"); >> + >> + uint8_t op1 = bits (aarch64_insn_r->aarch64_insn, 22, 23); >> + uint8_t op2 = bits (aarch64_insn_r->aarch64_insn, 12, 15); >> + uint32_t reg_rd = bits (aarch64_insn_r->aarch64_insn, 0, 4); >> + uint32_t reg_rn = bits (aarch64_insn_r->aarch64_insn, 5, 9); >> + uint32_t record_buf[3]; >> + uint64_t record_buf_mem[4]; >> + >> + if (op1 == 3 && op2 > 11) >> + /* Unallocated instructions. */ >> + return AARCH64_RECORD_UNKNOWN; >> + >> + /* Set instructions have two registers and one memory region to be >> + recorded. */ >> + record_buf[0] = reg_rd; >> + record_buf[1] = reg_rn; >> + aarch64_insn_r->reg_rec_count = 2; >> + >> + ULONGEST dest_addr; >> + regcache_raw_read_unsigned (aarch64_insn_r->regcache, reg_rd, &dest_addr); >> + >> + LONGEST length; >> + regcache_raw_read_signed (aarch64_insn_r->regcache, reg_rn, &length); >> + >> + /* In one ofthe algorithm options a processor can implement, the length > > s/ofthe/of the Thanks, fixed locally. >> + in Rn has an inverted sign. */ >> + if (length < 0) >> + length *= -1; >> + >> + record_buf_mem[0] = length; >> + record_buf_mem[1] = dest_addr; >> + aarch64_insn_r->mem_rec_count = 1; >> + >> + if (op1 != 3) >> + { >> + /* Copy instructions have an additional register and an additional >> + memory region to be recorded. */ >> + uint32_t reg_rs = bits (aarch64_insn_r->aarch64_insn, 16, 20); >> + >> + record_buf[2] = reg_rs; >> + aarch64_insn_r->reg_rec_count++; >> + >> + ULONGEST source_addr; >> + regcache_raw_read_unsigned (aarch64_insn_r->regcache, reg_rs, >> + &source_addr); >> + >> + record_buf_mem[2] = length; >> + record_buf_mem[3] = source_addr; >> + aarch64_insn_r->mem_rec_count++; >> + } >> + >> + MEM_ALLOC (aarch64_insn_r->aarch64_mems, aarch64_insn_r->mem_rec_count, >> + record_buf_mem); >> + REG_ALLOC (aarch64_insn_r->aarch64_regs, aarch64_insn_r->reg_rec_count, >> + record_buf); >> + return AARCH64_RECORD_SUCCESS; >> +} >> + > > Overall looks OK code-wise. I need to put together a newer VM with a compiler that > supports > MOPS instructions. Bear with me while I set that up and give these tests a go. Of course. Thanks for testing! -- Thiago