From 43ad09219bdecf3cffd496989b047927dcacd1cf Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Thu, 24 Feb 2005 16:10:24 +0000 Subject: [PATCH] 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 --- src/kernel/core/image.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/kernel/core/image.c b/src/kernel/core/image.c index 8f491916e7..b1a09a8ec1 100644 --- a/src/kernel/core/image.c +++ b/src/kernel/core/image.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include @@ -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; }