35
35
import org .truffleruby .core .rope .RopeNodesFactory .SetByteNodeGen ;
36
36
import org .truffleruby .core .string .StringAttributes ;
37
37
import org .truffleruby .core .string .StringSupport ;
38
- import org .truffleruby .core .string .StringUtils ;
39
38
import org .truffleruby .language .NotProvided ;
40
39
import org .truffleruby .language .RubyBaseNode ;
41
40
import org .truffleruby .language .RubyContextNode ;
@@ -745,7 +744,7 @@ protected Object debugPrintLeafRope(LeafRope rope, int currentLevel, boolean pri
745
744
// Converting a rope to a java.lang.String may populate the byte[], so we need to query for the array status beforehand.
746
745
final boolean bytesAreNull = rope .getRawBytes () == null ;
747
746
748
- System .err .println (StringUtils .format (
747
+ System .err .println (String .format (
749
748
"%s (%s; BN: %b; BL: %d; CL: %d; CR: %s; E: %s)" ,
750
749
printString ? RopeOperations .escape (rope ) : "<skipped>" ,
751
750
rope .getClass ().getSimpleName (),
@@ -766,7 +765,7 @@ protected Object debugPrintSubstringRope(SubstringRope rope, int currentLevel, b
766
765
// Converting a rope to a java.lang.String may populate the byte[], so we need to query for the array status beforehand.
767
766
final boolean bytesAreNull = rope .getRawBytes () == null ;
768
767
769
- System .err .println (StringUtils .format (
768
+ System .err .println (String .format (
770
769
"%s (%s; BN: %b; BL: %d; CL: %d; CR: %s; O: %d; E: %s)" ,
771
770
printString ? RopeOperations .escape (rope ) : "<skipped>" ,
772
771
rope .getClass ().getSimpleName (),
@@ -793,7 +792,7 @@ protected Object debugPrintConcatRopeBytes(ConcatRope rope, int currentLevel, bo
793
792
final boolean bytesAreNull = rope .getRawBytes () == null ;
794
793
795
794
if (state .isFlattened ()) {
796
- System .err .println (StringUtils .format (
795
+ System .err .println (String .format (
797
796
"%s (%s; BN: %b; BL: %d; CL: %d; CR: %s; E: %s)" ,
798
797
printString ? RopeOperations .escape (rope ) : "<skipped>" ,
799
798
rope .getClass ().getSimpleName (),
@@ -803,7 +802,7 @@ protected Object debugPrintConcatRopeBytes(ConcatRope rope, int currentLevel, bo
803
802
rope .getCodeRange (),
804
803
rope .getEncoding ()));
805
804
} else {
806
- System .err .println (StringUtils .format (
805
+ System .err .println (String .format (
807
806
"%s (%s; BN: %b; BL: %d; CL: %d; CR: %s; E: %s)" ,
808
807
printString ? RopeOperations .escape (rope ) : "<skipped>" ,
809
808
rope .getClass ().getSimpleName (),
@@ -828,7 +827,7 @@ protected Object debugPrintRepeatingRope(RepeatingRope rope, int currentLevel, b
828
827
// Converting a rope to a java.lang.String may populate the byte[], so we need to query for the array status beforehand.
829
828
final boolean bytesAreNull = rope .getRawBytes () == null ;
830
829
831
- System .err .println (StringUtils .format (
830
+ System .err .println (String .format (
832
831
"%s (%s; BN: %b; BL: %d; CL: %d; CR: %s; T: %d; D: %d; E: %s)" ,
833
832
printString ? RopeOperations .escape (rope ) : "<skipped>" ,
834
833
rope .getClass ().getSimpleName (),
@@ -852,7 +851,7 @@ protected Object debugPrintLazyInt(LazyIntRope rope, int currentLevel, boolean p
852
851
// Converting a rope to a java.lang.String may populate the byte[], so we need to query for the array status beforehand.
853
852
final boolean bytesAreNull = rope .getRawBytes () == null ;
854
853
855
- System .err .println (StringUtils .format (
854
+ System .err .println (String .format (
856
855
"%s (%s; BN: %b; BL: %d; CL: %d; CR: %s; V: %d, D: %d; E: %s)" ,
857
856
printString ? RopeOperations .escape (rope ) : "<skipped>" ,
858
857
rope .getClass ().getSimpleName (),
@@ -866,6 +865,25 @@ protected Object debugPrintLazyInt(LazyIntRope rope, int currentLevel, boolean p
866
865
return nil ;
867
866
}
868
867
868
+ @ TruffleBoundary
869
+ @ Specialization
870
+ protected Object debugPrintNative (NativeRope rope , int currentLevel , boolean printString ) {
871
+ printPreamble (currentLevel );
872
+
873
+ System .err .println (String .format (
874
+ "%s (%s; BL: %d; CL: %d; CR: %s; P: 0x%x, S: %d; E: %s)" ,
875
+ printString ? RopeOperations .escape (rope ) : "<skipped>" ,
876
+ rope .getClass ().getSimpleName (),
877
+ rope .byteLength (),
878
+ rope .characterLength (),
879
+ rope .getCodeRange (),
880
+ rope .getNativePointer ().getAddress (),
881
+ rope .getNativePointer ().getSize (),
882
+ rope .getEncoding ()));
883
+
884
+ return nil ;
885
+ }
886
+
869
887
private void printPreamble (int level ) {
870
888
if (level > 0 ) {
871
889
for (int i = 0 ; i < level ; i ++) {
0 commit comments