qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH for-7.1 2/5] target/loongarch: add gdb_arch_name()


From: Richard Henderson
Subject: Re: [PATCH for-7.1 2/5] target/loongarch: add gdb_arch_name()
Date: Thu, 4 Aug 2022 09:02:08 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0

On 8/4/22 06:02, Song Gao wrote:
LoongArch gdb_arch_name() is "Loongarch64", Dump from GDB.

GNU gdb (GDB) 13.0.50.20220519-git
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "loongarch64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
     <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) show architecture
The target architecture is set to "auto" (currently "Loongarch64").
(gdb)

Signed-off-by: Song Gao <gaosong@loongson.cn>

Matches bfd/cpu-loongarch.c, bfd_loongarch_arch.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

---
  target/loongarch/cpu.c | 6 ++++++
  1 file changed, 6 insertions(+)

diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c
index d84ec38cf7..94d5617639 100644
--- a/target/loongarch/cpu.c
+++ b/target/loongarch/cpu.c
@@ -661,6 +661,11 @@ static const struct SysemuCPUOps loongarch_sysemu_ops = {
  };
  #endif
+static gchar *loongarch_gdb_arch_name(CPUState *cs)
+{
+    return g_strdup("Loongarch64");
+}
+
  static void loongarch_cpu_class_init(ObjectClass *c, void *data)
  {
      LoongArchCPUClass *lacc = LOONGARCH_CPU_CLASS(c);
@@ -686,6 +691,7 @@ static void loongarch_cpu_class_init(ObjectClass *c, void 
*data)
      cc->gdb_num_core_regs = 35;
      cc->gdb_core_xml_file = "loongarch-base64.xml";
      cc->gdb_stop_before_watchpoint = true;
+    cc->gdb_arch_name = loongarch_gdb_arch_name;
#ifdef CONFIG_TCG
      cc->tcg_ops = &loongarch_tcg_ops;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]