7 /*#include "libbfd.h" /* BFD internals (sigh!) FIXME */
8 #include "xcoffsolib.h"
11 extern struct symtab
*current_source_symtab
;
12 extern int current_source_line
;
15 /* The real work of adding a shared library file to the symtab and
19 solib_add (arg_string
, from_tty
, target
)
22 struct target_ops
*target
;
25 struct vmap
*vp
= vmap
;
27 struct symtab
*saved_symtab
;
30 int loaded
= 0; /* true if any shared obj loaded */
31 int matched
= 0; /* true if any shared obj matched */
35 else if (val
= (char *) re_comp (arg_string
)) {
36 error ("Invalid regexp: %s", val
);
41 /* save current symbol table and line number, in case they get changed
42 in symbol loading process. */
44 saved_symtab
= current_source_symtab
;
45 saved_line
= current_source_line
;
47 /* skip over the first vmap, it is the main program, always loaded. */
50 for (; vp
; vp
= vp
->nxt
) {
52 if (re_exec (vp
->name
) || (*vp
->member
&& re_exec (vp
->member
))) {
56 /* if already loaded, continue with the next one. */
59 printf ("%s%s%s%s: already loaded.\n",
60 *vp
->member
? "(" : "",
62 *vp
->member
? ") " : "",
67 printf ("Loading %s%s%s%s...",
68 *vp
->member
? "(" : "",
70 *vp
->member
? ") " : "",
74 obj
= lookup_objfile_bfd (vp
->bfd
);
76 warning ("\nObj structure for the shared object not found. Loading failed.");
80 syms_from_objfile (obj
, 0, 0, 0);
81 new_symfile_objfile (obj
, 0, 0);
82 vmap_symtab (vp
, 0, 0);
84 loaded
= vp
->loaded
= 1;
87 /* if any shared object is loaded, then misc_func_vector needs sorting. */
90 sort_misc_function_vector ();
92 current_source_symtab
= saved_symtab
;
93 current_source_line
= saved_line
;
95 /* Getting new symbols might change our opinion about what is frameless.
96 Is this correct?? FIXME. */
97 /* reinit_frame_cache(); */
100 printf ("No matching shared object found.\n");
105 /* Return the module name of a given text address. Note that returned buffer
106 is not persistent. */
109 pc_load_segment_name (addr
)
112 static char buffer
[BUFSIZ
];
113 struct vmap
*vp
= vmap
;
115 buffer
[0] = buffer
[1] = '\0';
116 for (; vp
; vp
= vp
->nxt
)
117 if (vp
->tstart
<= addr
&& addr
< vp
->tend
) {
120 strcat (&buffer
[1], vp
->member
);
121 strcat (buffer
, ")");
123 strcat (buffer
, vp
->name
);
126 return "(unknown load module)";
131 register struct ld_info
*ldi
;
134 struct vmap
*vp
= vmap
;
136 if (!vp
|| !vp
->nxt
) {
137 printf("No shared libraries loaded at this time.\n");
141 /* skip over the first vmap, it is the main program, always loaded. */
145 Text Range Data Range Syms Shared Object Library\n");
147 for (; vp
; vp
= vp
->nxt
) {
149 printf ("0x%08x-0x%08x 0x%08x-0x%08x %s %s%s%s%s\n",
150 vp
->tstart
, vp
->tend
,
151 vp
->dstart
, vp
->dend
,
152 vp
->loaded
? "Yes" : "No ",
153 *vp
->member
? "(" : "",
155 *vp
->member
? ") " : "",
162 sharedlibrary_command (args
, from_tty
)
167 solib_add (args
, from_tty
, (struct target_ops
*)0);
174 add_com("sharedlibrary", class_files
, sharedlibrary_command
,
175 "Load shared object library symbols for files matching REGEXP.");
176 add_info("sharedlibrary", solib_info
,
177 "Status of loaded shared object libraries");
This page took 0.03435 seconds and 4 git commands to generate.