public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Hui Li <lihui@loongson.cn>
To: gdb-patches@sourceware.org
Cc: Tiezhu Yang <yangtiezhu@loongson.cn>
Subject: [PATCH v2 0/2] gdb: LoongArch: Add support for hardware watchpoint & breakpoint
Date: Tue, 11 Jun 2024 19:21:24 +0800	[thread overview]
Message-ID: <20240611112126.4882-1-lihui@loongson.cn> (raw)

LoongArch defines hardware watchpoint functions for fetch and load/store
operations. After the software configures the watchpoints for fetch and
load/store, the processor hardware will monitor the access addresses of
the fetch and load/store operations and trigger a watchpoint exception
when the watchpoint setting conditions are met.

After this series, watch/rwatch/awatch/hbreak command are supported.

Refer to the following document for hardware watchpoint and breakpoint:
https://loongson.github.io/LoongArch-Documentation/LoongArch-Vol1-EN.html#control-and-status-registers-related-to-watchpoints

Changes v1 -> v2: 
- Fixed some code format.
- Use PLV3 privilege level in ctrl register to enable hardware breakpoint/watchpoint. 

Hui Li (2):
  gdb: LoongArch: Add support for hardware watchpoint
  gdb: LoongArch: Add support for hardware breakpoint

 gdb/Makefile.in                    |   3 +
 gdb/configure.nat                  |   4 +-
 gdb/loongarch-linux-nat.c          | 351 +++++++++++++++++++++++++++++
 gdb/loongarch-tdep.c               |   1 +
 gdb/nat/loongarch-hw-point.c       | 320 ++++++++++++++++++++++++++
 gdb/nat/loongarch-hw-point.h       | 103 +++++++++
 gdb/nat/loongarch-linux-hw-point.c | 252 +++++++++++++++++++++
 gdb/nat/loongarch-linux-hw-point.h | 126 +++++++++++
 gdb/nat/loongarch-linux.c          | 100 ++++++++
 gdb/nat/loongarch-linux.h          |  42 ++++
 include/elf/common.h               |   4 +
 11 files changed, 1305 insertions(+), 1 deletion(-)
 create mode 100644 gdb/nat/loongarch-hw-point.c
 create mode 100644 gdb/nat/loongarch-hw-point.h
 create mode 100644 gdb/nat/loongarch-linux-hw-point.c
 create mode 100644 gdb/nat/loongarch-linux-hw-point.h
 create mode 100644 gdb/nat/loongarch-linux.c
 create mode 100644 gdb/nat/loongarch-linux.h

-- 
2.38.1


             reply	other threads:[~2024-06-11 11:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-11 11:21 Hui Li [this message]
2024-06-11 11:21 ` [PATCH v2 1/2] gdb: LoongArch: Add support for hardware watchpoint Hui Li
2024-06-11 11:21 ` [PATCH v2 2/2] gdb: LoongArch: Add support for hardware breakpoint Hui Li
2024-06-24 21:55 ` [PATCH v2 0/2] gdb: LoongArch: Add support for hardware watchpoint & breakpoint Tiezhu Yang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240611112126.4882-1-lihui@loongson.cn \
    --to=lihui@loongson.cn \
    --cc=gdb-patches@sourceware.org \
    --cc=yangtiezhu@loongson.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).