@@ -134,6 +134,34 @@ bool SetPropertyColorCmd::DoExecute(SBDebugger d, char** cmd,
134134 return false ;
135135}
136136
137+ bool SetTreePaddingCmd::DoExecute (SBDebugger d, char ** cmd,
138+ SBCommandReturnObject& result) {
139+ if (cmd == nullptr || *cmd == nullptr ) {
140+ result.SetError (" USAGE: v8 settings set tree-padding [1..10]" );
141+ return false ;
142+ }
143+ Settings* settings = Settings::GetSettings ();
144+ std::stringstream option (cmd[0 ]);
145+ int padding;
146+
147+ // Extraction operator (>>) parses option and tries to interpret it
148+ // as an `int` value. If an error occur, an internal state flag will be
149+ // set. Not (!) operator will evaluate to true if `failbit` or `badbit`
150+ // is set
151+ if (!(option >> padding)) {
152+ result.SetError (" unable to convert provided value." );
153+ return false ;
154+ };
155+
156+ // This is just an opinated range limit, to avoid negative values
157+ // or big number, these values would produce a bad visualization experience
158+ if (padding < 1 ) padding = 1 ;
159+ if (padding > 10 ) padding = 10 ;
160+ padding = settings->SetTreePadding (padding);
161+ result.Printf (" Tree padding set to %u\n " , padding);
162+ return true ;
163+ }
164+
137165
138166bool PrintCmd::DoExecute (SBDebugger d, char ** cmd,
139167 SBCommandReturnObject& result) {
@@ -451,6 +479,9 @@ bool PluginInitialize(SBDebugger d) {
451479
452480 setPropertyCmd.AddCommand (" color" , new llnode::SetPropertyColorCmd (),
453481 " Set color property value" );
482+ setPropertyCmd.AddCommand (" tree-padding" ,
483+ new llnode::SetTreePaddingCmd (&llv8),
484+ " Set tree-padding value" );
454485
455486 interpreter.AddCommand (" findjsobjects" , new llnode::FindObjectsCmd (&llscan),
456487 " Alias for `v8 findjsobjects`" );
@@ -485,6 +516,7 @@ bool PluginInitialize(SBDebugger d) {
485516 " * -n, --name name - all properties with the specified name\n "
486517 " * -s, --string string - all properties that refer to the specified "
487518 " JavaScript string value\n "
519+ " * -r, --recursive - walk through references tree recursively\n "
488520 " \n " );
489521
490522 v8.AddCommand (" getactivehandles" ,
0 commit comments