summaryrefslogtreecommitdiff
path: root/gdb/solib.c
diff options
context:
space:
mode:
authorPedro Alves <pedro@codesourcery.com>2010-03-08 19:28:26 +0000
committerPedro Alves <pedro@codesourcery.com>2010-03-08 19:28:26 +0000
commit7a7e6e90398199ebe92dd5b3e329980ef23d56ad (patch)
tree284bf62a9d55b107911a0066d9c17646e341a44e /gdb/solib.c
parente266e1b82fd14d9e2f73fd2351a342bed03ce3f5 (diff)
downloadgdb-7a7e6e90398199ebe92dd5b3e329980ef23d56ad.tar.gz
* 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.
Diffstat (limited to 'gdb/solib.c')
-rw-r--r--gdb/solib.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/gdb/solib.c b/gdb/solib.c
index 842b27c3c21..40a7a1ca62f 100644
--- a/gdb/solib.c
+++ b/gdb/solib.c
@@ -150,6 +150,30 @@ solib_find (char *in_pathname, int *fd)
int found_file = -1;
char *temp_pathname = NULL;
int gdb_sysroot_is_empty;
+ const char *solib_symbols_extension
+ = gdbarch_solib_symbols_extension (target_gdbarch);
+
+ /* If solib_symbols_extension is set, replace the file's
+ extension. */
+ if (solib_symbols_extension)
+ {
+ char *p = in_pathname + strlen (in_pathname);
+ while (p > in_pathname && *p != '.')
+ p--;
+
+ if (*p == '.')
+ {
+ char *new_pathname;
+
+ new_pathname = alloca (p - in_pathname + 1
+ + strlen (solib_symbols_extension) + 1);
+ memcpy (new_pathname, in_pathname, p - in_pathname + 1);
+ strcpy (new_pathname + (p - in_pathname) + 1,
+ solib_symbols_extension);
+
+ in_pathname = new_pathname;
+ }
+ }
gdb_sysroot_is_empty = (gdb_sysroot == NULL || *gdb_sysroot == 0);