From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x641.google.com (mail-ej1-x641.google.com [IPv6:2a00:1450:4864:20::641]) by sourceware.org (Postfix) with ESMTPS id A63593857C7F for ; Tue, 29 Sep 2020 15:42:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org A63593857C7F Received: by mail-ej1-x641.google.com with SMTP id gr14so15732186ejb.1 for ; Tue, 29 Sep 2020 08:42:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-description:content-disposition:in-reply-to; bh=+uefmLbsKtasJlwGBQKWTWhxR568tsAMlq+EyloBYkQ=; b=kosDuMvnIfuygFo04n94qLfbwkWXtSsH2mNcjqTn60AlafURmy6z9kGjT/ANjm1tjl kW2qcHUhOHaOYSOxes6fztY3E4khHds7pWiU1DEn5UTnBjOWo/yZrrdY4x4ZzoWOuqSs 9kMS8buu9HcTyZq3SzS/WUpVAF6LYEyNEV6RJkz4ySBsXoC3TX9QRJQD6/ZwY4HP8AF5 MTVXjpMQ5cMwuJDiZlyuNW3oM3rUWMd31dY7aqizZ02odoTmU4nFakel5965SKHKlIQa 8aBxGRTvQFULVTQ2N+yIxwlSt/D/HP0wNTyXtA+8xOBO8vQlpwRCZaY4HL3ihFJZXj3f 031A== X-Gm-Message-State: AOAM5336/+ZOLnbliCom+meNlw86LX6H687UD1Ngb3tr7Bd3bazeJ45B bWmIblJSPcT+magY4NqRuTU= X-Google-Smtp-Source: ABdhPJyEonYnsfRMNrm4x+sVB6fLGDLGG1f2OXfdwFay7HfZI9HYHY/ZLoiCU9QMFJDmTXhm4xQgeg== X-Received: by 2002:a17:906:1fc8:: with SMTP id e8mr2327526ejt.280.1601394137760; Tue, 29 Sep 2020 08:42:17 -0700 (PDT) Received: from gmail.com ([2a03:1b20:3:f011::6d]) by smtp.gmail.com with ESMTPSA id t24sm1664701edc.40.2020.09.29.08.42.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Sep 2020 08:42:16 -0700 (PDT) Date: Tue, 29 Sep 2020 17:42:20 +0200 From: Shahab Vahedi To: Simon Marchi Cc: "Aktemur, Tankut Baris" , "gdb-patches@sourceware.org" , Anton Kolesov , Shahab Vahedi , Francois Bedard Subject: Re: [PATCH] arc: Add support for Linux coredump files Message-ID: <20200929154220.GD4717@gmail.com> References: <20200827112728.4275-1-shahab.vahedi@gmail.com> <18b98a56-e3cf-e05b-49a7-bd6e1f61aefb@simark.ca> <20200928134714.GA4717@gmail.com> <20200929082456.GB4717@gmail.com> <81e2fb09-4d5f-a274-8986-2726a45d4290@simark.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Description: this_read_memory Content-Disposition: inline In-Reply-To: <81e2fb09-4d5f-a274-8986-2726a45d4290@simark.ca> X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, 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-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Sep 2020 15:42:19 -0000 Hi Simon, First, thank you a lot for such explanatory answer. On Tue, Sep 29, 2020 at 10:22:18AM -0400, Simon Marchi wrote: > target_read_memory calls read_inferior_memory, which calls the target's > read_memory method, and then puts back in place the instructions > shadowed by breakpoints and fast tracepoint jumps inserted by GDBserver > in place. This is so that the memory returned to the caller (and > possibly to GDB) contains the contents it expects to see. I repeat the code snippet here: ---- bool arc_target::low_breakpoint_at (CORE_ADDR where) { uint16_t insn; uint16_t breakpoint = ntohs (TRAP_S_1_OPCODE); target_read_memory (where, (gdb_byte *) &insn, TRAP_S_1_SIZE); return (insn == breakpoint); } ---- Because this memory access is indeed to check for a "breakpoint", then I should NOT be using breakpoint-undoing edition. Therefore, I will use "this->read_memory (...)". Cheers, Shahab