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

src: add recursive option to findrefs command #244

Closed
wants to merge 4 commits into from

Conversation

Drieger
Copy link
Contributor

@Drieger Drieger commented Oct 23, 2018

Introduce a new command flag to findrefs, command --recursive
allow user to transverse the whole references tree for the given
object.

Refs: #115

Copy link
Contributor

@mmarchini mmarchini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! :D

Left a few comments. Also, need to run make format here.

src/llscan.cc Outdated Show resolved Hide resolved
src/llscan.cc Outdated Show resolved Hide resolved
src/llscan.cc Outdated Show resolved Hide resolved
src/llscan.cc Show resolved Hide resolved
src/llscan.cc Show resolved Hide resolved
src/llscan.cc Outdated
ss << rang::fg::cyan << "0x%" PRIx64 << rang::fg::reset << ": "
<< rang::fg::magenta << "Context" << rang::style::bold << rang::fg::yellow
<< ".%s" << rang::fg::reset << rang::style::reset << "=" << rang::fg::cyan
<< "0x%" PRIx64 << rang::fg::reset << "\n";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we call Context::Inspect instead of reformatting it here?

src/llnode.cc Show resolved Hide resolved
@Drieger
Copy link
Contributor Author

Drieger commented Oct 29, 2018

@mmarchini I already addressed your comments.

src/llscan.cc Show resolved Hide resolved
@@ -491,6 +522,7 @@ bool PluginInitialize(SBDebugger d) {
" * -n, --name name - all properties with the specified name\n"
" * -s, --string string - all properties that refer to the specified "
"JavaScript string value\n"
" * -r, --recursive - walk through references tree recursively\n"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-r is incompatible with -s and -n, right? If so this should be documented, otherwise, we should have tests for -r -s <string> and -r -n <property>.

@Drieger
Copy link
Contributor Author

Drieger commented Jan 21, 2019

@mmarchini I moved duplicated code to a method and added tests for all findrefs options.

@Drieger Drieger force-pushed the findrefstree_command branch 16 times, most recently from dbda298 to 240cbbb Compare January 30, 2019 15:40
@Drieger
Copy link
Contributor Author

Drieger commented Jan 30, 2019

The error seems to be related to #267 and was not introduced by this PR, it is being captured by the test in some situations.

@mmarchini mmarchini force-pushed the findrefstree_command branch from 240cbbb to 65d202a Compare February 11, 2019 13:28
@codecov-io
Copy link

codecov-io commented Feb 11, 2019

Codecov Report

Merging #244 into master will increase coverage by 0.81%.
The diff coverage is 64.03%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #244      +/-   ##
==========================================
+ Coverage   79.96%   80.77%   +0.81%     
==========================================
  Files          34       34              
  Lines        4292     4369      +77     
==========================================
+ Hits         3432     3529      +97     
+ Misses        860      840      -20
Impacted Files Coverage Δ
src/settings.cc 78.94% <0%> (-21.06%) ⬇️
test/plugin/scan-test.js 98.91% <100%> (+0.36%) ⬆️
src/llscan.h 68.18% <50%> (+15.87%) ⬆️
src/llnode.h 50% <50%> (ø) ⬆️
src/llnode.cc 73.12% <6.66%> (-4.19%) ⬇️
src/llscan.cc 60.73% <68.75%> (+5.46%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ea06ef5...6b4e80a. Read the comment docs.

Drieger and others added 4 commits February 25, 2019 16:25
@mmarchini mmarchini force-pushed the findrefstree_command branch from 51cfe57 to 6b4e80a Compare February 25, 2019 19:26
Copy link
Contributor

@mmarchini mmarchini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. There's still some cleanup to be done in the future, but nothing blocker. Thanks @Drieger!

@mmarchini
Copy link
Contributor

This is the result for a recursive findrefs on Zlib:

image

This feature will be really helpful 😄

@mmarchini mmarchini added the author ready PRs that have at least one approvals, no pending requests for changes, and a CI started. label Feb 26, 2019
@mmarchini
Copy link
Contributor

I'll keep this open for a few days in case someone else wants to review it, otherwise I plan to land this by the weekend.

mmarchini pushed a commit that referenced this pull request Mar 5, 2019
Introduce a new command flag to `findrefs`, command --recursive
allow user to transverse the whole references tree for the given
object.

Refs: #115

PR-URL: #244
Reviewed-By: Matheus Marchini <mat@mmarchini.me>
mmarchini added a commit that referenced this pull request Mar 5, 2019
PR-URL: #244
Refs: #115
Reviewed-By: Matheus Marchini <mat@mmarchini.me>
@mmarchini
Copy link
Contributor

Landed in 85f067a...c29d5af, thank you!

@mmarchini mmarchini closed this Mar 5, 2019
@mmarchini mmarchini mentioned this pull request Mar 5, 2019
lldb::SBCommandReturnObject& result) override;

private:
v8::LLV8* llv8_;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

llv8_ unused, PR with fix #297

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approvals, no pending requests for changes, and a CI started.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants