gdbstub.c (690bd97b5b18b9198300e09a55ff980ab57ba665) | gdbstub.c (ac1e86710000ba3cf2e80836fb3f66ba12b169b8) |
---|---|
1/* 2 * ARM gdb server stub 3 * 4 * Copyright (c) 2003-2005 Fabrice Bellard 5 * Copyright (c) 2013 SUSE LINUX Products GmbH 6 * 7 * This library is free software; you can redistribute it and/or 8 * modify it under the terms of the GNU Lesser General Public --- 469 unchanged lines hidden (view full) --- 478 479 if (arm_feature(env, ARM_FEATURE_AARCH64)) { 480 /* 481 * The lower part of each SVE register aliases to the FPU 482 * registers so we don't need to include both. 483 */ 484#ifdef TARGET_AARCH64 485 if (isar_feature_aa64_sve(&cpu->isar)) { | 1/* 2 * ARM gdb server stub 3 * 4 * Copyright (c) 2003-2005 Fabrice Bellard 5 * Copyright (c) 2013 SUSE LINUX Products GmbH 6 * 7 * This library is free software; you can redistribute it and/or 8 * modify it under the terms of the GNU Lesser General Public --- 469 unchanged lines hidden (view full) --- 478 479 if (arm_feature(env, ARM_FEATURE_AARCH64)) { 480 /* 481 * The lower part of each SVE register aliases to the FPU 482 * registers so we don't need to include both. 483 */ 484#ifdef TARGET_AARCH64 485 if (isar_feature_aa64_sve(&cpu->isar)) { |
486 int nreg = arm_gen_dynamic_svereg_feature(cs, cs->gdb_num_regs)->num_regs; | 486 GDBFeature *feature = arm_gen_dynamic_svereg_feature(cs, cs->gdb_num_regs); |
487 gdb_register_coprocessor(cs, aarch64_gdb_get_sve_reg, | 487 gdb_register_coprocessor(cs, aarch64_gdb_get_sve_reg, |
488 aarch64_gdb_set_sve_reg, nreg, 489 "sve-registers.xml", 0); | 488 aarch64_gdb_set_sve_reg, feature, 0); |
490 } else { 491 gdb_register_coprocessor(cs, aarch64_gdb_get_fpu_reg, 492 aarch64_gdb_set_fpu_reg, | 489 } else { 490 gdb_register_coprocessor(cs, aarch64_gdb_get_fpu_reg, 491 aarch64_gdb_set_fpu_reg, |
493 34, "aarch64-fpu.xml", 0); | 492 gdb_find_static_feature("aarch64-fpu.xml"), 493 0); |
494 } 495 /* 496 * Note that we report pauth information via the feature name 497 * org.gnu.gdb.aarch64.pauth_v2, not org.gnu.gdb.aarch64.pauth. 498 * GDB versions 9 through 12 have a bug where they will crash 499 * if they see the latter XML from QEMU. 500 */ 501 if (isar_feature_aa64_pauth(&cpu->isar)) { 502 gdb_register_coprocessor(cs, aarch64_gdb_get_pauth_reg, 503 aarch64_gdb_set_pauth_reg, | 494 } 495 /* 496 * Note that we report pauth information via the feature name 497 * org.gnu.gdb.aarch64.pauth_v2, not org.gnu.gdb.aarch64.pauth. 498 * GDB versions 9 through 12 have a bug where they will crash 499 * if they see the latter XML from QEMU. 500 */ 501 if (isar_feature_aa64_pauth(&cpu->isar)) { 502 gdb_register_coprocessor(cs, aarch64_gdb_get_pauth_reg, 503 aarch64_gdb_set_pauth_reg, |
504 4, "aarch64-pauth.xml", 0); | 504 gdb_find_static_feature("aarch64-pauth.xml"), 505 0); |
505 } 506#endif 507 } else { 508 if (arm_feature(env, ARM_FEATURE_NEON)) { 509 gdb_register_coprocessor(cs, vfp_gdb_get_reg, vfp_gdb_set_reg, | 506 } 507#endif 508 } else { 509 if (arm_feature(env, ARM_FEATURE_NEON)) { 510 gdb_register_coprocessor(cs, vfp_gdb_get_reg, vfp_gdb_set_reg, |
510 49, "arm-neon.xml", 0); | 511 gdb_find_static_feature("arm-neon.xml"), 512 0); |
511 } else if (cpu_isar_feature(aa32_simd_r32, cpu)) { 512 gdb_register_coprocessor(cs, vfp_gdb_get_reg, vfp_gdb_set_reg, | 513 } else if (cpu_isar_feature(aa32_simd_r32, cpu)) { 514 gdb_register_coprocessor(cs, vfp_gdb_get_reg, vfp_gdb_set_reg, |
513 33, "arm-vfp3.xml", 0); | 515 gdb_find_static_feature("arm-vfp3.xml"), 516 0); |
514 } else if (cpu_isar_feature(aa32_vfp_simd, cpu)) { 515 gdb_register_coprocessor(cs, vfp_gdb_get_reg, vfp_gdb_set_reg, | 517 } else if (cpu_isar_feature(aa32_vfp_simd, cpu)) { 518 gdb_register_coprocessor(cs, vfp_gdb_get_reg, vfp_gdb_set_reg, |
516 17, "arm-vfp.xml", 0); | 519 gdb_find_static_feature("arm-vfp.xml"), 0); |
517 } 518 if (!arm_feature(env, ARM_FEATURE_M)) { 519 /* 520 * A and R profile have FP sysregs FPEXC and FPSID that we 521 * expose to gdb. 522 */ 523 gdb_register_coprocessor(cs, vfp_gdb_get_sysreg, vfp_gdb_set_sysreg, | 520 } 521 if (!arm_feature(env, ARM_FEATURE_M)) { 522 /* 523 * A and R profile have FP sysregs FPEXC and FPSID that we 524 * expose to gdb. 525 */ 526 gdb_register_coprocessor(cs, vfp_gdb_get_sysreg, vfp_gdb_set_sysreg, |
524 2, "arm-vfp-sysregs.xml", 0); | 527 gdb_find_static_feature("arm-vfp-sysregs.xml"), 528 0); |
525 } 526 } 527 if (cpu_isar_feature(aa32_mve, cpu) && tcg_enabled()) { 528 gdb_register_coprocessor(cs, mve_gdb_get_reg, mve_gdb_set_reg, | 529 } 530 } 531 if (cpu_isar_feature(aa32_mve, cpu) && tcg_enabled()) { 532 gdb_register_coprocessor(cs, mve_gdb_get_reg, mve_gdb_set_reg, |
529 1, "arm-m-profile-mve.xml", 0); | 533 gdb_find_static_feature("arm-m-profile-mve.xml"), 534 0); |
530 } 531 gdb_register_coprocessor(cs, arm_gdb_get_sysreg, arm_gdb_set_sysreg, | 535 } 536 gdb_register_coprocessor(cs, arm_gdb_get_sysreg, arm_gdb_set_sysreg, |
532 arm_gen_dynamic_sysreg_feature(cs, cs->gdb_num_regs)->num_regs, 533 "system-registers.xml", 0); | 537 arm_gen_dynamic_sysreg_feature(cs, cs->gdb_num_regs), 538 0); |
534 535#ifdef CONFIG_TCG 536 if (arm_feature(env, ARM_FEATURE_M) && tcg_enabled()) { 537 gdb_register_coprocessor(cs, 538 arm_gdb_get_m_systemreg, arm_gdb_set_m_systemreg, | 539 540#ifdef CONFIG_TCG 541 if (arm_feature(env, ARM_FEATURE_M) && tcg_enabled()) { 542 gdb_register_coprocessor(cs, 543 arm_gdb_get_m_systemreg, arm_gdb_set_m_systemreg, |
539 arm_gen_dynamic_m_systemreg_feature(cs, cs->gdb_num_regs)->num_regs, 540 "arm-m-system.xml", 0); | 544 arm_gen_dynamic_m_systemreg_feature(cs, cs->gdb_num_regs), 0); |
541#ifndef CONFIG_USER_ONLY 542 if (arm_feature(env, ARM_FEATURE_M_SECURITY)) { 543 gdb_register_coprocessor(cs, 544 arm_gdb_get_m_secextreg, arm_gdb_set_m_secextreg, | 545#ifndef CONFIG_USER_ONLY 546 if (arm_feature(env, ARM_FEATURE_M_SECURITY)) { 547 gdb_register_coprocessor(cs, 548 arm_gdb_get_m_secextreg, arm_gdb_set_m_secextreg, |
545 arm_gen_dynamic_m_secextreg_feature(cs, cs->gdb_num_regs)->num_regs, 546 "arm-m-secext.xml", 0); | 549 arm_gen_dynamic_m_secextreg_feature(cs, cs->gdb_num_regs), 0); |
547 } 548#endif 549 } 550#endif /* CONFIG_TCG */ 551} | 550 } 551#endif 552 } 553#endif /* CONFIG_TCG */ 554} |