mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-26 17:18:55 +00:00
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
This commit is contained in:
@@ -44,7 +44,8 @@
|
||||
/* The canonical form of gdb_assert (0).
|
||||
MESSAGE is a string to include in the error message. */
|
||||
|
||||
#define gdb_assert_not_reached(message) \
|
||||
internal_error (__FILE__, __LINE__, "%s: %s", __func__, _(message))
|
||||
#define gdb_assert_not_reached(message, ...) \
|
||||
internal_error (__FILE__, __LINE__, _("%s: " message), __func__, \
|
||||
##__VA_ARGS__)
|
||||
|
||||
#endif /* COMMON_GDB_ASSERT_H */
|
||||
|
||||
Reference in New Issue
Block a user