• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


Commit MetaInfo

Revisionb50f188dfa065c9edfe82c874e2f8c179eb6d697 (tree)
Time2017-02-03 13:25:11
AuthorTom Tromey <tom@trom...>
CommiterTom Tromey

Log Message

Reindent rust-lang.c

I noticed a few spots in rust-lang.c had incorrect indentation. This
patch fixes this.

2017-02-02 Tom Tromey <tom@tromey.com>

* rust-lang.c: Reindent.

Change Summary

Incremental Difference

--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,9 @@
11 2017-02-02 Tom Tromey <tom@tromey.com>
22
3+ * rust-lang.c: Reindent.
4+
5+2017-02-02 Tom Tromey <tom@tromey.com>
6+
37 * rust-lang.h (rust_crate_for_block): Update.
48 * rust-lang.c (rust_crate_for_block): Return std::string.
59 (rust_get_disr_info): Use std:;string, not
--- a/gdb/rust-lang.c
+++ b/gdb/rust-lang.c
@@ -100,7 +100,7 @@ rust_union_is_untagged (struct type *type)
100100 if (TYPE_NFIELDS (type) == 0)
101101 return false;
102102 /* If the first field is named, but the name has the rust enum prefix,
103- it is an enum. */
103+ it is an enum. */
104104 if (strncmp (TYPE_FIELD_NAME (type, 0), RUST_ENUM_PREFIX,
105105 strlen (RUST_ENUM_PREFIX)) == 0)
106106 return false;
@@ -514,8 +514,8 @@ val_print_struct (struct type *type, int embedded_offset,
514514
515515 if (options->prettyformat)
516516 {
517- fputs_filtered ("\n", stream);
518- print_spaces_filtered (2 + 2 * recurse, stream);
517+ fputs_filtered ("\n", stream);
518+ print_spaces_filtered (2 + 2 * recurse, stream);
519519 }
520520 else if (!first_field)
521521 fputs_filtered (" ", stream);
@@ -524,15 +524,15 @@ val_print_struct (struct type *type, int embedded_offset,
524524
525525 if (!is_tuple && !is_tuple_struct)
526526 {
527- fputs_filtered (TYPE_FIELD_NAME (type, i), stream);
528- fputs_filtered (": ", stream);
527+ fputs_filtered (TYPE_FIELD_NAME (type, i), stream);
528+ fputs_filtered (": ", stream);
529529 }
530530
531531 val_print (TYPE_FIELD_TYPE (type, i),
532- embedded_offset + TYPE_FIELD_BITPOS (type, i) / 8,
533- address,
534- stream, recurse + 1, val, &opts,
535- current_language);
532+ embedded_offset + TYPE_FIELD_BITPOS (type, i) / 8,
533+ address,
534+ stream, recurse + 1, val, &opts,
535+ current_language);
536536 }
537537
538538 if (options->prettyformat)
@@ -659,17 +659,17 @@ rust_val_print (struct type *type, int embedded_offset,
659659 struct disr_info disr;
660660 struct value_print_options opts;
661661
662- /* Untagged unions are printed as if they are structs.
663- Since the field bit positions overlap in the debuginfo,
664- the code for printing a union is same as that for a struct,
665- the only difference is that the input type will have overlapping
666- fields. */
667- if (rust_union_is_untagged (type))
668- {
669- val_print_struct (type, embedded_offset, address, stream,
670- recurse, val, options);
671- break;
672- }
662+ /* Untagged unions are printed as if they are structs.
663+ Since the field bit positions overlap in the debuginfo,
664+ the code for printing a union is same as that for a struct,
665+ the only difference is that the input type will have overlapping
666+ fields. */
667+ if (rust_union_is_untagged (type))
668+ {
669+ val_print_struct (type, embedded_offset, address, stream,
670+ recurse, val, options);
671+ break;
672+ }
673673
674674 opts = *options;
675675 opts.deref_ref = 0;
@@ -760,62 +760,62 @@ rust_print_type (struct type *type, const char *varstring,
760760 /* Print a struct or union typedef. */
761761 static void
762762 rust_print_struct_def (struct type *type, const char *varstring,
763- struct ui_file *stream, int show, int level,
764- const struct type_print_options *flags)
763+ struct ui_file *stream, int show, int level,
764+ const struct type_print_options *flags)
765765 {
766- int is_tuple_struct, i;
766+ int is_tuple_struct, i;
767767
768- /* Print a tuple type simply. */
769- if (rust_tuple_type_p (type))
770- {
771- fputs_filtered (TYPE_TAG_NAME (type), stream);
772- return;
773- }
768+ /* Print a tuple type simply. */
769+ if (rust_tuple_type_p (type))
770+ {
771+ fputs_filtered (TYPE_TAG_NAME (type), stream);
772+ return;
773+ }
774774
775- /* If we see a base class, delegate to C. */
776- if (TYPE_N_BASECLASSES (type) > 0)
777- c_print_type (type, varstring, stream, show, level, flags);
775+ /* If we see a base class, delegate to C. */
776+ if (TYPE_N_BASECLASSES (type) > 0)
777+ c_print_type (type, varstring, stream, show, level, flags);
778778
779779 /* This code path is also used by unions. */
780780 if (TYPE_CODE (type) == TYPE_CODE_STRUCT)
781- fputs_filtered ("struct ", stream);
781+ fputs_filtered ("struct ", stream);
782782 else
783- fputs_filtered ("union ", stream);
783+ fputs_filtered ("union ", stream);
784784
785- if (TYPE_TAG_NAME (type) != NULL)
786- fputs_filtered (TYPE_TAG_NAME (type), stream);
785+ if (TYPE_TAG_NAME (type) != NULL)
786+ fputs_filtered (TYPE_TAG_NAME (type), stream);
787787
788- is_tuple_struct = rust_tuple_struct_type_p (type);
788+ is_tuple_struct = rust_tuple_struct_type_p (type);
789789
790- if (TYPE_NFIELDS (type) == 0 && !rust_tuple_type_p (type))
791- return;
792- fputs_filtered (is_tuple_struct ? " (\n" : " {\n", stream);
790+ if (TYPE_NFIELDS (type) == 0 && !rust_tuple_type_p (type))
791+ return;
792+ fputs_filtered (is_tuple_struct ? " (\n" : " {\n", stream);
793793
794- for (i = 0; i < TYPE_NFIELDS (type); ++i)
795- {
796- const char *name;
794+ for (i = 0; i < TYPE_NFIELDS (type); ++i)
795+ {
796+ const char *name;
797797
798- QUIT;
799- if (field_is_static (&TYPE_FIELD (type, i)))
800- continue;
801-
802- /* We'd like to print "pub" here as needed, but rustc
803- doesn't emit the debuginfo, and our types don't have
804- cplus_struct_type attached. */
805-
806- /* For a tuple struct we print the type but nothing
807- else. */
808- print_spaces_filtered (level + 2, stream);
809- if (!is_tuple_struct)
810- fprintf_filtered (stream, "%s: ", TYPE_FIELD_NAME (type, i));
811-
812- rust_print_type (TYPE_FIELD_TYPE (type, i), NULL,
813- stream, show - 1, level + 2,
814- flags);
815- fputs_filtered (",\n", stream);
816- }
798+ QUIT;
799+ if (field_is_static (&TYPE_FIELD (type, i)))
800+ continue;
801+
802+ /* We'd like to print "pub" here as needed, but rustc
803+ doesn't emit the debuginfo, and our types don't have
804+ cplus_struct_type attached. */
805+
806+ /* For a tuple struct we print the type but nothing
807+ else. */
808+ print_spaces_filtered (level + 2, stream);
809+ if (!is_tuple_struct)
810+ fprintf_filtered (stream, "%s: ", TYPE_FIELD_NAME (type, i));
811+
812+ rust_print_type (TYPE_FIELD_TYPE (type, i), NULL,
813+ stream, show - 1, level + 2,
814+ flags);
815+ fputs_filtered (",\n", stream);
816+ }
817817
818- fprintfi_filtered (level, stream, is_tuple_struct ? ")" : "}");
818+ fprintfi_filtered (level, stream, is_tuple_struct ? ")" : "}");
819819 }
820820
821821 /* la_print_typedef implementation for Rust. */
@@ -906,7 +906,7 @@ rust_print_type (struct type *type, const char *varstring,
906906 break;
907907
908908 case TYPE_CODE_STRUCT:
909- rust_print_struct_def (type, varstring, stream, show, level, flags);
909+ rust_print_struct_def (type, varstring, stream, show, level, flags);
910910 break;
911911
912912 case TYPE_CODE_ENUM:
@@ -947,15 +947,15 @@ rust_print_type (struct type *type, const char *varstring,
947947 /* Skip the discriminant field. */
948948 int skip_to = 1;
949949
950- /* Unions and structs have the same syntax in Rust,
951- the only difference is that structs are declared with `struct`
952- and union with `union`. This difference is handled in the struct
953- printer. */
954- if (rust_union_is_untagged (type))
955- {
956- rust_print_struct_def (type, varstring, stream, show, level, flags);
957- break;
958- }
950+ /* Unions and structs have the same syntax in Rust,
951+ the only difference is that structs are declared with `struct`
952+ and union with `union`. This difference is handled in the struct
953+ printer. */
954+ if (rust_union_is_untagged (type))
955+ {
956+ rust_print_struct_def (type, varstring, stream, show, level, flags);
957+ break;
958+ }
959959
960960 fputs_filtered ("enum ", stream);
961961 if (TYPE_TAG_NAME (type) != NULL)