Received: by 10.213.65.68 with SMTP id h4csp1359516imn; Mon, 26 Mar 2018 06:08:30 -0700 (PDT) X-Google-Smtp-Source: AG47ELt5mOlAQ0796y6Cs63kQ6FJz2x0Ha0ig+E9GY64o0s6lrjzryoWN0Ovk1JHLJxJEtPY7yhv X-Received: by 2002:a17:902:5066:: with SMTP id f35-v6mr40846448plh.14.1522069710248; Mon, 26 Mar 2018 06:08:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522069710; cv=none; d=google.com; s=arc-20160816; b=e3p1YU816Qu53M9wS95OGX6UoZaysA9lp8cyz2wvmI2SjUST1hCY6/4KF/UiWsZ2XV 81opiyAev7lhxwuk/LzqFuRrjDuJX/tI4smm4pvxQyAPJSXLpUiOw22yOmx3u4+8FF4Y JWvwEhxJYRpTATnp4NGRDDsAP3e9FLDL+EU/iczetSbYR0sm4Tlv59QHS50yD3hjkx0h yleXNCjUp+J4zPrYd1e6aj7URVawjXnTS/e9eBX412NhksRP3d0XqjHIt67m9DMyC6ty YR0IZTbKMMQzl15mFiZnLShP1voPQUjCdfmGoFhHyRjyri2kHzTcNAvaUm/gg98DCXJl BX1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=CfPB0BAeq3BwW0A0LykaB3awTn1nDntUAwUSIPlRHF8=; b=hF44PB//PMxyRcjjC5eYNaWGMA65QiMxRMf2XRjIAyU8RSI2XMs1imE9GexNURcDgB Rk93azSyLaawSx5x9BjquoJg22HrPVfpL7UNdTTlwVlOa5bUMAVh0gC0hHC0VhYfXi5Z GUzdDBixZ6l7fknvwWeY68BDmV3fs4Rdo8mxzyHdyS62igk5qqbXOqif9qQ1LWlAqkh3 2yvdoUfGTp/amLVuGUOgPERccxAuTy1eCBDDeZKlF9xckl5jwWzoS/zVYEenJwh2G8PD mBvbPA22m82sUs4ro9lUeaH2CbSHQr9tC6jfj0hG1KTU9vhlLiD5JuZguM5P4kXfyR31 bq3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=CTOt49qp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p13-v6si900305plo.150.2018.03.26.06.08.09; Mon, 26 Mar 2018 06:08:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=CTOt49qp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752004AbeCZNGY (ORCPT + 99 others); Mon, 26 Mar 2018 09:06:24 -0400 Received: from mail-qk0-f193.google.com ([209.85.220.193]:33923 "EHLO mail-qk0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751132AbeCZNGW (ORCPT ); Mon, 26 Mar 2018 09:06:22 -0400 Received: by mail-qk0-f193.google.com with SMTP id z184so19960206qkc.1; Mon, 26 Mar 2018 06:06:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=CfPB0BAeq3BwW0A0LykaB3awTn1nDntUAwUSIPlRHF8=; b=CTOt49qp1eG7wS59OtZbEFN3jOtFEqlt8pT5zbrhkkvwlxftqRJ6uaQj9GpQz0HM6F S6J3ZaVOSbFbqlbKoHkJ/Pf4v0lPvwEr9Ah3i73wcmS3ALluu1arYWGPWYIdD2pbkLlB mW0LhnlYjFlHWquBZMtif339Bd8yU3x+tcef0OJ7Wvi5IIueQzJIGe0q0NpIPaTpFJuf 3TrRbSGSnpi26A6pwsqxuZKlmbtf6xbdedtggeAvvrtMvhhXpFmCC9JtFF6g6APovTdM JOV59etLvspXpKubwT/U4IMMXaLsqI+SUb0Ae2g2VKj7GpgZ5FL2By5L2yR++EN03Dh6 gp2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=CfPB0BAeq3BwW0A0LykaB3awTn1nDntUAwUSIPlRHF8=; b=LlA1afefw9OXnDST0D+MxhJ+0QHIrJF4ZlSvYGl6wjFIKXL+MwtH2BaRTfV6C2PRbY VunppWkJvHeDKoV8TMY/JmYAF0IpttrfCyS/39bqpWLFjn14/ei31Qntm5qV+zbDnUDC AI2h7a6xeXqWF9uTJBOK9UFrMuT0YhqHLB4fFBS6yEjrIAVR1B7IgwUoNn4kO2hdUoNT gdOlqSe7TrugvjV317HeHqBgBgbivzITbWZm8n0bpoDidNqyX/j8/yikaAODDx9bmAmp fJRAeTgw6Mh3csdGSFzV/hzfaNzA7KFLTOiq6T+DksGcE5esFfwhIZ7dudciNe/a3mEn CS2Q== X-Gm-Message-State: AElRT7EBpHHNT2Lzq54/gW/x2guooNh/xNybJPm4HhkaNH1v/+72qWvK S+YW9A4NjVzyWofc0pq2e2ctgUqX2DBVEY/pqjg= X-Received: by 10.55.56.211 with SMTP id f202mr20633845qka.288.1522069581959; Mon, 26 Mar 2018 06:06:21 -0700 (PDT) MIME-Version: 1.0 Received: by 10.12.185.25 with HTTP; Mon, 26 Mar 2018 06:06:21 -0700 (PDT) In-Reply-To: <31d854396de0d279cdd3bc621806362e79cca60e.1521399976.git.ren_guo@c-sky.com> References: <31d854396de0d279cdd3bc621806362e79cca60e.1521399976.git.ren_guo@c-sky.com> From: Arnd Bergmann Date: Mon, 26 Mar 2018 15:06:21 +0200 X-Google-Sender-Auth: e1oYj5F9MPVVvGRbT-6HkQWBU5w Message-ID: Subject: Re: [PATCH 12/19] csky: Debug and Ptrace GDB To: Guo Ren Cc: linux-arch , Linux Kernel Mailing List , Thomas Gleixner , Daniel Lezcano , Jason Cooper , c-sky_gcc_upstream@c-sky.com, gnu-csky@mentor.com, thomas.petazzoni@bootlin.com, wbx@uclibc-ng.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Mar 18, 2018 at 8:51 PM, Guo Ren wrote: > Signed-off-by: Guo Ren > + */ > +long arch_ptrace(struct task_struct *child, long request, unsigned long addr, > + unsigned long data) > +{ > + unsigned long tmp = 0, ret = 0; > + int i; > + > + switch (request) { > + /* read the word at location addr in the USER area. */ > + case PTRACE_PEEKUSR: > + > + case PTRACE_POKEUSR: /* write the word at location addr in the USER area */ > + case PTRACE_GETREGS: /* Get all gp regs from the child. */ > + case PTRACE_SETREGS: /* Set all gp regs in the child. */ > + for (i = 0; i <= CSKY_GREG_NUM; i++) { > + ret = get_user(tmp, (unsigned long *)data); I think all of these should use the regset code like arch/riscv/kernel/ptrace.c does. Arnd