CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
96 lines
3.7 KiB
C++
96 lines
3.7 KiB
C++
//===-- DWARFFormValue.h ----------------------------------------*- C++ -*-===//
|
|
//
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DWARFFORMVALUE_H
|
|
#define LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DWARFFORMVALUE_H
|
|
|
|
#include "DWARFDataExtractor.h"
|
|
#include "llvm/DebugInfo/DWARF/DWARFFormValue.h"
|
|
#include <optional>
|
|
|
|
namespace lldb_private::plugin {
|
|
namespace dwarf {
|
|
class DWARFUnit;
|
|
class SymbolFileDWARF;
|
|
class DWARFDIE;
|
|
|
|
class DWARFFormValue {
|
|
public:
|
|
typedef llvm::DWARFFormValue::ValueType ValueType;
|
|
enum {
|
|
eValueTypeInvalid = 0,
|
|
eValueTypeUnsigned,
|
|
eValueTypeSigned,
|
|
eValueTypeCStr,
|
|
eValueTypeBlock
|
|
};
|
|
|
|
DWARFFormValue() = default;
|
|
DWARFFormValue(const DWARFUnit *unit) : m_unit(unit) {}
|
|
DWARFFormValue(const DWARFUnit *unit, dw_form_t form)
|
|
: m_unit(unit), m_form(form) {}
|
|
const DWARFUnit *GetUnit() const { return m_unit; }
|
|
void SetUnit(const DWARFUnit *unit) { m_unit = unit; }
|
|
dw_form_t Form() const { return m_form; }
|
|
dw_form_t &FormRef() { return m_form; }
|
|
void SetForm(dw_form_t form) { m_form = form; }
|
|
const ValueType &Value() const { return m_value; }
|
|
ValueType &ValueRef() { return m_value; }
|
|
void SetValue(const ValueType &val) { m_value = val; }
|
|
|
|
void Dump(Stream &s) const;
|
|
bool ExtractValue(const DWARFDataExtractor &data, lldb::offset_t *offset_ptr);
|
|
const uint8_t *BlockData() const;
|
|
static std::optional<uint8_t> GetFixedSize(dw_form_t form,
|
|
const DWARFUnit *u);
|
|
std::optional<uint8_t> GetFixedSize() const;
|
|
DWARFDIE Reference() const;
|
|
|
|
/// If this is a reference to another DIE, return the corresponding DWARFUnit
|
|
/// and DIE offset such that Unit->GetDIE(offset) produces the desired DIE.
|
|
/// Otherwise, a nullptr and unspecified offset are returned.
|
|
std::pair<DWARFUnit *, uint64_t> ReferencedUnitAndOffset() const;
|
|
|
|
uint64_t Reference(dw_offset_t offset) const;
|
|
bool Boolean() const { return m_value.uval != 0; }
|
|
uint64_t Unsigned() const { return m_value.uval; }
|
|
void SetUnsigned(uint64_t uval) { m_value.uval = uval; }
|
|
int64_t Signed() const { return m_value.sval; }
|
|
void SetSigned(int64_t sval) { m_value.sval = sval; }
|
|
const char *AsCString() const;
|
|
dw_addr_t Address() const;
|
|
bool IsValid() const { return m_form != 0; }
|
|
bool SkipValue(const DWARFDataExtractor &debug_info_data,
|
|
lldb::offset_t *offset_ptr) const;
|
|
static bool SkipValue(const dw_form_t form,
|
|
const DWARFDataExtractor &debug_info_data,
|
|
lldb::offset_t *offset_ptr, const DWARFUnit *unit);
|
|
static bool IsBlockForm(const dw_form_t form);
|
|
static bool IsDataForm(const dw_form_t form);
|
|
static int Compare(const DWARFFormValue &a, const DWARFFormValue &b);
|
|
void Clear();
|
|
static bool FormIsSupported(dw_form_t form);
|
|
|
|
// The following methods use LLVM naming convension in order to be are used by
|
|
// LLVM libraries.
|
|
std::optional<uint64_t> getAsUnsignedConstant() const;
|
|
std::optional<int64_t> getAsSignedConstant() const;
|
|
const char *getAsCString() const { return AsCString(); }
|
|
|
|
protected:
|
|
// Compile unit where m_value was located.
|
|
// It may be different from compile unit where m_value refers to.
|
|
const DWARFUnit *m_unit = nullptr; // Unit for this form
|
|
dw_form_t m_form = dw_form_t(0); // Form for this value
|
|
ValueType m_value; // Contains all data for the form
|
|
};
|
|
} // namespace dwarf
|
|
} // namespace lldb_private::plugin
|
|
|
|
#endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DWARFFORMVALUE_H
|