From fd04f5cc265e20901cad75b29ca22b211f13ff8b Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Sun, 8 Jul 2012 10:50:46 -0400 Subject: [PATCH 1/9] Fix image deletion events. - Due to (most likely) a copy/paste error, image deletion events were mistakenly being sent to the userland debugger as creation events. --- src/system/kernel/debug/user_debugger.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/system/kernel/debug/user_debugger.cpp b/src/system/kernel/debug/user_debugger.cpp index ebb173673e..1f0e1ce26c 100644 --- a/src/system/kernel/debug/user_debugger.cpp +++ b/src/system/kernel/debug/user_debugger.cpp @@ -1231,7 +1231,7 @@ user_debug_image_deleted(const image_info *imageInfo) message.image_event = atomic_add(&thread->team->debug_info.image_event, 1) + 1; - thread_hit_debug_event(B_DEBUGGER_MESSAGE_IMAGE_CREATED, &message, + thread_hit_debug_event(B_DEBUGGER_MESSAGE_IMAGE_DELETED, &message, sizeof(message), true); } From 8522ef247b89a52a01ddde1813911eb63108e7d9 Mon Sep 17 00:00:00 2001 From: Adam Hartford Date: Mon, 18 Jun 2012 23:35:10 +0000 Subject: [PATCH 2/9] Fixed minor UI issues in Screenshot (Ticket #8378) Signed-off-by: Alex Wilson --- src/apps/screenshot/Jamfile | 1 - src/apps/screenshot/PreviewView.cpp | 30 ------------------------ src/apps/screenshot/PreviewView.h | 21 ----------------- src/apps/screenshot/ScreenshotWindow.cpp | 8 ++++--- src/apps/screenshot/ScreenshotWindow.h | 3 +-- 5 files changed, 6 insertions(+), 57 deletions(-) delete mode 100644 src/apps/screenshot/PreviewView.cpp delete mode 100644 src/apps/screenshot/PreviewView.h diff --git a/src/apps/screenshot/Jamfile b/src/apps/screenshot/Jamfile index 32ccccd9fe..182e475ec2 100644 --- a/src/apps/screenshot/Jamfile +++ b/src/apps/screenshot/Jamfile @@ -7,7 +7,6 @@ UsePrivateHeaders interface ; Application Screenshot : ScreenshotApp.cpp ScreenshotWindow.cpp - PreviewView.cpp Utility.cpp : be $(HAIKU_LOCALE_LIBS) tracker translation $(TARGET_LIBSUPC++) : ScreenshotApp.rdef diff --git a/src/apps/screenshot/PreviewView.cpp b/src/apps/screenshot/PreviewView.cpp deleted file mode 100644 index 8bedac23df..0000000000 --- a/src/apps/screenshot/PreviewView.cpp +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2009, Philippe Saint-Pierre, stpere@gmail.com - * Distributed under the terms of the MIT License. - */ - -#include "PreviewView.h" - - -#include - - -PreviewView::PreviewView() - : - BView("preview", B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE) -{ -} - - -PreviewView::~PreviewView() -{ -} - - -void -PreviewView::Draw(BRect updateRect) -{ - BRect rect = Frame(); - be_control_look->DrawTextControlBorder(this, rect, rect, - ui_color(B_PANEL_BACKGROUND_COLOR)); -} diff --git a/src/apps/screenshot/PreviewView.h b/src/apps/screenshot/PreviewView.h deleted file mode 100644 index de34d089be..0000000000 --- a/src/apps/screenshot/PreviewView.h +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2009, Philippe Saint-Pierre, stpere@gmail.com - * Distributed under the terms of the MIT License. - */ -#ifndef PREVIEW_VIEW_H -#define PREVIEW_VIEW_H - - -#include - - -class PreviewView : public BView { -public: - PreviewView(); - ~PreviewView(); - -protected: - virtual void Draw(BRect updateRect); -}; - -#endif /* PREVIEW_VIEW_H */ diff --git a/src/apps/screenshot/ScreenshotWindow.cpp b/src/apps/screenshot/ScreenshotWindow.cpp index eea254ffdd..f3bee39381 100644 --- a/src/apps/screenshot/ScreenshotWindow.cpp +++ b/src/apps/screenshot/ScreenshotWindow.cpp @@ -41,7 +41,6 @@ #include #include -#include "PreviewView.h" #include "Utility.h" @@ -174,11 +173,13 @@ ScreenshotWindow::ScreenshotWindow(const Utility& utility, bool silent, BMenuField* menuLocation = new BMenuField(B_TRANSLATE("Save in:"), fOutputPathMenu); + menuLocation->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); fTranslatorMenu = new BMenu(B_TRANSLATE("Please select")); _SetupTranslatorMenu(); BMenuField* menuFormat = new BMenuField(B_TRANSLATE("Save as:"), fTranslatorMenu); + menuFormat->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); BButton* showSettings = new BButton("", B_TRANSLATE("Settings"B_UTF8_ELLIPSIS), new BMessage(kSettings)); @@ -193,12 +194,13 @@ ScreenshotWindow::ScreenshotWindow(const Utility& utility, bool silent, const float kSpacing = be_control_look->DefaultItemSpacing(); const float kLabelSpacing = be_control_look->DefaultLabelSpacing(); - fPreview = new PreviewView(); + fPreview = new BView("preview", B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE); + BBox *previewBox = new BBox(B_FANCY_BORDER, fPreview); BLayoutBuilder::Group<>(this, B_VERTICAL, 0) .SetInsets(kSpacing) .AddGroup(B_HORIZONTAL, kSpacing) - .Add(fPreview) + .Add(previewBox) .AddGroup(B_VERTICAL, 0) .Add(fActiveWindow) .Add(fWindowBorder) diff --git a/src/apps/screenshot/ScreenshotWindow.h b/src/apps/screenshot/ScreenshotWindow.h index 4b24c1f0c0..036a9b4380 100644 --- a/src/apps/screenshot/ScreenshotWindow.h +++ b/src/apps/screenshot/ScreenshotWindow.h @@ -26,7 +26,6 @@ class BPath; class BTextControl; class BTextView; -class PreviewView; class Utility; @@ -58,7 +57,7 @@ private: const Utility& fUtility; - PreviewView* fPreview; + BView* fPreview; BCheckBox* fActiveWindow; BTextControl* fDelayControl; BCheckBox* fWindowBorder; From 72cee743c2dc402e9e91893e1b59c5b32a21a12d Mon Sep 17 00:00:00 2001 From: Alex Wilson Date: Mon, 9 Jul 2012 11:25:59 +1200 Subject: [PATCH 3/9] Adapt LookTest to BMenuField API changes. Fixes #6648 --- src/tests/kits/interface/look/Look.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tests/kits/interface/look/Look.cpp b/src/tests/kits/interface/look/Look.cpp index f6c66a2160..4e4f311871 100644 --- a/src/tests/kits/interface/look/Look.cpp +++ b/src/tests/kits/interface/look/Look.cpp @@ -71,9 +71,9 @@ void add_menu_fields(BGridLayout* layout, int32& row) { BPopUpMenu* menu1 = new BPopUpMenu("Selection"); - BMenuField* control1 = new BMenuField("Enabled", menu1, NULL); + BMenuField* control1 = new BMenuField("Enabled", menu1); BPopUpMenu* menu2 = new BPopUpMenu("Selection"); - BMenuField* control2 = new BMenuField("Disabled", menu2, NULL); + BMenuField* control2 = new BMenuField("Disabled", menu2); control2->SetEnabled(false); #if USE_LAYOUT_ITEMS From fbd52296f33708bd923ba1625845fa4e4a79964e Mon Sep 17 00:00:00 2001 From: Matt Madia Date: Sun, 8 Jul 2012 20:04:18 +0000 Subject: [PATCH 4/9] Consolidate baseURL variables. No functional change. --- build/jam/OptionalBuildFeatures | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/build/jam/OptionalBuildFeatures b/build/jam/OptionalBuildFeatures index c29c74feed..8e4fc879d2 100644 --- a/build/jam/OptionalBuildFeatures +++ b/build/jam/OptionalBuildFeatures @@ -3,6 +3,9 @@ # likely the same file use for an optional package. +local baseURL = http://www.haiku-files.org/files/optional-packages ; + + # SSL # Automatically enable the SSL feature, when the optional OpenSSL optional @@ -17,7 +20,6 @@ if $(HAIKU_GCC_VERSION[1]) >= 4 { HAIKU_OPENSSL_PACKAGE = openssl-1.0.0j-x86-gcc2-2012-06-19.zip ; } -local baseURL = http://haiku-files.org/files/optional-packages ; HAIKU_OPENSSL_URL = $(baseURL)/$(HAIKU_OPENSSL_PACKAGE) ; if $(HAIKU_BUILD_FEATURE_SSL) { @@ -135,7 +137,7 @@ if [ IsOptionalHaikuImagePackageAdded CLucene ] { HAIKU_BUILD_FEATURE_CLUCENE = 1 ; } -local baseURL = http://haiku-files.org/files/optional-packages ; + HAIKU_CLUCENE_PACKAGE = clucene-0.9.21-x86-gcc4-haiku-2009-08-11.zip ; HAIKU_CLUCENE_URL = $(baseURL)/$(HAIKU_CLUCENE_PACKAGE) ; @@ -171,7 +173,6 @@ if $(HAIKU_BUILD_FEATURE_CLUCENE) { # Mesa -local mesaBaseURL = http://haiku-files.org/files/optional-packages ; if $(TARGET_ARCH) = x86 { local glslObject ; local galliumObjects ; @@ -186,7 +187,7 @@ if $(TARGET_ARCH) = x86 { } zipFile = [ DownloadFile $(HAIKU_MESA_FILE) - : $(mesaBaseURL)/$(HAIKU_MESA_FILE) ] ; + : $(baseURL)/$(HAIKU_MESA_FILE) ] ; HAIKU_MESA_DIR = [ FDirName $(HAIKU_OPTIONAL_BUILD_PACKAGES_DIR) $(HAIKU_MESA_FILE:B) ] ; @@ -197,7 +198,7 @@ if $(TARGET_ARCH) = x86 { HAIKU_MESA_LIBS = [ ExtractArchive $(HAIKU_MESA_DIR) : lib.haiku/libglu.a - $(galliumObjects) + $(galliumObjects) lib.haiku/libglapi.a $(glslObject) lib.haiku/libmesa.a @@ -212,7 +213,7 @@ if $(TARGET_ARCH) = x86 { # FFmpeg -local ffmpegBaseURL = http://haiku-files.org/files/optional-packages/lib ; +local ffmpegBaseURL = $(baseURL)/lib ; if $(TARGET_ARCH) = x86 { if $(HAIKU_GCC_VERSION[1]) >= 4 { HAIKU_FFMPEG_FILE = ffmpeg-0.10.2-x86-gcc4-2012-03-28.zip ; @@ -334,7 +335,7 @@ if $(TARGET_ARCH) = x86 { # Freetype -local freetypeBaseURL = http://haiku-files.org/files/optional-packages/lib ; +local freetypeBaseURL = $(baseURL)/lib ; if $(TARGET_ARCH) = ppc || $(TARGET_ARCH) = x86 { if $(TARGET_ARCH) = ppc { HAIKU_FREETYPE_FILE = freetype-2.4.9-ppc-gcc4-2012-06-26.zip ; @@ -384,7 +385,6 @@ if [ IsOptionalHaikuImagePackageAdded TagLib ] { HAIKU_BUILD_FEATURE_TAGLIB = 1 ; } -local baseURL = http://haiku-files.org/files/optional-packages ; HAIKU_TAGLIB_PACKAGE = taglib-1.6.3-r1a3-x86-gcc2-2011-05-20.zip ; HAIKU_TAGLIB_URL = $(baseURL)/$(HAIKU_TAGLIB_PACKAGE) ; @@ -421,7 +421,6 @@ if $(HAIKU_BUILD_FEATURE_TAGLIB) { # WebKit -local webkitBaseURL = http://haiku-files.org/files/optional-packages ; if $(TARGET_ARCH) = x86 { if $(HAIKU_GCC_VERSION[1]) < 4 { Echo "WebKit support not available on gcc $(HAIKU_GCC_VERSION[1])" ; @@ -429,7 +428,7 @@ if $(TARGET_ARCH) = x86 { HAIKU_WEBKIT_FILE = webkit-0.1.1-x86-gcc4-2012-07-03.zip ; local zipFile = [ DownloadFile $(HAIKU_WEBKIT_FILE) - : $(webkitBaseURL)/$(HAIKU_WEBKIT_FILE) ] ; + : $(baseURL)/$(HAIKU_WEBKIT_FILE) ] ; HAIKU_WEBKIT_DIR = [ FDirName $(HAIKU_OPTIONAL_BUILD_PACKAGES_DIR) $(HAIKU_WEBKIT_FILE:B) ] ; From 7101dd4b29e3b2732e4852af6b14b2fa9d08f5be Mon Sep 17 00:00:00 2001 From: Matt Madia Date: Sun, 8 Jul 2012 20:12:07 +0000 Subject: [PATCH 5/9] Whitespace cleanup. No functional change. --- build/jam/OptionalBuildFeatures | 37 ++++++++++++++++----------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/build/jam/OptionalBuildFeatures b/build/jam/OptionalBuildFeatures index 8e4fc879d2..17bf69868d 100644 --- a/build/jam/OptionalBuildFeatures +++ b/build/jam/OptionalBuildFeatures @@ -421,33 +421,32 @@ if $(HAIKU_BUILD_FEATURE_TAGLIB) { # WebKit +HAIKU_WEBKIT_FILE = webkit-0.1.1-x86-gcc4-2012-07-03.zip ; if $(TARGET_ARCH) = x86 { if $(HAIKU_GCC_VERSION[1]) < 4 { Echo "WebKit support not available on gcc $(HAIKU_GCC_VERSION[1])" ; } else { - HAIKU_WEBKIT_FILE = webkit-0.1.1-x86-gcc4-2012-07-03.zip ; + local zipFile = [ DownloadFile $(HAIKU_WEBKIT_FILE) + : $(baseURL)/$(HAIKU_WEBKIT_FILE) ] ; - local zipFile = [ DownloadFile $(HAIKU_WEBKIT_FILE) - : $(baseURL)/$(HAIKU_WEBKIT_FILE) ] ; + HAIKU_WEBKIT_DIR = [ FDirName $(HAIKU_OPTIONAL_BUILD_PACKAGES_DIR) + $(HAIKU_WEBKIT_FILE:B) ] ; - HAIKU_WEBKIT_DIR = [ FDirName $(HAIKU_OPTIONAL_BUILD_PACKAGES_DIR) - $(HAIKU_WEBKIT_FILE:B) ] ; + HAIKU_WEBKIT_HEADERS_DEPENDENCY = [ ExtractArchive $(HAIKU_WEBKIT_DIR) + : include/ : $(zipFile) : extracted-webkit ] ; - HAIKU_WEBKIT_HEADERS_DEPENDENCY = [ ExtractArchive $(HAIKU_WEBKIT_DIR) - : include/ : $(zipFile) : extracted-webkit ] ; + HAIKU_WEBKIT_LIBS = [ ExtractArchive $(HAIKU_WEBKIT_DIR) + : + lib/libwtf.so + lib/libjavascriptcore.so + lib/libwebcore.so + lib/libwebkit.so + : $(zipFile) + : extracted-webkit + ] ; - HAIKU_WEBKIT_LIBS = [ ExtractArchive $(HAIKU_WEBKIT_DIR) - : - lib/libwtf.so - lib/libjavascriptcore.so - lib/libwebcore.so - lib/libwebkit.so - : $(zipFile) - : extracted-webkit - ] ; - - HAIKU_WEBKIT_HEADERS = [ FDirName $(HAIKU_WEBKIT_DIR) include ] ; - } + HAIKU_WEBKIT_HEADERS = [ FDirName $(HAIKU_WEBKIT_DIR) include ] ; + } } else { Echo "WebKit support not available on $(TARGET_ARCH)" ; } From f4eb5cf7e18054ccddc100e43116db37c5227392 Mon Sep 17 00:00:00 2001 From: Matt Madia Date: Mon, 9 Jul 2012 20:38:20 +0000 Subject: [PATCH 6/9] Process the sub-jam's opt packages before OptionalBuildFeatures Several build features (including a future patch for WebKit) are enabled only if a respective optional package is added. Prior to this, none of those build features could be activated in a sub-jam process. --- Jamfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Jamfile b/Jamfile index 39bfc85ef9..929c395efa 100644 --- a/Jamfile +++ b/Jamfile @@ -128,15 +128,15 @@ Depends LocaleKit : LocaleKitTests ; -# Prepare the optional build features before parsing the Jamfile tree. -include [ FDirName $(HAIKU_BUILD_RULES_DIR) OptionalBuildFeatures ] ; - # Add optional packages given via HAIKU_ADD_OPTIONAL_PACKAGES. if $(HAIKU_ADD_OPTIONAL_PACKAGES) { AddOptionalHaikuImagePackages [ FSplitString $(HAIKU_ADD_OPTIONAL_PACKAGES) : / ] ; } +# Prepare the optional build features before parsing the Jamfile tree. +include [ FDirName $(HAIKU_BUILD_RULES_DIR) OptionalBuildFeatures ] ; + # Include packages that are required by all images. AddOptionalHaikuImagePackages MandatoryPackages ; From 0962132cc60f7f93c696c16776f50ee66e4c65f7 Mon Sep 17 00:00:00 2001 From: Alex Smith Date: Tue, 10 Jul 2012 19:33:39 +0100 Subject: [PATCH 7/9] Fixed Mac OS X 10.7 as a build platform (for GCC 4). * Use gcc and g++ rather than cc and c++, as the latter now point to clang with recent Xcode versions and compilation of the host tools fail for various reasons with it. * Replace the case-sensitive filesystem check with a more basic one, as diskutil no longer supports the behaviour of getting info for the volume that any path is on. * Updated ReadMe with a correct list of prerequisites for OS X. * GCC 2 builds are still broken due to a strange error that only occurs with a GCC 2 built on OS X 10.7 --- ReadMe | 7 +++++++ build/jam/BuildSetup | 7 +++++++ configure | 19 +++++++++++-------- 3 files changed, 25 insertions(+), 8 deletions(-) diff --git a/ReadMe b/ReadMe index 70ad15ed56..77ec0e9211 100644 --- a/ReadMe +++ b/ReadMe @@ -75,6 +75,13 @@ The following darwin ports need to be installed: * libiconv * gnuregex * gsed + * cdrtools + * yasm + * wget + * less + * mpfr + * gmp + * libmpc More information about individual distributions of Linux and BSD can be found at http://haiku-os.org/guides/building/pre-reqs diff --git a/build/jam/BuildSetup b/build/jam/BuildSetup index dd4a91d91e..87129f467d 100644 --- a/build/jam/BuildSetup +++ b/build/jam/BuildSetup @@ -609,6 +609,13 @@ if $(HOST_PLATFORM) = linux || $(HOST_PLATFORM) = freebsd } } +# On recent versions of OS X cc and c++ point to clang, which fails to +# compile some of the host tools. As a workaround, force use of GCC. +if $(HOST_PLATFORM) = darwin { + HOST_CC = gcc ; + HOST_C++ = g++ ; +} + if $(HOST_PLATFORM) = cygwin { HOST_LINKFLAGS += -Xlinker --allow-multiple-definition -Xlinker --enable-auto-import ; diff --git a/configure b/configure index 9d6ca5a3da..39d894c3d1 100755 --- a/configure +++ b/configure @@ -471,15 +471,18 @@ for sfdiskDir in /sbin /usr/sbin /usr/local/sbin ; do fi done -# check for case-sensitive filesystem if on darwin -if [ $HOST_PLATFORM = "darwin" ]; then - diskutil info $(pwd)/.. | grep -i "case-sensitive" > /dev/null - if [ $? != 0 ]; then - echo "You need a case-sensitive file-system to build Haiku." - echo "Please see the following guide on how to set one up:" - echo "http://haiku-os.org/documents/dev/how_to_build_haiku_on_mac_os_x" - exit 1 +# check for case-sensitive filesystem +mkdir haikuCaseTest 2>/dev/null +mkdir haikucasetest 2>/dev/null +caseInsensitive=$? +rm -df haikuCaseTest haikucasetest +if [ $caseInsensitive != 0 ]; then + echo "You need a case-sensitive file-system to build Haiku." + if [ $HOST_PLATFORM = "darwin" ]; then + echo "You can create a case-sensitive disk image using Disk Utility and use" + echo "it to store the Haiku sources on." fi + exit 1 fi # create output directory From 36c85ca8df5a43d6e716579099c25018e41bedf8 Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Tue, 10 Jul 2012 18:35:28 -0400 Subject: [PATCH 8/9] Fix add-on image unloading for shelf replicants (ticket #8708). - The version of instantiate_object() that returns the image id from which the object was reinstantiated was not correctly returning it in all circumstances, only if it had to find/load the add-on itself. This caused problems for BShelf since the latter relies on that image id in order to determine what image to unload when replicants are removed. To remedy this, introduce an additional version of find_instantiation_func() that returns the image id in which the instantiation function was found, and make use of it in instantiate_object() in order to also be able to return the image id in that case. --- src/kits/support/Archivable.cpp | 111 +++++++++++++++++++------------- 1 file changed, 66 insertions(+), 45 deletions(-) diff --git a/src/kits/support/Archivable.cpp b/src/kits/support/Archivable.cpp index 2bcb5156b9..3761040208 100644 --- a/src/kits/support/Archivable.cpp +++ b/src/kits/support/Archivable.cpp @@ -1,8 +1,9 @@ /* - * Copyright (c) 2001-2010, Haiku, Inc. + * Copyright (c) 2001-2012, Haiku, Inc. * Distributed under the terms of the MIT License. * * Authors: + * Rene Gollent (rene@gollent.com) * Erik Jaesler (erik@cgsoftware.com) * Alex Wilson (yourpalal2@gmail.com) */ @@ -236,6 +237,67 @@ check_signature(const char* signature, image_info& info) } +namespace BPrivate +{ + + +instantiation_func +find_instantiation_func(const char* className, const char* signature, + image_id* id) +{ + if (className == NULL) { + errno = B_BAD_VALUE; + return NULL; + } + + thread_info threadInfo; + status_t err = get_thread_info(find_thread(NULL), &threadInfo); + if (err != B_OK) { + errno = err; + return NULL; + } + + instantiation_func instantiationFunc = NULL; + image_info imageInfo; + + BString name = className; + for (int32 pass = 0; pass < 2; pass++) { + BString funcName; + build_function_name(name, funcName); + + // for each image_id in team_id + int32 cookie = 0; + while (instantiationFunc == NULL + && get_next_image_info(threadInfo.team, &cookie, &imageInfo) + == B_OK) { + instantiationFunc = find_function_in_image(funcName, imageInfo.id, + err); + } + if (instantiationFunc != NULL) { + // if requested, save the image id in + // which the function was found + if (id != NULL) + *id = imageInfo.id; + break; + } + + // Check if we have a private class, and add the BPrivate namespace + // (for backwards compatibility) + if (!add_private_namespace(name)) + break; + } + + if (instantiationFunc != NULL + && check_signature(signature, imageInfo) != B_OK) + return NULL; + + return instantiationFunc; +} + + +} + + // #pragma mark - @@ -597,8 +659,8 @@ instantiate_object(BMessage* archive, image_id* _id) const char* signature = NULL; bool hasSignature = archive->FindString(B_ADD_ON_FIELD, &signature) == B_OK; - instantiation_func instantiationFunc = find_instantiation_func(className, - signature); + instantiation_func instantiationFunc = BPrivate::find_instantiation_func( + className, signature, _id); // if find_instantiation_func() can't locate Class::Instantiate() // and a signature was specified @@ -714,48 +776,7 @@ validate_instantiation(BMessage* from, const char* className) instantiation_func find_instantiation_func(const char* className, const char* signature) { - if (className == NULL) { - errno = B_BAD_VALUE; - return NULL; - } - - thread_info threadInfo; - status_t err = get_thread_info(find_thread(NULL), &threadInfo); - if (err != B_OK) { - errno = err; - return NULL; - } - - instantiation_func instantiationFunc = NULL; - image_info imageInfo; - - BString name = className; - for (int32 pass = 0; pass < 2; pass++) { - BString funcName; - build_function_name(name, funcName); - - // for each image_id in team_id - int32 cookie = 0; - while (instantiationFunc == NULL - && get_next_image_info(threadInfo.team, &cookie, &imageInfo) - == B_OK) { - instantiationFunc = find_function_in_image(funcName, imageInfo.id, - err); - } - if (instantiationFunc != NULL) - break; - - // Check if we have a private class, and add the BPrivate namespace - // (for backwards compatibility) - if (!add_private_namespace(name)) - break; - } - - if (instantiationFunc != NULL - && check_signature(signature, imageInfo) != B_OK) - return NULL; - - return instantiationFunc; + return BPrivate::find_instantiation_func(className, signature, NULL); } From 369149622268fa194fc43e15b4f6889db15949c6 Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Tue, 10 Jul 2012 22:06:01 -0400 Subject: [PATCH 9/9] Fix #8709. - The buffer that the debugger used to retrieve messages from the debug port was slightly too small for the largest of the message data structs (currently 1100 bytes), causing some types of debug events to get truncated. This resulted in image creation/deletion events being received with a truncated image_info struct, which would result in several fields being returned with random values, most notably the text/data base and size fields. Consequently, searching those images for an address within them would fail, leading to #8709. It's possible but not yet confirmed that this bug is also responsible for #8710, need to test further. --- src/apps/debugger/debugger_interface/DebuggerInterface.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/apps/debugger/debugger_interface/DebuggerInterface.cpp b/src/apps/debugger/debugger_interface/DebuggerInterface.cpp index c98ca870d0..a1c9a05d62 100644 --- a/src/apps/debugger/debugger_interface/DebuggerInterface.cpp +++ b/src/apps/debugger/debugger_interface/DebuggerInterface.cpp @@ -312,7 +312,7 @@ status_t DebuggerInterface::GetNextDebugEvent(DebugEvent*& _event) { while (true) { - char buffer[1024]; + char buffer[2048]; int32 messageCode; ssize_t size = read_port(fDebuggerPort, &messageCode, buffer, sizeof(buffer)); @@ -324,7 +324,7 @@ DebuggerInterface::GetNextDebugEvent(DebugEvent*& _event) } if (messageCode <= B_DEBUGGER_MESSAGE_HANDED_OVER) { - debug_debugger_message_data message; + debug_debugger_message_data message; memcpy(&message, buffer, size); if (message.origin.team != fTeamID) continue;