Index: gdb/solib-svr4.c |
diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c |
index 69d3cb518e14eee51fad17885292f81a1ef5e692..269f463de38e6165f0cb22ee36e1a3027b3affee 100644 |
--- a/gdb/solib-svr4.c |
+++ b/gdb/solib-svr4.c |
@@ -50,6 +50,8 @@ |
static struct link_map_offsets *svr4_fetch_link_map_offsets (void); |
static int svr4_have_link_map_offsets (void); |
static void svr4_relocate_main_executable (void); |
+static char* svr4_map_so_name(char *name); |
eaeltsin
2012/05/22 13:07:20
style:
char *svr4_map
halyavin
2012/05/22 13:19:37
Done.
|
+static int svr4_have_map_so_name (void); |
/* Link map info to include in an allocated so_list entry. */ |
@@ -1227,7 +1229,15 @@ svr4_read_so_list (CORE_ADDR lm, struct so_list ***link_ptr_ptr, |
continue; |
} |
- strncpy (new->so_name, buffer, SO_NAME_MAX_PATH_SIZE - 1); |
+ if (svr4_have_map_so_name ()) |
+ { |
+ strncpy (new->so_name, svr4_map_so_name (buffer), |
+ SO_NAME_MAX_PATH_SIZE - 1); |
+ } |
+ else |
+ { |
+ strncpy (new->so_name, buffer, SO_NAME_MAX_PATH_SIZE - 1); |
+ } |
new->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0'; |
strcpy (new->so_original_name, new->so_name); |
xfree (buffer); |
@@ -2318,6 +2328,7 @@ struct solib_svr4_ops |
{ |
/* Return a description of the layout of `struct link_map'. */ |
struct link_map_offsets *(*fetch_link_map_offsets)(void); |
+ char *(*map_so_name)(char*); |
eaeltsin
2012/05/22 13:07:20
Please add a comment.
halyavin
2012/05/22 13:19:37
Done.
|
}; |
/* Return a default for the architecture-specific operations. */ |
@@ -2329,6 +2340,7 @@ solib_svr4_init (struct obstack *obstack) |
ops = OBSTACK_ZALLOC (obstack, struct solib_svr4_ops); |
ops->fetch_link_map_offsets = NULL; |
+ ops->map_so_name = NULL; |
return ops; |
} |
@@ -2346,6 +2358,15 @@ set_solib_svr4_fetch_link_map_offsets (struct gdbarch *gdbarch, |
set_solib_ops (gdbarch, &svr4_so_ops); |
} |
eaeltsin
2012/05/22 13:07:20
Please add a function comment.
halyavin
2012/05/22 13:19:37
Done.
|
+void |
+set_solib_svr4_map_so_name(struct gdbarch *gdbarch, |
+ const char* (*map_so_name) (char*)) |
+{ |
+ struct solib_svr4_ops *ops = gdbarch_data (gdbarch, solib_svr4_data); |
+ |
+ ops->map_so_name = map_so_name; |
+} |
+ |
/* Fetch a link_map_offsets structure using the architecture-specific |
`struct link_map_offsets' fetcher. */ |
@@ -2367,6 +2388,21 @@ svr4_have_link_map_offsets (void) |
return (ops->fetch_link_map_offsets != NULL); |
} |
+ |
eaeltsin
2012/05/22 13:07:20
Please add a function comment.
halyavin
2012/05/22 13:19:37
Done.
|
+static char * |
+svr4_map_so_name(char *name) |
+{ |
+ struct solib_svr4_ops *ops = gdbarch_data (target_gdbarch, solib_svr4_data); |
+ gdb_assert (ops->map_so_name); |
+ return ops->map_so_name (name); |
+} |
+ |
eaeltsin
2012/05/22 13:07:20
Please add a function comment.
halyavin
2012/05/22 13:19:37
Done.
|
+static int |
+svr4_have_map_so_name(void) |
+{ |
+ struct solib_svr4_ops *ops = gdbarch_data (target_gdbarch, solib_svr4_data); |
+ return ops->map_so_name != NULL; |
eaeltsin
2012/05/22 13:07:20
style:
return (ops->map_so_name != NULL);
halyavin
2012/05/22 13:19:37
Done.
|
+} |
/* Most OS'es that have SVR4-style ELF dynamic libraries define a |