From 081058572de4f2c063bfbe76017134a9d8fd9907 Mon Sep 17 00:00:00 2001 From: Pedro Alves <palves@redhat.com> Date: Mon, 8 Mar 2010 19:28:27 +0000 Subject: * solib.c (solib_find): Replace extension if solib_symbols_extension is set in the target gdbarch. * arm-symbian-tdep.c (arm_symbian_init_abi): Set solib_symbols_extension to "sym". * gdbarch.sh (solib_symbols_extension): New variable. (pstring): New function. * gdbarch.h, gdbarch.c: Regenerate. --- gdb/gdbarch.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'gdb/gdbarch.c') diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index f482572cfe8..9aa6111c6f3 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -77,6 +77,14 @@ pformat (const struct floatformat **format) return format[0]->name; } +static const char * +pstring (const char *string) +{ + if (string == NULL) + return "(null)"; + return string; +} + /* Maintain the struct gdbarch object */ @@ -255,6 +263,7 @@ struct gdbarch const char * qsupported; gdbarch_auto_charset_ftype *auto_charset; gdbarch_auto_wide_charset_ftype *auto_wide_charset; + const char * solib_symbols_extension; }; @@ -401,6 +410,7 @@ struct gdbarch startup_gdbarch = 0, /* qsupported */ default_auto_charset, /* auto_charset */ default_auto_wide_charset, /* auto_wide_charset */ + 0, /* solib_symbols_extension */ /* startup_gdbarch() */ }; @@ -1147,6 +1157,9 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) fprintf_unfiltered (file, "gdbarch_dump: sofun_address_maybe_missing = %s\n", plongest (gdbarch->sofun_address_maybe_missing)); + fprintf_unfiltered (file, + "gdbarch_dump: solib_symbols_extension = %s\n", + pstring (gdbarch->solib_symbols_extension)); fprintf_unfiltered (file, "gdbarch_dump: sp_regnum = %s\n", plongest (gdbarch->sp_regnum)); @@ -3647,6 +3660,22 @@ set_gdbarch_auto_wide_charset (struct gdbarch *gdbarch, gdbarch->auto_wide_charset = auto_wide_charset; } +const char * +gdbarch_solib_symbols_extension (struct gdbarch *gdbarch) +{ + gdb_assert (gdbarch != NULL); + if (gdbarch_debug >= 2) + fprintf_unfiltered (gdb_stdlog, "gdbarch_solib_symbols_extension called\n"); + return gdbarch->solib_symbols_extension; +} + +void +set_gdbarch_solib_symbols_extension (struct gdbarch *gdbarch, + const char * solib_symbols_extension) +{ + gdbarch->solib_symbols_extension = solib_symbols_extension; +} + /* Keep a registry of per-architecture data-pointers required by GDB modules. */ -- cgit v1.2.1