From 557b4d7650ffa3cd6dbfb8a56c830a1d45562d19 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Wed, 17 Nov 2021 13:44:01 -0500 Subject: gdbsupport: make gdb_assert_not_reached accept a format string Change gdb_assert_not_reached to accept a format string plus corresponding arguments. This allows giving more precise messages. Because the format string passed by the caller is prepended with a "%s:" to add the function name, the callers can no longer pass a translated string (`_(...)`). Make the gdb_assert_not_reached include the _(), just like the gdb_assert_fail macro just above. Change-Id: Id0cfda5a57979df6cdaacaba0d55dd91ae9efee7 --- gdb/arch/arc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gdb/arch') diff --git a/gdb/arch/arc.c b/gdb/arch/arc.c index 813f4ea..f5d81b6 100644 --- a/gdb/arch/arc.c +++ b/gdb/arch/arc.c @@ -54,7 +54,7 @@ arc_create_target_description (const struct arc_arch_features &features) std::string msg = string_printf ("Cannot determine architecture: ISA=%d; bitness=%d", features.isa, 8 * features.reg_size); - gdb_assert_not_reached (msg.c_str ()); + gdb_assert_not_reached ("%s", msg.c_str ()); } set_tdesc_architecture (tdesc.get (), arch_name.c_str ()); @@ -75,7 +75,7 @@ arc_create_target_description (const struct arc_arch_features &features) default: std::string msg = string_printf ("Cannot choose target description XML: %d", features.isa); - gdb_assert_not_reached (msg.c_str ()); + gdb_assert_not_reached ("%s", msg.c_str ()); } return tdesc; -- cgit v1.1