Nyxstone
Loading...
Searching...
No Matches
nyxstone::NyxstoneBuilder Class Reference

Builder for Nyxstone instances. More...

#include <nyxstone.h>

Public Types

enum class  IntegerBase : uint8_t { Dec = 0 , HexPrefix = 1 , HexSuffix = 2 }
 Configuration options for the immediate representation in disassembly. More...
 

Public Member Functions

 NyxstoneBuilder (std::string &&triple)
 Creates a NyxstoneBuilder instance.
 
 NyxstoneBuilder (const NyxstoneBuilder &)=default
 
 NyxstoneBuilder (NyxstoneBuilder &&)=default
 
NyxstoneBuilderoperator= (const NyxstoneBuilder &)=default
 
NyxstoneBuilderoperator= (NyxstoneBuilder &&)=default
 
NyxstoneBuilderwith_cpu (std::string &&cpu) noexcept
 Specifies the cpu for which to assemble/disassemble in nyxstone.
 
NyxstoneBuilderwith_features (std::string &&features) noexcept
 Specify cpu features to en-/disable in nyxstone.
 
NyxstoneBuilderwith_immediate_style (IntegerBase style) noexcept
 Specify the style in which immediates should be represented.
 
tl::expected< std::unique_ptr< Nyxstone >, std::string > build ()
 Builds a nyxstone instance from the builder.
 

Detailed Description

Builder for Nyxstone instances.

Member Enumeration Documentation

◆ IntegerBase

enum class nyxstone::NyxstoneBuilder::IntegerBase : uint8_t
strong

Configuration options for the immediate representation in disassembly.

Enumerator
Dec 

Immediates are represented in decimal format.

HexPrefix 

Immediates are represented in hex format, prepended with 0x, for example: 0xff.

HexSuffix 

Immediates are represented in hex format, suffixed with h, for example: 0ffh.

Constructor & Destructor Documentation

◆ NyxstoneBuilder()

nyxstone::NyxstoneBuilder::NyxstoneBuilder ( std::string && triple)
inlineexplicit

Creates a NyxstoneBuilder instance.

Parameters
tripleLlvm target triple or architecture identifier of a triple.
Note
For the most common architectures, we recommend: x86_32: i686-linux-gnu x86_64: x86_64-linux-gnu armv6m: armv6m-none-eabi armv7m: armv7m-none-eabi armv8m: armv8m.main-none-eabi aarch64: aarch64-linux-gnueabihf Using shorthand identifiers like arm can lead to Nyxstone not being able to assemble certain instructions.

Member Function Documentation

◆ build()

tl::expected< std::unique_ptr< Nyxstone >, std::string > nyxstone::NyxstoneBuilder::build ( )

Builds a nyxstone instance from the builder.

Returns
A unique_ptr holding the created nyxstone instance on success, an error string otherwise.

◆ with_cpu()

NyxstoneBuilder & nyxstone::NyxstoneBuilder::with_cpu ( std::string && cpu)
noexcept

Specifies the cpu for which to assemble/disassemble in nyxstone.

Returns
Reference to the updated NyxstoneBuilder object.

◆ with_features()

NyxstoneBuilder & nyxstone::NyxstoneBuilder::with_features ( std::string && features)
noexcept

Specify cpu features to en-/disable in nyxstone.

Returns
Reference to the updated NyxstoneBuilder object.

◆ with_immediate_style()

NyxstoneBuilder & nyxstone::NyxstoneBuilder::with_immediate_style ( NyxstoneBuilder::IntegerBase style)
noexcept

Specify the style in which immediates should be represented.

Returns
Reference to the updated NyxstoneBuilder object.

The documentation for this class was generated from the following files: