-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add basic definitions for compilation units
- Loading branch information
Showing
24 changed files
with
492 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
/** | ||
* This file is part of the sj-i/php-profiler package. | ||
* | ||
* (c) sji <sji@sj-i.dev> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace PhpProfiler\Lib\Dwarf\Abbreviation; | ||
|
||
use PhpProfiler\Lib\Dwarf\Tag; | ||
|
||
final class AbbreviationDeclaration | ||
{ | ||
/** @param AttributeSpecification[] $attribute_specifications */ | ||
public function __construct( | ||
public int $abbreviation_code, | ||
public Tag $tag, | ||
public bool $has_children, | ||
public array $attribute_specifications, | ||
) { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
/** | ||
* This file is part of the sj-i/php-profiler package. | ||
* | ||
* (c) sji <sji@sj-i.dev> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace PhpProfiler\Lib\Dwarf\Abbreviation; | ||
|
||
use PhpProfiler\Lib\Dwarf\Attribute; | ||
use PhpProfiler\Lib\Dwarf\Form; | ||
|
||
final class AttributeSpecification | ||
{ | ||
public function __construct( | ||
public Attribute $attribute, | ||
public Form $form, | ||
public ?int $implicit_const, | ||
) { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -141,7 +141,6 @@ class Attribute | |
|
||
public function __construct( | ||
public int $name, | ||
public Form $form, | ||
) { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
/** | ||
* This file is part of the sj-i/php-profiler package. | ||
* | ||
* (c) sji <sji@sj-i.dev> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace PhpProfiler\Lib\Dwarf\Attribute; | ||
|
||
final class IdentifierCaseCode | ||
{ | ||
public const DW_ID_case_sensitive = 0x00; | ||
public const DW_ID_up_case = 0x01; | ||
public const DW_ID_down_case = 0x02; | ||
public const DW_ID_case_insensitive = 0x03; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
/** | ||
* This file is part of the sj-i/php-profiler package. | ||
* | ||
* (c) sji <sji@sj-i.dev> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace PhpProfiler\Lib\Dwarf\CompilationUnit; | ||
|
||
use PhpProfiler\Lib\Dwarf\CompilationUnit\UnitHeader\TypeUnitHeader; | ||
use PhpProfiler\Lib\Dwarf\CompilationUnit\UnitHeader\UnitHeader; | ||
use PhpProfiler\Lib\Dwarf\DebuggingInformationEntry\CompileUnitDIE; | ||
use PhpProfiler\Lib\Dwarf\DebuggingInformationEntry\PartialUnitDIE; | ||
|
||
final class CompilationUnit | ||
{ | ||
public function __construct( | ||
public UnitHeader $unit_header, | ||
public CompileUnitDIE|PartialUnitDIE $unit_die, | ||
public ?TypeUnitHeader $type_unit_header, | ||
) { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
/** | ||
* This file is part of the sj-i/php-profiler package. | ||
* | ||
* (c) sji <sji@sj-i.dev> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace PhpProfiler\Lib\Dwarf\CompilationUnit\UnitHeader; | ||
|
||
use PhpProfiler\Lib\Dwarf\CompilationUnit\UnitType; | ||
|
||
interface UnitHeader | ||
{ | ||
public function getUnitLength(): int; | ||
public function getVersion(): int; | ||
public function getUnitType(): UnitType; | ||
public function getAddressSize(): int; | ||
public function getDebugAbbrevOffset(): int; | ||
} |
44 changes: 44 additions & 0 deletions
44
src/Lib/Dwarf/CompilationUnit/UnitHeader/UnitHeaderTrait.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
|
||
/** | ||
* This file is part of the sj-i/php-profiler package. | ||
* | ||
* (c) sji <sji@sj-i.dev> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace PhpProfiler\Lib\Dwarf\CompilationUnit\UnitHeader; | ||
|
||
use PhpProfiler\Lib\Dwarf\CompilationUnit\UnitType; | ||
|
||
trait UnitHeaderTrait | ||
{ | ||
public function getUnitLength(): int | ||
{ | ||
return $this->unit_length; | ||
} | ||
|
||
public function getVersion(): int | ||
{ | ||
return $this->version; | ||
} | ||
|
||
public function getUnitType(): UnitType | ||
{ | ||
return $this->unit_type; | ||
} | ||
|
||
public function getAddressSize(): int | ||
{ | ||
return $this->address_size; | ||
} | ||
|
||
public function getDebugAbbrevOffset(): int | ||
{ | ||
return $this->debug_abbrev_offset; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
/** | ||
* This file is part of the sj-i/php-profiler package. | ||
* | ||
* (c) sji <sji@sj-i.dev> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace PhpProfiler\Lib\Dwarf\DebuggingInformationEntry; | ||
|
||
class AddressRange | ||
{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
/** | ||
* This file is part of the sj-i/php-profiler package. | ||
* | ||
* (c) sji <sji@sj-i.dev> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace PhpProfiler\Lib\Dwarf\DebuggingInformationEntry; | ||
|
||
final class AddressRanges | ||
{ | ||
public function isInRanges(int $address): bool | ||
{ | ||
return false; | ||
} | ||
} |
Oops, something went wrong.