ci: use new panic expect script in trace and BRBE test configs

The newly introduced panic expect script was used in trace and
BRBE extension test configurations to verify the panic occurs
when accessing registers that correspond to these extensions
from lower ELs.
These changes have been made as a effect of this patch [1]/

Also, refactored the code to move duplicated code into the
common header.

[1]: https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/18002

Change-Id: I70d2b45397e2011b68f9f5a5040c12c173fa6838
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
diff --git a/expect/crash_test.exp b/expect/crash_test.exp
index a8c31be..1efd5a4 100644
--- a/expect/crash_test.exp
+++ b/expect/crash_test.exp
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2019-2022 Arm Limited. All rights reserved.
+# Copyright (c) 2019-2023 Arm Limited. All rights reserved.
 #
 # SPDX-License-Identifier: BSD-3-Clause
 #
@@ -10,83 +10,5 @@
 
 expect_string "Unhandled External Abort received"
 expect_string "Unhandled Exception from EL2"
-expect_string "x0"
-expect_string "x1"
-expect_string "x2"
-expect_string "x3"
-expect_string "x4"
-expect_string "x5"
-expect_string "x6"
-expect_string "x7"
-expect_string "x8"
-expect_string "x9"
-expect_string "x10"
-expect_string "x11"
-expect_string "x12"
-expect_string "x13"
-expect_string "x14"
-expect_string "x15"
-expect_string "x16"
-expect_string "x17"
-expect_string "x18"
-expect_string "x19"
-expect_string "x20"
-expect_string "x21"
-expect_string "x22"
-expect_string "x23"
-expect_string "x24"
-expect_string "x25"
-expect_string "x26"
-expect_string "x27"
-expect_string "x28"
-expect_string "x29"
-expect_string "x30"
-expect_string "scr_el3"
-expect_string "sctlr_el3"
-expect_string "cptr_el3"
-expect_string "tcr_el3"
-expect_string "daif"
-expect_string "mair_el3"
-expect_string "spsr_el3"
-expect_string "elr_el3"
-expect_string "ttbr0_el3"
-expect_string "esr_el3"
-expect_string "far_el3"
-expect_string "spsr_el1"
-expect_string "elr_el1"
-expect_string "spsr_abt"
-expect_string "spsr_und"
-expect_string "spsr_irq"
-expect_string "spsr_fiq"
-expect_string "sctlr_el1"
-expect_string "actlr_el1"
-expect_string "cpacr_el1"
-expect_string "csselr_el1"
-expect_string "sp_el1"
-expect_string "esr_el1"
-expect_string "ttbr0_el1"
-expect_string "ttbr1_el1"
-expect_string "mair_el1"
-expect_string "amair_el1"
-expect_string "tcr_el1"
-expect_string "tpidr_el1"
-expect_string "tpidr_el0"
-expect_string "tpidrro_el0"
-expect_string "par_el1"
-expect_string "mpidr_el1"
-expect_string "afsr0_el1"
-expect_string "afsr1_el1"
-expect_string "contextidr_el1"
-expect_string "vbar_el1"
-expect_string "cntp_ctl_el0"
-expect_string "cntp_cval_el0"
-expect_string "cntv_ctl_el0"
-expect_string "cntv_cval_el0"
-expect_string "cntkctl_el1"
-expect_string "sp_el0"
-expect_string "isr_el1"
-expect_string "dacr32_el2"
-expect_string "ifsr32_el2"
-expect_string "icc_hppir0_el1"
-expect_string "icc_hppir1_el1"
-expect_string "icc_ctlr_el3"
+
+source [file join [file dirname [info script]] exception_regs.inc]