Added debugger notifications when images are registered/unregistered.

In the first case this is probably too early, since the image is not
really loaded at that time by the loader. We should probably introduce
a syscall the loader can invoke for that purpose.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11475 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2005-02-24 16:10:24 +00:00
parent e988d66022
commit 43ad09219b

View File

@ -12,6 +12,7 @@
#include <lock.h>
#include <thread.h>
#include <team.h>
#include <user_debugger.h>
#include <malloc.h>
#include <string.h>
@ -58,6 +59,13 @@ register_image(struct team *team, image_info *_info, size_t size)
mutex_unlock(&sImageMutex);
// notify the debugger
_info->id = id;
user_debug_image_created(_info);
// ToDo: Is this too early? Not even the loader knows about the
// image (ID) yet. We should probably introduce another syscall, the
// loader can invoke just before calling the image's init function.
TRACE(("register_image(team = %p, image id = %ld, image = %p\n", team, id, image));
return id;
}
@ -77,7 +85,6 @@ unregister_image(struct team *team, image_id id)
while ((image = list_get_next_item(&team->image_list, image)) != NULL) {
if (image->info.id == id) {
list_remove_link(image);
free(image);
status = B_OK;
break;
}
@ -85,6 +92,13 @@ unregister_image(struct team *team, image_id id)
mutex_unlock(&sImageMutex);
if (status == B_OK) {
// notify the debugger
user_debug_image_deleted(&image->info);
free(image);
}
return status;
}