Skip to content
Snippets Groups Projects
Commit fa0826a1 authored by Avi Kivity's avatar Avi Kivity
Browse files

elf: store object list in an area easily accessible to the debugger

Since we're loading many objects, we need to make them accessible to the
debugger so it can load symbol tables.
parent a2090eee
No related branches found
No related tags found
No related merge requests found
......@@ -564,6 +564,7 @@ namespace elf {
_files[name] = ef;
ef->load_segments();
_next_alloc = ef->end();
add_debugger_obj(ef);
ef->load_needed();
ef->relocate();
ef->run_init_func();
......@@ -571,6 +572,17 @@ namespace elf {
return _files[name];
}
elf_object* program::s_objs[100];
void program::add_debugger_obj(elf_object* obj)
{
auto p = s_objs;
while (*p) {
++p;
}
*p = obj;
}
symbol_module program::lookup(const char* name)
{
// FIXME: correct lookup order?
......
......@@ -330,12 +330,15 @@ namespace elf {
// run a function with all current modules as a parameter
void with_modules(std::function<void (std::vector<elf_object*>&)> f);
private:
void add_debugger_obj(elf_object* obj);
void* do_lookup_function(const char* symbol);
private:
::filesystem& _fs;
void* _next_alloc;
std::unique_ptr<elf_object> _core;
std::map<std::string, elf_object*> _files;
// debugger interface
static elf_object* s_objs[100];
};
program* get_program();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment