@@ -398,7 +398,7 @@ def to_h
398
398
# the task's address space. Corresponds to LC_SEGMENT.
399
399
class SegmentCommand < LoadCommand
400
400
# @return [String] the name of the segment
401
- field :segname , :string , :size => 16
401
+ field :segname , :string , :size => 16 , :to_s => true
402
402
403
403
# @return [Integer] the memory address of the segment
404
404
field :vmaddr , :uint32
@@ -476,11 +476,6 @@ def guess_align
476
476
align
477
477
end
478
478
479
- # @return [String] a string representation of the segment name
480
- def to_s
481
- segname
482
- end
483
-
484
479
# @return [Hash] a hash representation of this {SegmentCommand}
485
480
def to_h
486
481
{
@@ -520,7 +515,7 @@ class SegmentCommand64 < SegmentCommand
520
515
class DylibCommand < LoadCommand
521
516
# @return [LCStr] the library's path
522
517
# name as an LCStr
523
- field :name , :lcstr
518
+ field :name , :lcstr , :to_s => true
524
519
525
520
# @return [Integer] the library's build time stamp
526
521
field :timestamp , :uint32
@@ -545,11 +540,6 @@ def serialize(context)
545
540
compatibility_version ] . pack ( format ) + string_payload
546
541
end
547
542
548
- # @return [String] a string representation of the library's pathname
549
- def to_s
550
- name . to_s
551
- end
552
-
553
543
# @return [Hash] a hash representation of this {DylibCommand}
554
544
def to_h
555
545
{
@@ -567,7 +557,7 @@ def to_h
567
557
class DylinkerCommand < LoadCommand
568
558
# @return [LCStr] the dynamic linker's
569
559
# path name as an LCStr
570
- field :name , :lcstr
560
+ field :name , :lcstr , :to_s => true
571
561
572
562
# @param context [SerializationContext]
573
563
# the context
@@ -582,11 +572,6 @@ def serialize(context)
582
572
[ cmd , cmdsize , string_offsets [ :name ] ] . pack ( format ) + string_payload
583
573
end
584
574
585
- # @return [String] a string representation of the dynamic linker's pathname
586
- def to_s
587
- name . to_s
588
- end
589
-
590
575
# @return [Hash] a hash representation of this {DylinkerCommand}
591
576
def to_h
592
577
{
@@ -600,19 +585,14 @@ def to_h
600
585
class PreboundDylibCommand < LoadCommand
601
586
# @return [LCStr] the library's path
602
587
# name as an LCStr
603
- field :name , :lcstr
588
+ field :name , :lcstr , :to_s => true
604
589
605
590
# @return [Integer] the number of modules in the library
606
591
field :nmodules , :uint32
607
592
608
593
# @return [Integer] a bit vector of linked modules
609
594
field :linked_modules , :uint32
610
595
611
- # @return [String] a string representation of the library's pathname
612
- def to_s
613
- name . to_s
614
- end
615
-
616
596
# @return [Hash] a hash representation of this {PreboundDylibCommand}
617
597
def to_h
618
598
{
@@ -707,12 +687,7 @@ class RoutinesCommand64 < RoutinesCommand
707
687
# of an umbrella framework. Corresponds to LC_SUB_FRAMEWORK.
708
688
class SubFrameworkCommand < LoadCommand
709
689
# @return [LCStr] the umbrella framework name as an LCStr
710
- field :umbrella , :lcstr
711
-
712
- # @return [String] a string represenation of the umbrella framework name
713
- def to_s
714
- umbrella . to_s
715
- end
690
+ field :umbrella , :lcstr , :to_s => true
716
691
717
692
# @return [Hash] a hash representation of this {SubFrameworkCommand}
718
693
def to_h
@@ -726,12 +701,7 @@ def to_h
726
701
# of an umbrella framework. Corresponds to LC_SUB_UMBRELLA.
727
702
class SubUmbrellaCommand < LoadCommand
728
703
# @return [LCStr] the subumbrella framework name as an LCStr
729
- field :sub_umbrella , :lcstr
730
-
731
- # @return [String] a string represenation of the sub-umbrella framework name
732
- def to_s
733
- sub_umbrella . to_s
734
- end
704
+ field :sub_umbrella , :lcstr , :to_s => true
735
705
736
706
# @return [Hash] a hash representation of this {SubUmbrellaCommand}
737
707
def to_h
@@ -745,12 +715,7 @@ def to_h
745
715
# to LC_SUB_LIBRARY.
746
716
class SubLibraryCommand < LoadCommand
747
717
# @return [LCStr] the sublibrary name as an LCStr
748
- field :sub_library , :lcstr
749
-
750
- # @return [String] a string represenation of the sub-library name
751
- def to_s
752
- sublibrary . to_s
753
- end
718
+ field :sub_library , :lcstr , :to_s => true
754
719
755
720
# @return [Hash] a hash representation of this {SubLibraryCommand}
756
721
def to_h
@@ -764,12 +729,7 @@ def to_h
764
729
# an umbrella framework. Corresponds to LC_SUB_CLIENT.
765
730
class SubClientCommand < LoadCommand
766
731
# @return [LCStr] the subclient name as an LCStr
767
- field :sub_client , :lcstr
768
-
769
- # @return [String] a string represenation of the sub-client name
770
- def to_s
771
- sub_client . to_s
772
- end
732
+ field :sub_client , :lcstr , :to_s => true
773
733
774
734
# @return [Hash] a hash representation of this {SubClientCommand}
775
735
def to_h
@@ -972,7 +932,7 @@ def to_h
972
932
# Corresponds to LC_RPATH.
973
933
class RpathCommand < LoadCommand
974
934
# @return [LCStr] the path to add to the run path as an LCStr
975
- field :path , :lcstr
935
+ field :path , :lcstr , :to_s => true
976
936
977
937
# @param context [SerializationContext] the context
978
938
# @return [String] the serialized fields of the load command
@@ -986,11 +946,6 @@ def serialize(context)
986
946
[ cmd , cmdsize , string_offsets [ :path ] ] . pack ( format ) + string_payload
987
947
end
988
948
989
- # @return [String] a string representation of the run path
990
- def to_s
991
- path . to_s
992
- end
993
-
994
949
# @return [Hash] a hash representation of this {RpathCommand}
995
950
def to_h
996
951
{
@@ -1293,11 +1248,6 @@ def version_string
1293
1248
segs . join ( "." )
1294
1249
end
1295
1250
1296
- # @return [String] an alias for version_string
1297
- def to_s
1298
- version_string
1299
- end
1300
-
1301
1251
# @return [Hash] a hash representation of this {SourceVersionCommand}
1302
1252
def to_h
1303
1253
{
@@ -1335,16 +1285,11 @@ class IdentCommand < LoadCommand
1335
1285
# memory. Corresponds to LC_FVMFILE.
1336
1286
class FvmfileCommand < LoadCommand
1337
1287
# @return [LCStr] the pathname of the file being loaded
1338
- field :name , :lcstr
1288
+ field :name , :lcstr , :to_s => true
1339
1289
1340
1290
# @return [Integer] the virtual address being loaded at
1341
1291
field :header_addr , :uint32
1342
1292
1343
- # @return [String] a string representation of the pathname
1344
- def to_s
1345
- name . to_s
1346
- end
1347
-
1348
1293
# @return [Hash] a hash representation of this {FvmfileCommand}
1349
1294
def to_h
1350
1295
{
@@ -1358,19 +1303,14 @@ def to_h
1358
1303
# into memory. Corresponds to LC_LOADFVMLIB and LC_IDFVMLIB.
1359
1304
class FvmlibCommand < LoadCommand
1360
1305
# @return [LCStr] the library's target pathname
1361
- field :name , :lcstr
1306
+ field :name , :lcstr , :to_s => true
1362
1307
1363
1308
# @return [Integer] the library's minor version number
1364
1309
field :minor_version , :uint32
1365
1310
1366
1311
# @return [Integer] the library's header address
1367
1312
field :header_addr , :uint32
1368
1313
1369
- # @return [String] a string representation of the target pathname
1370
- def to_s
1371
- name . to_s
1372
- end
1373
-
1374
1314
# @return [Hash] a hash representation of this {FvmlibCommand}
1375
1315
def to_h
1376
1316
{
@@ -1385,19 +1325,14 @@ def to_h
1385
1325
# Corresponds to LC_NOTE.
1386
1326
class NoteCommand < LoadCommand
1387
1327
# @return [String] the name of the owner for this note
1388
- field :data_owner , :string , :size => 16
1328
+ field :data_owner , :string , :size => 16 , :to_s => true
1389
1329
1390
1330
# @return [Integer] the offset, within the file, of the note
1391
1331
field :offset , :uint64
1392
1332
1393
1333
# @return [Integer] the size, in bytes, of the note
1394
1334
field :size , :uint64
1395
1335
1396
- # @return [String] a string representation of data owner of this note
1397
- def to_s
1398
- data_owner
1399
- end
1400
-
1401
1336
# @return [Hash] a hash representation of this {NoteCommand}
1402
1337
def to_h
1403
1338
{
@@ -1419,7 +1354,7 @@ class FilesetEntryCommand < LoadCommand
1419
1354
field :fileoff , :uint64
1420
1355
1421
1356
# @return [LCStr] the entry's ID
1422
- field :entry_id , :lcstr
1357
+ field :entry_id , :lcstr , :to_s => true
1423
1358
1424
1359
# @return [void]
1425
1360
field :reserved , :uint32
0 commit comments