2012-07-23 23:50:18 +02:00
|
|
|
/*
|
|
|
|
* Copyright 2012, Ingo Weinhold, ingo_weinhold@gmx.de.
|
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
|
|
|
#ifndef UI_UTILS_H
|
|
|
|
#define UI_UTILS_H
|
|
|
|
|
2012-11-17 17:57:02 -05:00
|
|
|
#include <size_t.h>
|
2012-07-23 23:50:18 +02:00
|
|
|
|
2012-11-22 10:56:26 -05:00
|
|
|
#include <image.h>
|
2012-11-17 17:57:02 -05:00
|
|
|
|
2012-12-18 21:32:04 -05:00
|
|
|
#include "Types.h"
|
|
|
|
|
2012-11-17 17:57:02 -05:00
|
|
|
|
2012-12-10 23:13:40 -05:00
|
|
|
class BString;
|
2012-11-17 17:57:02 -05:00
|
|
|
class BVariant;
|
2013-04-27 14:00:05 -04:00
|
|
|
class RangeList;
|
2012-11-22 10:56:26 -05:00
|
|
|
class StackFrame;
|
2012-11-22 23:41:11 -05:00
|
|
|
class Team;
|
2012-12-18 21:32:04 -05:00
|
|
|
class TeamMemoryBlock;
|
2012-12-10 23:13:40 -05:00
|
|
|
class ValueNodeChild;
|
2012-07-23 23:50:18 +02:00
|
|
|
|
2012-12-18 21:32:04 -05:00
|
|
|
|
2012-07-23 23:50:18 +02:00
|
|
|
class UiUtils {
|
|
|
|
public:
|
|
|
|
static const char* ThreadStateToString(int state,
|
|
|
|
int stoppedReason);
|
2012-11-17 17:57:02 -05:00
|
|
|
|
|
|
|
static const char* VariantToString(const BVariant& value,
|
|
|
|
char* buffer, size_t bufferSize);
|
|
|
|
static const char* FunctionNameForFrame(StackFrame* frame,
|
|
|
|
char* buffer, size_t bufferSize);
|
2012-11-22 10:56:26 -05:00
|
|
|
static const char* ImageTypeToString(image_type type,
|
|
|
|
char* buffer, size_t bufferSize);
|
2013-04-05 11:15:06 -04:00
|
|
|
static const char* AreaLockingFlagsToString(uint32 flags,
|
|
|
|
char* buffer, size_t bufferSize);
|
|
|
|
static const BString& AreaProtectionFlagsToString(uint32 protection,
|
|
|
|
BString& _output);
|
2012-11-22 23:41:11 -05:00
|
|
|
|
|
|
|
static const char* ReportNameForTeam(::Team* team,
|
|
|
|
char* buffer, size_t bufferSize);
|
2012-12-10 23:13:40 -05:00
|
|
|
|
|
|
|
// this function assumes the value nodes have already been resolved
|
|
|
|
// (if possible).
|
|
|
|
static void PrintValueNodeGraph(BString& _output,
|
|
|
|
ValueNodeChild* child,
|
|
|
|
int32 indentLevel, int32 maxDepth);
|
2012-12-18 21:32:04 -05:00
|
|
|
|
|
|
|
static void DumpMemory(BString& _output,
|
2012-12-18 23:30:18 -05:00
|
|
|
int32 indentLevel,
|
2012-12-18 21:32:04 -05:00
|
|
|
TeamMemoryBlock* block,
|
|
|
|
target_addr_t address, int32 itemSize,
|
|
|
|
int32 displayWidth, int32 count);
|
2013-04-27 14:00:05 -04:00
|
|
|
|
|
|
|
static status_t ParseRangeExpression(
|
|
|
|
const BString& rangeString,
|
|
|
|
int32 lowerBound, int32 upperBound,
|
2013-05-20 19:01:51 -04:00
|
|
|
bool fixedRange,
|
2013-04-27 14:00:05 -04:00
|
|
|
RangeList& _output);
|
2012-07-23 23:50:18 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif // UI_UTILS_H
|