|
23 | 23 | namespace llnode { |
24 | 24 |
|
25 | 25 | using lldb::ByteOrder; |
26 | | -using lldb::eReturnStatusFailed; |
27 | | -using lldb::eReturnStatusSuccessFinishResult; |
28 | 26 | using lldb::SBCommandReturnObject; |
29 | 27 | using lldb::SBDebugger; |
30 | 28 | using lldb::SBError; |
31 | 29 | using lldb::SBExpressionOptions; |
32 | 30 | using lldb::SBStream; |
33 | 31 | using lldb::SBTarget; |
34 | 32 | using lldb::SBValue; |
| 33 | +using lldb::eReturnStatusFailed; |
| 34 | +using lldb::eReturnStatusSuccessFinishResult; |
35 | 35 |
|
36 | 36 |
|
37 | 37 | char** ParsePrinterOptions(char** cmd, Printer::PrinterOptions* options) { |
@@ -635,38 +635,28 @@ void FindReferencesCmd::ScanForReferences(ObjectScanner* scanner) { |
635 | 635 | } |
636 | 636 |
|
637 | 637 | void FindReferencesCmd::PrintRecursiveReferences( |
638 | | - lldb::SBCommandReturnObject& result, |
639 | | - ScanOptions* options, |
640 | | - ReferencesVector* visited_references, |
641 | | - uint64_t address, |
642 | | - int level |
643 | | -) |
644 | | -{ |
| 638 | + lldb::SBCommandReturnObject& result, ScanOptions* options, |
| 639 | + ReferencesVector* visited_references, uint64_t address, int level) { |
645 | 640 | Settings* settings = Settings::GetSettings(); |
646 | 641 | unsigned int padding = settings->GetTreePadding(); |
647 | 642 |
|
648 | 643 | std::string branch = std::string(padding * level, ' ') + "+ "; |
649 | 644 |
|
650 | 645 | result.Printf("%s", branch.c_str()); |
651 | 646 |
|
652 | | - if (find(visited_references->begin(), visited_references->end(), address) != visited_references->end()) |
653 | | - { |
| 647 | + if (find(visited_references->begin(), visited_references->end(), address) != |
| 648 | + visited_references->end()) { |
654 | 649 | std::stringstream seen_str; |
655 | | - seen_str << rang::fg::red << " [seen above]" << rang::fg::reset << std::endl; |
| 650 | + seen_str << rang::fg::red << " [seen above]" << rang::fg::reset |
| 651 | + << std::endl; |
656 | 652 | result.Printf(seen_str.str().c_str()); |
657 | 653 | } else { |
658 | 654 | visited_references->push_back(address); |
659 | 655 | v8::Value value(llscan_->v8(), address); |
660 | 656 | ReferenceScanner scanner_(llscan_, value); |
661 | 657 | ReferencesVector* references_ = scanner_.GetReferences(); |
662 | | - PrintReferences( |
663 | | - result, |
664 | | - references_, |
665 | | - &scanner_, |
666 | | - options, |
667 | | - visited_references, |
668 | | - level + 1 |
669 | | - ); |
| 658 | + PrintReferences(result, references_, &scanner_, options, visited_references, |
| 659 | + level + 1); |
670 | 660 | } |
671 | 661 | } |
672 | 662 |
|
@@ -696,15 +686,17 @@ void FindReferencesCmd::PrintReferences( |
696 | 686 | scanner->PrintRefs(result, js_obj, err, level); |
697 | 687 |
|
698 | 688 | if (options->recursive_scan) { |
699 | | - PrintRecursiveReferences(result, options, already_visited_references, addr, level); |
| 689 | + PrintRecursiveReferences(result, options, already_visited_references, |
| 690 | + addr, level); |
700 | 691 | } |
701 | 692 |
|
702 | 693 | } else if (type < v8->types()->kFirstNonstringType) { |
703 | 694 | v8::String str(heap_object); |
704 | 695 | scanner->PrintRefs(result, str, err, level); |
705 | 696 |
|
706 | 697 | if (options->recursive_scan) { |
707 | | - PrintRecursiveReferences(result, options, already_visited_references, addr, level); |
| 698 | + PrintRecursiveReferences(result, options, already_visited_references, |
| 699 | + addr, level); |
708 | 700 | } |
709 | 701 |
|
710 | 702 | } else if (type == v8->types()->kJSTypedArrayType) { |
@@ -820,7 +812,8 @@ void FindReferencesCmd::ReferenceScanner::PrintContextRefs( |
820 | 812 | search_value_.raw()); |
821 | 813 |
|
822 | 814 | if (options->recursive_scan) { |
823 | | - cli_cmd_->PrintRecursiveReferences(result, options, already_visited_references, c.raw(), level); |
| 815 | + cli_cmd_->PrintRecursiveReferences( |
| 816 | + result, options, already_visited_references, c.raw(), level); |
824 | 817 | } |
825 | 818 | } |
826 | 819 | } |
|
0 commit comments