Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: implement handlings of DWARF format #62

Open
wants to merge 38 commits into
base: tracing-in-c
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
2de7ce7
Add renovate.json
renovate-bot Aug 26, 2021
9f04309
Merge pull request #64 from sj-i/renovate/configure
sj-i Aug 26, 2021
3ac9a20
Pin dependencies
renovate-bot Aug 26, 2021
fe74fe4
Merge pull request #65 from sj-i/renovate/pin-dependencies
sj-i Aug 26, 2021
91b03b5
Pin dependency symfony/console to 5.3.6
renovate-bot Aug 26, 2021
2aaa24c
Merge pull request #66 from sj-i/renovate/symfony
sj-i Aug 26, 2021
6e0cb8f
Update dependency phpunit/phpunit to v9.5.8
renovate-bot Aug 26, 2021
9d86bf3
Update actions/cache action to v2
renovate-bot Aug 26, 2021
01f4553
Merge pull request #67 from sj-i/renovate/phpunit-phpunit-9.x
sj-i Aug 26, 2021
4f35c93
Merge pull request #70 from sj-i/renovate/actions-cache-2.x
sj-i Aug 26, 2021
c38ad3f
Update dependency jetbrains/phpstorm-stubs to v2021.2
renovate-bot Aug 26, 2021
21f505d
Merge pull request #69 from sj-i/renovate/jetbrains-phpstorm-stubs-20…
sj-i Aug 26, 2021
e97af81
Update dependency vimeo/psalm to v4.9.3
renovate-bot Aug 26, 2021
7a03786
fix warnings from psalm
sj-i Aug 26, 2021
5772780
Merge pull request #68 from sj-i/renovate/vimeo-psalm-4.x
sj-i Aug 26, 2021
90cef63
add definitions of tags
sj-i Aug 15, 2021
1fbd1e7
ignore naming conventions for constants of the DWARF format
sj-i Aug 15, 2021
6300ca8
add a decoder of LEB128
sj-i Aug 15, 2021
09b6560
add DWARF Attributes definitions
sj-i Aug 16, 2021
df8b73e
add a Stack class for DWARF Expressions
sj-i Aug 16, 2021
42b36b6
implement some opcodes for DWARF Expressions
sj-i Aug 16, 2021
20f6c15
fix a warning from phpcs
sj-i Aug 16, 2021
46faad9
add UnitHeaders for compilation units
sj-i Aug 16, 2021
e110531
add Form definitions for DWARF Attributes
sj-i Aug 16, 2021
519768e
add basic definitions for compilation units
sj-i Aug 16, 2021
d435b8e
add missing line breaks
sj-i Aug 16, 2021
6674c91
add AddressTable
sj-i Aug 21, 2021
8fbab3d
fix DWARF expression operations to get the execution context of the t…
sj-i Aug 21, 2021
c4c4c91
separate opcodes implementations to directories
sj-i Aug 21, 2021
7d46d14
add nop for DWARF expression
sj-i Aug 21, 2021
e5a2ae2
add some control flow operations for DWARF expressions
sj-i Aug 21, 2021
7030580
add arithmetic and logical operations for DWARF expressions
sj-i Aug 21, 2021
011160a
add stub to ExpressionContext for getting information of the target e…
sj-i Aug 21, 2021
e0ad5d1
add implementations of addrx and constx for DWARF expressions
sj-i Aug 21, 2021
f2859af
fix the test for DWARF expressions
sj-i Aug 21, 2021
6301a2f
add classes for .debug_aranges section
sj-i Sep 3, 2021
d8bbeba
add a class for .debug_abbrev sections
sj-i Sep 5, 2021
4dfe82c
add a class for .debug_info sections
sj-i Sep 6, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/phpcs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache dependencies
uses: actions/cache@v1
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache dependencies
uses: actions/cache@v1
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ jobs:
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache dependencies
uses: actions/cache@v1
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-

- name: "Psalm cache"
uses: actions/cache@v1
uses: actions/cache@v2
with:
path: /tmp/psalm
key: "psalm-cache"
Expand Down
28 changes: 14 additions & 14 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,23 @@
"ext-filter": "*",
"ext-json": "*",
"ext-pcntl": "*",
"symfony/console": "^5.0",
"php-di/php-di": "^6.1",
"amphp/parallel": "^1.4",
"amphp/amp": "^2.4",
"hassankhan/config": "^2.1",
"sj-i/php-cast": "^1.0",
"monolog/monolog": "^2.3"
"symfony/console": "5.3.6",
"php-di/php-di": "6.3.4",
"amphp/parallel": "1.4.0",
"amphp/amp": "2.6.0",
"hassankhan/config": "2.2.0",
"sj-i/php-cast": "1.0.0",
"monolog/monolog": "2.3.2"
},
"require-dev": {
"ext-posix": "*",
"phpunit/phpunit": "^9.0",
"vimeo/psalm": "^4.7",
"squizlabs/php_codesniffer": "^3.6",
"mockery/mockery": "^1.3",
"psalm/plugin-mockery": "^0.9.0",
"jetbrains/phpstorm-stubs": "2021.1",
"php-coveralls/php-coveralls": "^2.3"
"phpunit/phpunit": "9.5.8",
"vimeo/psalm": "4.9.3",
"squizlabs/php_codesniffer": "3.6.0",
"mockery/mockery": "1.4.3",
"psalm/plugin-mockery": "0.9.0",
"jetbrains/phpstorm-stubs": "2021.2",
"php-coveralls/php-coveralls": "2.4.3"
},
"autoload": {
"files": ["src/Lib/Defer/defer.php"],
Expand Down
71 changes: 35 additions & 36 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"extends": [
"config:base"
]
}
28 changes: 28 additions & 0 deletions src/Lib/Dwarf/Abbreviation/AbbreviationDeclaration.php
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 <[email protected]>
*
* 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,
) {
}
}
27 changes: 27 additions & 0 deletions src/Lib/Dwarf/Abbreviation/AttributeSpecification.php
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 <[email protected]>
*
* 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,
) {
}
}
23 changes: 23 additions & 0 deletions src/Lib/Dwarf/AddressTable/AddressEntry.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

/**
* This file is part of the sj-i/php-profiler package.
*
* (c) sji <[email protected]>
*
* 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\AddressTable;

final class AddressEntry
{
public function __construct(
public int $address,
public ?int $segment_selector,
) {
}
}
Loading