2012-07-23 23:50:18 +02:00
|
|
|
/*
|
2016-04-26 22:35:54 -04:00
|
|
|
* Copyright 2014-2016, Rene Gollent, rene@gollent.com.
|
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
|
|
|
|
2015-04-25 22:06:20 -04:00
|
|
|
enum {
|
|
|
|
SIMD_RENDER_FORMAT_INT8 = 0,
|
|
|
|
SIMD_RENDER_FORMAT_INT16,
|
|
|
|
SIMD_RENDER_FORMAT_INT32,
|
|
|
|
SIMD_RENDER_FORMAT_INT64,
|
|
|
|
SIMD_RENDER_FORMAT_FLOAT,
|
|
|
|
SIMD_RENDER_FORMAT_DOUBLE
|
|
|
|
};
|
|
|
|
|
|
|
|
|
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,
|
2016-04-26 22:35:54 -04:00
|
|
|
char* buffer, size_t bufferSize);
|
|
|
|
|
|
|
|
static const char* CoreFileNameForTeam(::Team* team,
|
2012-11-22 23:41:11 -05:00
|
|
|
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);
|
2014-11-05 23:51:28 -05:00
|
|
|
|
|
|
|
static const char* TypeCodeToString(type_code type);
|
2015-04-25 22:06:20 -04:00
|
|
|
|
|
|
|
static const BString& FormatSIMDValue(const BVariant& value,
|
|
|
|
uint32 bitSize, uint32 format,
|
|
|
|
BString& _output);
|
2015-06-28 17:26:22 -04:00
|
|
|
|
2015-07-02 17:54:51 -04:00
|
|
|
static const char* SignalNameToString(int32 signal,
|
|
|
|
BString& _output);
|
2015-06-28 17:26:22 -04:00
|
|
|
static const char* SignalDispositionToString(int disposition);
|
2012-07-23 23:50:18 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif // UI_UTILS_H
|