diff --git a/src/apps/debugger/user_interface/util/UiUtils.cpp b/src/apps/debugger/user_interface/util/UiUtils.cpp index 4c955c40af..539e069926 100644 --- a/src/apps/debugger/user_interface/util/UiUtils.cpp +++ b/src/apps/debugger/user_interface/util/UiUtils.cpp @@ -109,3 +109,28 @@ UiUtils::FunctionNameForFrame(StackFrame* frame, char* buffer, return buffer; } + + +/*static*/ const char* +UiUtils::ImageTypeToString(image_type type, char* buffer, size_t bufferSize) +{ + switch (type) { + case B_APP_IMAGE: + snprintf(buffer, bufferSize, "Application"); + break; + case B_LIBRARY_IMAGE: + snprintf(buffer, bufferSize, "Library"); + break; + case B_ADD_ON_IMAGE: + snprintf(buffer, bufferSize, "Add-on"); + break; + case B_SYSTEM_IMAGE: + snprintf(buffer, bufferSize, "System"); + break; + default: + snprintf(buffer, bufferSize, "Unknown"); + break; + } + + return buffer; +} diff --git a/src/apps/debugger/user_interface/util/UiUtils.h b/src/apps/debugger/user_interface/util/UiUtils.h index 8ac0743816..4415754e35 100644 --- a/src/apps/debugger/user_interface/util/UiUtils.h +++ b/src/apps/debugger/user_interface/util/UiUtils.h @@ -7,11 +7,11 @@ #include - -class StackFrame; +#include class BVariant; +class StackFrame; class UiUtils { @@ -23,6 +23,8 @@ public: char* buffer, size_t bufferSize); static const char* FunctionNameForFrame(StackFrame* frame, char* buffer, size_t bufferSize); + static const char* ImageTypeToString(image_type type, + char* buffer, size_t bufferSize); };