diff options
author | Pedro Alves <palves@redhat.com> | 2010-03-08 19:28:27 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2010-03-08 19:28:27 +0000 |
commit | 081058572de4f2c063bfbe76017134a9d8fd9907 (patch) | |
tree | 696e5bf63f919faf20ad6e98c777394acb0f619f /gdb/solib.c | |
parent | 7c953934352840c28dcda0c8a6a18660aa1e3ab9 (diff) | |
download | gdb-081058572de4f2c063bfbe76017134a9d8fd9907.zip gdb-081058572de4f2c063bfbe76017134a9d8fd9907.tar.gz gdb-081058572de4f2c063bfbe76017134a9d8fd9907.tar.bz2 |
* 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.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/gdb/solib.c b/gdb/solib.c index 842b27c..40a7a1c 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); |