Skip to content

Commit

Permalink
feat: Additional symbol info
Browse files Browse the repository at this point in the history
  • Loading branch information
macmade committed Mar 7, 2024
1 parent 6d1c474 commit 58f6dd4
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion lib-macho/source/Symbol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,22 @@ namespace MachO

i.addChild( { "Name", this->name() } );
i.addChild( { "Name Index", XS::ToString::Hex( this->nameIndex() ) } );
i.addChild( { "Type", XS::ToString::Hex( this->type() ) } );

{
XS::Info type( "Type", XS::ToString::Hex( this->type() ) );

type.addChild( { "Symbolic Debugging Entry", std::to_string( ( this->type() & 0xE0 ) != 0 ) } );
type.addChild( { "Private External Symbol", std::to_string( ( this->type() & 0x10 ) != 0 ) } );
type.addChild( { "Undefined", std::to_string( ( this->type() & 0x0E ) == 0x0 ) } );
type.addChild( { "Absolute", std::to_string( ( this->type() & 0x0E ) == 0x2 ) } );
type.addChild( { "Defined in Section", std::to_string( ( this->type() & 0x0E ) == 0xE ) } );
type.addChild( { "Prebound Undefined", std::to_string( ( this->type() & 0x0E ) == 0xC ) } );
type.addChild( { "Indirect", std::to_string( ( this->type() & 0x0E ) == 0xA ) } );
type.addChild( { "External Symbol", std::to_string( ( this->type() & 0x01 ) != 0 ) } );

i.addChild( type );
}

i.addChild( { "Section", XS::ToString::Hex( this->section() ) } );
i.addChild( { "Description", XS::ToString::Hex( this->description() ) } );
i.addChild( { "Value", XS::ToString::Hex( this->value() ) } );
Expand Down

0 comments on commit 58f6dd4

Please sign in to comment.