chromium/v8/tools/debug_helper/debug-helper-internal.h

// Copyright 2019 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// This file defines internal versions of the public API structs. These should
// all be tidy and simple classes which maintain proper ownership (unique_ptr)
// of each other. Each contains an instance of its corresponding public type,
// which can be filled out with GetPublicView.

#ifndef V8_TOOLS_DEBUG_HELPER_DEBUG_HELPER_INTERNAL_H_
#define V8_TOOLS_DEBUG_HELPER_DEBUG_HELPER_INTERNAL_H_

#include <memory>
#include <string>
#include <vector>

#include "debug-helper.h"
#include "src/common/globals.h"
#include "src/objects/instance-type.h"

d;

namespace v8 {
namespace internal {
namespace debug_helper_internal {

// A value that was read from the debuggee's memory.
template <typename TValue>
struct Value {};

// Internal version of API class v8::debug_helper::PropertyBase.
class PropertyBase {};

// Internal version of API class v8::debug_helper::StructProperty.
class StructProperty : public PropertyBase {};

// Internal version of API class v8::debug_helper::ObjectProperty.
class ObjectProperty : public PropertyBase {};

class ObjectPropertiesResult;
struct ObjectPropertiesResultExtended : public d::ObjectPropertiesResult {};

// Internal version of API class v8::debug_helper::ObjectPropertiesResult.
class ObjectPropertiesResult {};

class StackFrameResult;
struct StackFrameResultExtended : public d::StackFrameResult {};

// Internal version of API class v8::debug_helper::StackFrameResult.
class StackFrameResult {};

class TqObjectVisitor;

// Base class representing a V8 object in the debuggee's address space.
// Subclasses for specific object types are generated by the Torque compiler.
class TqObject {};

// A helpful template so that generated code can be sure that a string type name
// actually resolves to a type, by repeating the name as the template parameter
// and the value.
template <typename T>
const char* CheckTypeName(const char* name) {}

// In ptr-compr builds, returns whether the address looks like a compressed
// pointer (zero-extended from 32 bits). Otherwise returns false because no
// pointers can be compressed.
bool IsPointerCompressed(uintptr_t address);

// If the given address looks like a compressed pointer, returns a decompressed
// representation of it. Otherwise returns the address unmodified.
uintptr_t EnsureDecompressed(uintptr_t address,
                             uintptr_t any_uncompressed_address);

// Converts the MemoryAccessResult from attempting to read an array's length
// into the corresponding PropertyKind for the array.
d::PropertyKind GetArrayKind(d::MemoryAccessResult mem_result);

}  // namespace debug_helper_internal
}  // namespace internal
}  // namespace v8

#endif