Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(693)

Side by Side Diff: gdb/gdbtypes.h

Issue 11969036: Merge GDB 7.5.1 (Closed) Base URL: http://git.chromium.org/native_client/nacl-gdb.git@master
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « gdb/gdbthread.h ('k') | gdb/gdbtypes.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* Internal type definitions for GDB. 1 /* Internal type definitions for GDB.
2 2
3 Copyright (C) 1992-2004, 2006-2012 Free Software Foundation, Inc. 3 Copyright (C) 1992-2004, 2006-2012 Free Software Foundation, Inc.
4 4
5 Contributed by Cygnus Support, using pieces from other GDB modules. 5 Contributed by Cygnus Support, using pieces from other GDB modules.
6 6
7 This file is part of GDB. 7 This file is part of GDB.
8 8
9 This program is free software; you can redistribute it and/or modify 9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by 10 it under the terms of the GNU General Public License as published by
(...skipping 12 matching lines...) Expand all
23 #define GDBTYPES_H 1 23 #define GDBTYPES_H 1
24 24
25 #include "hashtab.h" 25 #include "hashtab.h"
26 26
27 /* Forward declarations for prototypes. */ 27 /* Forward declarations for prototypes. */
28 struct field; 28 struct field;
29 struct block; 29 struct block;
30 struct value_print_options; 30 struct value_print_options;
31 struct language_defn; 31 struct language_defn;
32 32
33 /* These declarations are DWARF-specific as some of the gdbtypes.h data types
34 are already DWARF-specific. */
35
36 /* Offset relative to the start of its containing CU (compilation unit). */
37 typedef struct
38 {
39 unsigned int cu_off;
40 } cu_offset;
41
42 /* Offset relative to the start of its .debug_info or .debug_types section. */
43 typedef struct
44 {
45 unsigned int sect_off;
46 } sect_offset;
47
33 /* Some macros for char-based bitfields. */ 48 /* Some macros for char-based bitfields. */
34 49
35 #define B_SET(a,x) ((a)[(x)>>3] |= (1 << ((x)&7))) 50 #define B_SET(a,x) ((a)[(x)>>3] |= (1 << ((x)&7)))
36 #define B_CLR(a,x) ((a)[(x)>>3] &= ~(1 << ((x)&7))) 51 #define B_CLR(a,x) ((a)[(x)>>3] &= ~(1 << ((x)&7)))
37 #define B_TST(a,x) ((a)[(x)>>3] & (1 << ((x)&7))) 52 #define B_TST(a,x) ((a)[(x)>>3] & (1 << ((x)&7)))
38 #define B_TYPE unsigned char 53 #define B_TYPE unsigned char
39 #define B_BYTES(x) ( 1 + ((x)>>3) ) 54 #define B_BYTES(x) ( 1 + ((x)>>3) )
40 #define B_CLRALL(a,x) memset ((a), 0, B_BYTES(x)) 55 #define B_CLRALL(a,x) memset ((a), 0, B_BYTES(x))
41 56
42 /* Different kinds of data types are distinguished by the `code' field. */ 57 /* Different kinds of data types are distinguished by the `code' field. */
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 #define TYPE_OBJFILE_OWNED(t) (TYPE_MAIN_TYPE (t)->flag_objfile_owned) 298 #define TYPE_OBJFILE_OWNED(t) (TYPE_MAIN_TYPE (t)->flag_objfile_owned)
284 #define TYPE_OWNER(t) TYPE_MAIN_TYPE(t)->owner 299 #define TYPE_OWNER(t) TYPE_MAIN_TYPE(t)->owner
285 #define TYPE_OBJFILE(t) (TYPE_OBJFILE_OWNED(t)? TYPE_OWNER(t).objfile : NULL) 300 #define TYPE_OBJFILE(t) (TYPE_OBJFILE_OWNED(t)? TYPE_OWNER(t).objfile : NULL)
286 301
287 /* True if this type was declared using the "class" keyword. This is 302 /* True if this type was declared using the "class" keyword. This is
288 only valid for C++ structure types, and only used for displaying 303 only valid for C++ structure types, and only used for displaying
289 the type. If false, the structure was declared as a "struct". */ 304 the type. If false, the structure was declared as a "struct". */
290 305
291 #define TYPE_DECLARED_CLASS(t) (TYPE_MAIN_TYPE (t)->flag_declared_class) 306 #define TYPE_DECLARED_CLASS(t) (TYPE_MAIN_TYPE (t)->flag_declared_class)
292 307
308 /* True if this type is a "flag" enum. A flag enum is one where all
309 the values are pairwise disjoint when "and"ed together. This
310 affects how enum values are printed. */
311
312 #define TYPE_FLAG_ENUM(t) (TYPE_MAIN_TYPE (t)->flag_flag_enum)
313
293 /* Constant type. If this is set, the corresponding type has a 314 /* Constant type. If this is set, the corresponding type has a
294 const modifier. */ 315 const modifier. */
295 316
296 #define TYPE_CONST(t) (TYPE_INSTANCE_FLAGS (t) & TYPE_INSTANCE_FLAG_CONST) 317 #define TYPE_CONST(t) (TYPE_INSTANCE_FLAGS (t) & TYPE_INSTANCE_FLAG_CONST)
297 318
298 /* Volatile type. If this is set, the corresponding type has a 319 /* Volatile type. If this is set, the corresponding type has a
299 volatile modifier. */ 320 volatile modifier. */
300 321
301 #define TYPE_VOLATILE(t) \ 322 #define TYPE_VOLATILE(t) \
302 (TYPE_INSTANCE_FLAGS (t) & TYPE_INSTANCE_FLAG_VOLATILE) 323 (TYPE_INSTANCE_FLAGS (t) & TYPE_INSTANCE_FLAG_VOLATILE)
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 #define TYPE_INSTANCE_FLAG_ADDRESS_CLASS_ALL \ 359 #define TYPE_INSTANCE_FLAG_ADDRESS_CLASS_ALL \
339 (TYPE_INSTANCE_FLAG_ADDRESS_CLASS_1 | TYPE_INSTANCE_FLAG_ADDRESS_CLASS_2) 360 (TYPE_INSTANCE_FLAG_ADDRESS_CLASS_1 | TYPE_INSTANCE_FLAG_ADDRESS_CLASS_2)
340 #define TYPE_ADDRESS_CLASS_ALL(t) (TYPE_INSTANCE_FLAGS(t) \ 361 #define TYPE_ADDRESS_CLASS_ALL(t) (TYPE_INSTANCE_FLAGS(t) \
341 & TYPE_INSTANCE_FLAG_ADDRESS_CLASS_ALL) 362 & TYPE_INSTANCE_FLAG_ADDRESS_CLASS_ALL)
342 363
343 /* Determine which field of the union main_type.fields[x].loc is used. */ 364 /* Determine which field of the union main_type.fields[x].loc is used. */
344 365
345 enum field_loc_kind 366 enum field_loc_kind
346 { 367 {
347 FIELD_LOC_KIND_BITPOS, /* bitpos */ 368 FIELD_LOC_KIND_BITPOS, /* bitpos */
369 FIELD_LOC_KIND_ENUMVAL, /* enumval */
348 FIELD_LOC_KIND_PHYSADDR, /* physaddr */ 370 FIELD_LOC_KIND_PHYSADDR, /* physaddr */
349 FIELD_LOC_KIND_PHYSNAME, /* physname */ 371 FIELD_LOC_KIND_PHYSNAME, /* physname */
350 FIELD_LOC_KIND_DWARF_BLOCK /* dwarf_block */ 372 FIELD_LOC_KIND_DWARF_BLOCK /* dwarf_block */
351 }; 373 };
352 374
353 /* A discriminant to determine which field in the main_type.type_specific 375 /* A discriminant to determine which field in the main_type.type_specific
354 union is being used, if any. 376 union is being used, if any.
355 377
356 For types such as TYPE_CODE_FLT or TYPE_CODE_FUNC, the use of this 378 For types such as TYPE_CODE_FLT or TYPE_CODE_FUNC, the use of this
357 discriminant is really redundant, as we know from the type code 379 discriminant is really redundant, as we know from the type code
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 unsigned int flag_varargs : 1; 415 unsigned int flag_varargs : 1;
394 unsigned int flag_vector : 1; 416 unsigned int flag_vector : 1;
395 unsigned int flag_stub_supported : 1; 417 unsigned int flag_stub_supported : 1;
396 unsigned int flag_gnu_ifunc : 1; 418 unsigned int flag_gnu_ifunc : 1;
397 unsigned int flag_fixed_instance : 1; 419 unsigned int flag_fixed_instance : 1;
398 unsigned int flag_objfile_owned : 1; 420 unsigned int flag_objfile_owned : 1;
399 /* True if this type was declared with "class" rather than 421 /* True if this type was declared with "class" rather than
400 "struct". */ 422 "struct". */
401 unsigned int flag_declared_class : 1; 423 unsigned int flag_declared_class : 1;
402 424
425 /* True if this is an enum type with disjoint values. This affects
426 how the enum is printed. */
427
428 unsigned int flag_flag_enum : 1;
429
403 /* A discriminant telling us which field of the type_specific union 430 /* A discriminant telling us which field of the type_specific union
404 is being used for this type, if any. */ 431 is being used for this type, if any. */
405 ENUM_BITFIELD(type_specific_kind) type_specific_field : 3; 432 ENUM_BITFIELD(type_specific_kind) type_specific_field : 3;
406 433
407 /* Number of fields described for this type. This field appears at 434 /* Number of fields described for this type. This field appears at
408 this location because it packs nicely here. */ 435 this location because it packs nicely here. */
409 436
410 short nfields; 437 short nfields;
411 438
412 /* Field number of the virtual function table pointer in 439 /* Field number of the virtual function table pointer in
413 VPTR_BASETYPE. If -1, we were unable to find the virtual 440 VPTR_BASETYPE. If -1, we were unable to find the virtual
414 function table pointer in initial symbol reading, and 441 function table pointer in initial symbol reading, and
415 get_vptr_fieldno should be called to find it if possible. 442 get_vptr_fieldno should be called to find it if possible.
416 get_vptr_fieldno will update this field if possible. 443 get_vptr_fieldno will update this field if possible.
417 Otherwise the value is left at -1. 444 Otherwise the value is left at -1.
418 445
419 Unused if this type does not have virtual functions. 446 Unused if this type does not have virtual functions.
420 447
421 This field appears at this location because it packs nicely here. */ 448 This field appears at this location because it packs nicely here. */
422 449
423 short vptr_fieldno; 450 short vptr_fieldno;
424 451
425 /* Name of this type, or NULL if none. 452 /* Name of this type, or NULL if none.
426 453
427 This is used for printing only, except by poorly designed C++ code. 454 This is used for printing only, except by poorly designed C++ code.
428 For looking up a name, look for a symbol in the VAR_DOMAIN. */ 455 For looking up a name, look for a symbol in the VAR_DOMAIN.
456 This is generally allocated in the objfile's obstack.
457 However coffread.c uses malloc. */
429 458
430 char *name; 459 const char *name;
431 460
432 /* Tag name for this type, or NULL if none. This means that the 461 /* Tag name for this type, or NULL if none. This means that the
433 name of the type consists of a keyword followed by the tag name. 462 name of the type consists of a keyword followed by the tag name.
434 Which keyword is determined by the type code ("struct" for 463 Which keyword is determined by the type code ("struct" for
435 TYPE_CODE_STRUCT, etc.). As far as I know C/C++ are the only languages 464 TYPE_CODE_STRUCT, etc.). As far as I know C/C++ are the only languages
436 with this feature. 465 with this feature.
437 466
438 This is used for printing only, except by poorly designed C++ code. 467 This is used for printing only, except by poorly designed C++ code.
439 For looking up a name, look for a symbol in the STRUCT_DOMAIN. 468 For looking up a name, look for a symbol in the STRUCT_DOMAIN.
440 One more legitimate use is that if TYPE_FLAG_STUB is set, this is 469 One more legitimate use is that if TYPE_FLAG_STUB is set, this is
441 the name to use to look for definitions in other files. */ 470 the name to use to look for definitions in other files. */
442 471
443 char *tag_name; 472 const char *tag_name;
444 473
445 /* Every type is now associated with a particular objfile, and the 474 /* Every type is now associated with a particular objfile, and the
446 type is allocated on the objfile_obstack for that objfile. One problem 475 type is allocated on the objfile_obstack for that objfile. One problem
447 however, is that there are times when gdb allocates new types while 476 however, is that there are times when gdb allocates new types while
448 it is not in the process of reading symbols from a particular objfile. 477 it is not in the process of reading symbols from a particular objfile.
449 Fortunately, these happen when the type being created is a derived 478 Fortunately, these happen when the type being created is a derived
450 type of an existing type, such as in lookup_pointer_type(). So 479 type of an existing type, such as in lookup_pointer_type(). So
451 we can just allocate the new type using the same objfile as the 480 we can just allocate the new type using the same objfile as the
452 existing type, but to do this we need a backpointer to the objfile 481 existing type, but to do this we need a backpointer to the objfile
453 from the existing type. Yes this is somewhat ugly, but without 482 from the existing type. Yes this is somewhat ugly, but without
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 union 520 union
492 { 521 {
493 struct field 522 struct field
494 { 523 {
495 union field_location 524 union field_location
496 { 525 {
497 /* Position of this field, counting in bits from start of 526 /* Position of this field, counting in bits from start of
498 containing structure. For gdbarch_bits_big_endian=1 527 containing structure. For gdbarch_bits_big_endian=1
499 targets, it is the bit offset to the MSB. For 528 targets, it is the bit offset to the MSB. For
500 gdbarch_bits_big_endian=0 targets, it is the bit offset to 529 gdbarch_bits_big_endian=0 targets, it is the bit offset to
501 » the LSB. For a range bound or enum value, this is the 530 » the LSB. */
502 » value itself. */
503 531
504 int bitpos; 532 int bitpos;
505 533
534 /* Enum value. */
535 LONGEST enumval;
536
506 /* For a static field, if TYPE_FIELD_STATIC_HAS_ADDR then physaddr 537 /* For a static field, if TYPE_FIELD_STATIC_HAS_ADDR then physaddr
507 is the location (in the target) of the static field. 538 is the location (in the target) of the static field.
508 Otherwise, physname is the mangled label of the static field. */ 539 Otherwise, physname is the mangled label of the static field. */
509 540
510 CORE_ADDR physaddr; 541 CORE_ADDR physaddr;
511 const char *physname; 542 const char *physname;
512 543
513 /* The field location can be computed by evaluating the following DWARF 544 /* The field location can be computed by evaluating the following DWARF
514 block. Its DATA is allocated on objfile_obstack - no CU load is 545 block. Its DATA is allocated on objfile_obstack - no CU load is
515 needed to access it. */ 546 needed to access it. */
516 547
517 struct dwarf2_locexpr_baton *dwarf_block; 548 struct dwarf2_locexpr_baton *dwarf_block;
518 } 549 }
519 loc; 550 loc;
520 551
521 /* For a function or member type, this is 1 if the argument is marked 552 /* For a function or member type, this is 1 if the argument is marked
522 artificial. Artificial arguments should not be shown to the 553 artificial. Artificial arguments should not be shown to the
523 user. For TYPE_CODE_RANGE it is set if the specific bound is not 554 user. For TYPE_CODE_RANGE it is set if the specific bound is not
524 defined. */ 555 defined. */
525 unsigned int artificial : 1; 556 unsigned int artificial : 1;
526 557
527 /* Discriminant for union field_location. */ 558 /* Discriminant for union field_location. */
528 ENUM_BITFIELD(field_loc_kind) loc_kind : 2; 559 ENUM_BITFIELD(field_loc_kind) loc_kind : 3;
529 560
530 /* Size of this field, in bits, or zero if not packed. 561 /* Size of this field, in bits, or zero if not packed.
531 If non-zero in an array type, indicates the element size in 562 If non-zero in an array type, indicates the element size in
532 bits (used only in Ada at the moment). 563 bits (used only in Ada at the moment).
533 For an unpacked field, the field's type's length 564 For an unpacked field, the field's type's length
534 says how many bytes the field occupies. */ 565 says how many bytes the field occupies. */
535 566
536 unsigned int bitsize : 29; 567 unsigned int bitsize : 28;
537 568
538 /* In a struct or union type, type of this field. 569 /* In a struct or union type, type of this field.
539 In a function or member type, type of this argument. 570 In a function or member type, type of this argument.
540 In an array type, the domain-type of the array. */ 571 In an array type, the domain-type of the array. */
541 572
542 struct type *type; 573 struct type *type;
543 574
544 /* Name of field, value or argument. 575 /* Name of field, value or argument.
545 NULL for range bounds, array domains, and member function 576 NULL for range bounds, array domains, and member function
546 arguments. */ 577 arguments. */
547 578
548 char *name; 579 const char *name;
549 } *fields; 580 } *fields;
550 581
551 /* Union member used for range types. */ 582 /* Union member used for range types. */
552 583
553 struct range_bounds 584 struct range_bounds
554 { 585 {
555 /* Low bound of range. */ 586 /* Low bound of range. */
556 587
557 LONGEST low; 588 LONGEST low;
558 589
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
686 the struct type). I think only the `type' field of such a field has 717 the struct type). I think only the `type' field of such a field has
687 any meaning. */ 718 any meaning. */
688 719
689 short n_baseclasses; 720 short n_baseclasses;
690 721
691 /* Number of methods with unique names. All overloaded methods with 722 /* Number of methods with unique names. All overloaded methods with
692 the same name count only once. */ 723 the same name count only once. */
693 724
694 short nfn_fields; 725 short nfn_fields;
695 726
696 /* Number of methods described for this type, not including the
697 methods that it derives from. */
698
699 short nfn_fields_total;
700
701 /* Number of template arguments. */ 727 /* Number of template arguments. */
702 unsigned short n_template_arguments; 728 unsigned short n_template_arguments;
703 729
704 /* One if this struct is a dynamic class, as defined by the 730 /* One if this struct is a dynamic class, as defined by the
705 Itanium C++ ABI: if it requires a virtual table pointer, 731 Itanium C++ ABI: if it requires a virtual table pointer,
706 because it or any of its base classes have one or more virtual 732 because it or any of its base classes have one or more virtual
707 member functions or virtual base classes. Minus one if not 733 member functions or virtual base classes. Minus one if not
708 dynamic. Zero if not yet computed. */ 734 dynamic. Zero if not yet computed. */
709 int is_dynamic : 2; 735 int is_dynamic : 2;
710 736
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
748 /* For classes, structures, and unions, a description of each field, 774 /* For classes, structures, and unions, a description of each field,
749 which consists of an overloaded name, followed by the types of 775 which consists of an overloaded name, followed by the types of
750 arguments that the method expects, and then the name after it 776 arguments that the method expects, and then the name after it
751 has been renamed to make it distinct. 777 has been renamed to make it distinct.
752 778
753 fn_fieldlists points to an array of nfn_fields of these. */ 779 fn_fieldlists points to an array of nfn_fields of these. */
754 780
755 struct fn_fieldlist 781 struct fn_fieldlist
756 { 782 {
757 783
758 » /* The overloaded name. */ 784 » /* The overloaded name.
785 » This is generally allocated in the objfile's obstack.
786 » However stabsread.c sometimes uses malloc. */
759 787
760 » char *name; 788 » const char *name;
761 789
762 /* The number of methods with this name. */ 790 /* The number of methods with this name. */
763 791
764 int length; 792 int length;
765 793
766 /* The list of methods. */ 794 /* The list of methods. */
767 795
768 struct fn_field 796 struct fn_field
769 { 797 {
770 798
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
849 } 877 }
850 *typedef_field; 878 *typedef_field;
851 unsigned typedef_field_count; 879 unsigned typedef_field_count;
852 880
853 /* The template arguments. This is an array with 881 /* The template arguments. This is an array with
854 N_TEMPLATE_ARGUMENTS elements. This is NULL for non-template 882 N_TEMPLATE_ARGUMENTS elements. This is NULL for non-template
855 classes. */ 883 classes. */
856 struct symbol **template_arguments; 884 struct symbol **template_arguments;
857 }; 885 };
858 886
859 /* Struct used in computing virtual base list. */
860 struct vbase
861 {
862 struct type *vbasetype; /* pointer to virtual base */
863 struct vbase *next; /* next in chain */
864 };
865
866 /* Struct used to store conversion rankings. */ 887 /* Struct used to store conversion rankings. */
867 struct rank 888 struct rank
868 { 889 {
869 short rank; 890 short rank;
870 891
871 /* When two conversions are of the same type and therefore have the same 892 /* When two conversions are of the same type and therefore have the same
872 rank, subrank is used to differentiate the two. 893 rank, subrank is used to differentiate the two.
873 Eg: Two derived-class-pointer to base-class-pointer conversions would 894 Eg: Two derived-class-pointer to base-class-pointer conversions would
874 both have base pointer conversion rank, but the conversion with the 895 both have base pointer conversion rank, but the conversion with the
875 shorter distance to the ancestor is preferable. 'subrank' would be used 896 shorter distance to the ancestor is preferable. 'subrank' would be used
(...skipping 26 matching lines...) Expand all
902 unsigned calling_convention; 923 unsigned calling_convention;
903 924
904 /* Only those DW_TAG_GNU_call_site's in this function that have 925 /* Only those DW_TAG_GNU_call_site's in this function that have
905 DW_AT_GNU_tail_call set are linked in this list. Function without its 926 DW_AT_GNU_tail_call set are linked in this list. Function without its
906 tail call list complete (DW_AT_GNU_all_tail_call_sites or its superset 927 tail call list complete (DW_AT_GNU_all_tail_call_sites or its superset
907 DW_AT_GNU_all_call_sites) has TAIL_CALL_LIST NULL, even if some 928 DW_AT_GNU_all_call_sites) has TAIL_CALL_LIST NULL, even if some
908 DW_TAG_GNU_call_site's exist in such function. */ 929 DW_TAG_GNU_call_site's exist in such function. */
909 struct call_site *tail_call_list; 930 struct call_site *tail_call_list;
910 }; 931 };
911 932
933 /* struct call_site_parameter can be referenced in callees by several ways. */
934
935 enum call_site_parameter_kind
936 {
937 /* Use field call_site_parameter.u.dwarf_reg. */
938 CALL_SITE_PARAMETER_DWARF_REG,
939
940 /* Use field call_site_parameter.u.fb_offset. */
941 CALL_SITE_PARAMETER_FB_OFFSET,
942
943 /* Use field call_site_parameter.u.param_offset. */
944 CALL_SITE_PARAMETER_PARAM_OFFSET
945 };
946
912 /* A place where a function gets called from, represented by 947 /* A place where a function gets called from, represented by
913 DW_TAG_GNU_call_site. It can be looked up from symtab->call_site_htab. */ 948 DW_TAG_GNU_call_site. It can be looked up from symtab->call_site_htab. */
914 949
915 struct call_site 950 struct call_site
916 { 951 {
917 /* Address of the first instruction after this call. It must be the first 952 /* Address of the first instruction after this call. It must be the first
918 field as we overload core_addr_hash and core_addr_eq for it. */ 953 field as we overload core_addr_hash and core_addr_eq for it. */
919 CORE_ADDR pc; 954 CORE_ADDR pc;
920 955
921 /* List successor with head in FUNC_TYPE.TAIL_CALL_LIST. */ 956 /* List successor with head in FUNC_TYPE.TAIL_CALL_LIST. */
922 struct call_site *tail_call_next; 957 struct call_site *tail_call_next;
923 958
924 /* Describe DW_AT_GNU_call_site_target. Missing attribute uses 959 /* Describe DW_AT_GNU_call_site_target. Missing attribute uses
925 FIELD_LOC_KIND_DWARF_BLOCK with FIELD_DWARF_BLOCK == NULL. */ 960 FIELD_LOC_KIND_DWARF_BLOCK with FIELD_DWARF_BLOCK == NULL. */
926 struct 961 struct
927 { 962 {
928 union field_location loc; 963 union field_location loc;
929 964
930 /* Discriminant for union field_location. */ 965 /* Discriminant for union field_location. */
931 » ENUM_BITFIELD(field_loc_kind) loc_kind : 2; 966 » ENUM_BITFIELD(field_loc_kind) loc_kind : 3;
932 } 967 }
933 target; 968 target;
934 969
935 /* Size of the PARAMETER array. */ 970 /* Size of the PARAMETER array. */
936 unsigned parameter_count; 971 unsigned parameter_count;
937 972
938 /* CU of the function where the call is located. It gets used for DWARF 973 /* CU of the function where the call is located. It gets used for DWARF
939 blocks execution in the parameter array below. */ 974 blocks execution in the parameter array below. */
940 struct dwarf2_per_cu_data *per_cu; 975 struct dwarf2_per_cu_data *per_cu;
941 976
942 /* Describe DW_TAG_GNU_call_site's DW_TAG_formal_parameter. */ 977 /* Describe DW_TAG_GNU_call_site's DW_TAG_formal_parameter. */
943 struct call_site_parameter 978 struct call_site_parameter
944 { 979 {
945 » /* DW_TAG_formal_parameter's DW_AT_location's DW_OP_regX as DWARF 980 » ENUM_BITFIELD (call_site_parameter_kind) kind : 2;
946 » register number, for register passed parameters. If -1 then use
947 » fb_offset. */
948 » int dwarf_reg;
949 981
950 » /* Offset from the callee's frame base, for stack passed parameters. 982 » union call_site_parameter_u
951 » This equals offset from the caller's stack pointer. Valid only if 983 » {
952 » DWARF_REGNUM is -1. */ 984 » /* DW_TAG_formal_parameter's DW_AT_location's DW_OP_regX as DWARF
953 » CORE_ADDR fb_offset; 985 » register number, for register passed parameters. */
986 » int dwarf_reg;
987
988 » /* Offset from the callee's frame base, for stack passed parameters.
989 » This equals offset from the caller's stack pointer. */
990 » CORE_ADDR fb_offset;
991
992 » /* Offset relative to the start of this PER_CU to
993 » DW_TAG_formal_parameter which is referenced by both caller and
994 » the callee. */
995 » cu_offset param_offset;
996 » }
997 » u;
954 998
955 /* DW_TAG_formal_parameter's DW_AT_GNU_call_site_value. It is never 999 /* DW_TAG_formal_parameter's DW_AT_GNU_call_site_value. It is never
956 NULL. */ 1000 NULL. */
957 const gdb_byte *value; 1001 const gdb_byte *value;
958 size_t value_size; 1002 size_t value_size;
959 1003
960 /* DW_TAG_formal_parameter's DW_AT_GNU_call_site_data_value. It may be 1004 /* DW_TAG_formal_parameter's DW_AT_GNU_call_site_data_value. It may be
961 NULL if not provided by DWARF. */ 1005 NULL if not provided by DWARF. */
962 const gdb_byte *data_value; 1006 const gdb_byte *data_value;
963 size_t data_value_size; 1007 size_t data_value_size;
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
1043 #define TYPE_ARRAY_LOWER_BOUND_VALUE(arraytype) \ 1087 #define TYPE_ARRAY_LOWER_BOUND_VALUE(arraytype) \
1044 (TYPE_LOW_BOUND(TYPE_INDEX_TYPE((arraytype)))) 1088 (TYPE_LOW_BOUND(TYPE_INDEX_TYPE((arraytype))))
1045 1089
1046 /* C++ */ 1090 /* C++ */
1047 1091
1048 #define TYPE_VPTR_BASETYPE(thistype) TYPE_MAIN_TYPE(thistype)->vptr_basetype 1092 #define TYPE_VPTR_BASETYPE(thistype) TYPE_MAIN_TYPE(thistype)->vptr_basetype
1049 #define TYPE_DOMAIN_TYPE(thistype) TYPE_MAIN_TYPE(thistype)->vptr_basetype 1093 #define TYPE_DOMAIN_TYPE(thistype) TYPE_MAIN_TYPE(thistype)->vptr_basetype
1050 #define TYPE_VPTR_FIELDNO(thistype) TYPE_MAIN_TYPE(thistype)->vptr_fieldno 1094 #define TYPE_VPTR_FIELDNO(thistype) TYPE_MAIN_TYPE(thistype)->vptr_fieldno
1051 #define TYPE_FN_FIELDS(thistype) TYPE_CPLUS_SPECIFIC(thistype)->fn_fields 1095 #define TYPE_FN_FIELDS(thistype) TYPE_CPLUS_SPECIFIC(thistype)->fn_fields
1052 #define TYPE_NFN_FIELDS(thistype) TYPE_CPLUS_SPECIFIC(thistype)->nfn_fields 1096 #define TYPE_NFN_FIELDS(thistype) TYPE_CPLUS_SPECIFIC(thistype)->nfn_fields
1053 #define TYPE_NFN_FIELDS_TOTAL(thistype) TYPE_CPLUS_SPECIFIC(thistype)->nfn_field s_total
1054 #define TYPE_SPECIFIC_FIELD(thistype) \ 1097 #define TYPE_SPECIFIC_FIELD(thistype) \
1055 TYPE_MAIN_TYPE(thistype)->type_specific_field 1098 TYPE_MAIN_TYPE(thistype)->type_specific_field
1056 #define TYPE_TYPE_SPECIFIC(thistype) TYPE_MAIN_TYPE(thistype)->type_specific 1099 #define TYPE_TYPE_SPECIFIC(thistype) TYPE_MAIN_TYPE(thistype)->type_specific
1057 /* We need this tap-dance with the TYPE_RAW_SPECIFIC because of the case 1100 /* We need this tap-dance with the TYPE_RAW_SPECIFIC because of the case
1058 where we're trying to print an Ada array using the C language. 1101 where we're trying to print an Ada array using the C language.
1059 In that case, there is no "cplus_stuff", but the C language assumes 1102 In that case, there is no "cplus_stuff", but the C language assumes
1060 that there is. What we do, in that case, is pretend that there is 1103 that there is. What we do, in that case, is pretend that there is
1061 an implicit one which is the default cplus stuff. */ 1104 an implicit one which is the default cplus stuff. */
1062 #define TYPE_CPLUS_SPECIFIC(thistype) \ 1105 #define TYPE_CPLUS_SPECIFIC(thistype) \
1063 (!HAVE_CPLUS_STRUCT(thistype) \ 1106 (!HAVE_CPLUS_STRUCT(thistype) \
(...skipping 14 matching lines...) Expand all
1078 #define TYPE_CPLUS_DYNAMIC(thistype) TYPE_CPLUS_SPECIFIC (thistype)->is_dynamic 1121 #define TYPE_CPLUS_DYNAMIC(thistype) TYPE_CPLUS_SPECIFIC (thistype)->is_dynamic
1079 #define TYPE_CPLUS_REALLY_JAVA(thistype) TYPE_CPLUS_SPECIFIC (thistype)->is_java 1122 #define TYPE_CPLUS_REALLY_JAVA(thistype) TYPE_CPLUS_SPECIFIC (thistype)->is_java
1080 1123
1081 #define BASETYPE_VIA_VIRTUAL(thistype, index) \ 1124 #define BASETYPE_VIA_VIRTUAL(thistype, index) \
1082 (TYPE_CPLUS_SPECIFIC(thistype)->virtual_field_bits == NULL ? 0 \ 1125 (TYPE_CPLUS_SPECIFIC(thistype)->virtual_field_bits == NULL ? 0 \
1083 : B_TST(TYPE_CPLUS_SPECIFIC(thistype)->virtual_field_bits, (index))) 1126 : B_TST(TYPE_CPLUS_SPECIFIC(thistype)->virtual_field_bits, (index)))
1084 1127
1085 #define FIELD_TYPE(thisfld) ((thisfld).type) 1128 #define FIELD_TYPE(thisfld) ((thisfld).type)
1086 #define FIELD_NAME(thisfld) ((thisfld).name) 1129 #define FIELD_NAME(thisfld) ((thisfld).name)
1087 #define FIELD_LOC_KIND(thisfld) ((thisfld).loc_kind) 1130 #define FIELD_LOC_KIND(thisfld) ((thisfld).loc_kind)
1088 #define FIELD_BITPOS(thisfld) ((thisfld).loc.bitpos) 1131 #define FIELD_BITPOS_LVAL(thisfld) ((thisfld).loc.bitpos)
1132 #define FIELD_BITPOS(thisfld) (FIELD_BITPOS_LVAL (thisfld) + 0)
1133 #define FIELD_ENUMVAL_LVAL(thisfld) ((thisfld).loc.enumval)
1134 #define FIELD_ENUMVAL(thisfld) (FIELD_ENUMVAL_LVAL (thisfld) + 0)
1089 #define FIELD_STATIC_PHYSNAME(thisfld) ((thisfld).loc.physname) 1135 #define FIELD_STATIC_PHYSNAME(thisfld) ((thisfld).loc.physname)
1090 #define FIELD_STATIC_PHYSADDR(thisfld) ((thisfld).loc.physaddr) 1136 #define FIELD_STATIC_PHYSADDR(thisfld) ((thisfld).loc.physaddr)
1091 #define FIELD_DWARF_BLOCK(thisfld) ((thisfld).loc.dwarf_block) 1137 #define FIELD_DWARF_BLOCK(thisfld) ((thisfld).loc.dwarf_block)
1092 #define SET_FIELD_BITPOS(thisfld, bitpos) \ 1138 #define SET_FIELD_BITPOS(thisfld, bitpos) \
1093 (FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_BITPOS, \ 1139 (FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_BITPOS, \
1094 FIELD_BITPOS (thisfld) = (bitpos)) 1140 FIELD_BITPOS_LVAL (thisfld) = (bitpos))
1141 #define SET_FIELD_ENUMVAL(thisfld, enumval)» » » \
1142 (FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_ENUMVAL,» » \
1143 FIELD_ENUMVAL_LVAL (thisfld) = (enumval))
1095 #define SET_FIELD_PHYSNAME(thisfld, name) \ 1144 #define SET_FIELD_PHYSNAME(thisfld, name) \
1096 (FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_PHYSNAME, \ 1145 (FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_PHYSNAME, \
1097 FIELD_STATIC_PHYSNAME (thisfld) = (name)) 1146 FIELD_STATIC_PHYSNAME (thisfld) = (name))
1098 #define SET_FIELD_PHYSADDR(thisfld, addr) \ 1147 #define SET_FIELD_PHYSADDR(thisfld, addr) \
1099 (FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_PHYSADDR, \ 1148 (FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_PHYSADDR, \
1100 FIELD_STATIC_PHYSADDR (thisfld) = (addr)) 1149 FIELD_STATIC_PHYSADDR (thisfld) = (addr))
1101 #define SET_FIELD_DWARF_BLOCK(thisfld, addr) \ 1150 #define SET_FIELD_DWARF_BLOCK(thisfld, addr) \
1102 (FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_DWARF_BLOCK, \ 1151 (FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_DWARF_BLOCK, \
1103 FIELD_DWARF_BLOCK (thisfld) = (addr)) 1152 FIELD_DWARF_BLOCK (thisfld) = (addr))
1104 #define FIELD_ARTIFICIAL(thisfld) ((thisfld).artificial) 1153 #define FIELD_ARTIFICIAL(thisfld) ((thisfld).artificial)
1105 #define FIELD_BITSIZE(thisfld) ((thisfld).bitsize) 1154 #define FIELD_BITSIZE(thisfld) ((thisfld).bitsize)
1106 1155
1107 #define TYPE_FIELD(thistype, n) TYPE_MAIN_TYPE(thistype)->flds_bnds.fields[n] 1156 #define TYPE_FIELD(thistype, n) TYPE_MAIN_TYPE(thistype)->flds_bnds.fields[n]
1108 #define TYPE_FIELD_TYPE(thistype, n) FIELD_TYPE(TYPE_FIELD(thistype, n)) 1157 #define TYPE_FIELD_TYPE(thistype, n) FIELD_TYPE(TYPE_FIELD(thistype, n))
1109 #define TYPE_FIELD_NAME(thistype, n) FIELD_NAME(TYPE_FIELD(thistype, n)) 1158 #define TYPE_FIELD_NAME(thistype, n) FIELD_NAME(TYPE_FIELD(thistype, n))
1110 #define TYPE_FIELD_LOC_KIND(thistype, n) FIELD_LOC_KIND (TYPE_FIELD (thistype, n )) 1159 #define TYPE_FIELD_LOC_KIND(thistype, n) FIELD_LOC_KIND (TYPE_FIELD (thistype, n ))
1111 #define TYPE_FIELD_BITPOS(thistype, n) FIELD_BITPOS (TYPE_FIELD (thistype, n)) 1160 #define TYPE_FIELD_BITPOS(thistype, n) FIELD_BITPOS (TYPE_FIELD (thistype, n))
1161 #define TYPE_FIELD_ENUMVAL(thistype, n) FIELD_ENUMVAL (TYPE_FIELD (thistype, n))
1112 #define TYPE_FIELD_STATIC_PHYSNAME(thistype, n) FIELD_STATIC_PHYSNAME (TYPE_FIEL D (thistype, n)) 1162 #define TYPE_FIELD_STATIC_PHYSNAME(thistype, n) FIELD_STATIC_PHYSNAME (TYPE_FIEL D (thistype, n))
1113 #define TYPE_FIELD_STATIC_PHYSADDR(thistype, n) FIELD_STATIC_PHYSADDR (TYPE_FIEL D (thistype, n)) 1163 #define TYPE_FIELD_STATIC_PHYSADDR(thistype, n) FIELD_STATIC_PHYSADDR (TYPE_FIEL D (thistype, n))
1114 #define TYPE_FIELD_DWARF_BLOCK(thistype, n) FIELD_DWARF_BLOCK (TYPE_FIELD (thist ype, n)) 1164 #define TYPE_FIELD_DWARF_BLOCK(thistype, n) FIELD_DWARF_BLOCK (TYPE_FIELD (thist ype, n))
1115 #define TYPE_FIELD_ARTIFICIAL(thistype, n) FIELD_ARTIFICIAL(TYPE_FIELD(thistype, n)) 1165 #define TYPE_FIELD_ARTIFICIAL(thistype, n) FIELD_ARTIFICIAL(TYPE_FIELD(thistype, n))
1116 #define TYPE_FIELD_BITSIZE(thistype, n) FIELD_BITSIZE(TYPE_FIELD(thistype,n)) 1166 #define TYPE_FIELD_BITSIZE(thistype, n) FIELD_BITSIZE(TYPE_FIELD(thistype,n))
1117 #define TYPE_FIELD_PACKED(thistype, n) (FIELD_BITSIZE(TYPE_FIELD(thistype,n))!=0 ) 1167 #define TYPE_FIELD_PACKED(thistype, n) (FIELD_BITSIZE(TYPE_FIELD(thistype,n))!=0 )
1118 1168
1119 #define TYPE_FIELD_PRIVATE_BITS(thistype) \ 1169 #define TYPE_FIELD_PRIVATE_BITS(thistype) \
1120 TYPE_CPLUS_SPECIFIC(thistype)->private_field_bits 1170 TYPE_CPLUS_SPECIFIC(thistype)->private_field_bits
1121 #define TYPE_FIELD_PROTECTED_BITS(thistype) \ 1171 #define TYPE_FIELD_PROTECTED_BITS(thistype) \
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
1449 struct type *to_type, struct field *args, 1499 struct type *to_type, struct field *args,
1450 int nargs, int varargs); 1500 int nargs, int varargs);
1451 1501
1452 extern void smash_to_memberptr_type (struct type *, struct type *, 1502 extern void smash_to_memberptr_type (struct type *, struct type *,
1453 struct type *); 1503 struct type *);
1454 1504
1455 extern void smash_to_methodptr_type (struct type *, struct type *); 1505 extern void smash_to_methodptr_type (struct type *, struct type *);
1456 1506
1457 extern struct type *allocate_stub_method (struct type *); 1507 extern struct type *allocate_stub_method (struct type *);
1458 1508
1459 extern char *type_name_no_tag (const struct type *); 1509 extern const char *type_name_no_tag (const struct type *);
1460 1510
1461 extern const char *type_name_no_tag_or_error (struct type *type); 1511 extern const char *type_name_no_tag_or_error (struct type *type);
1462 1512
1463 extern struct type *lookup_struct_elt_type (struct type *, char *, int); 1513 extern struct type *lookup_struct_elt_type (struct type *, char *, int);
1464 1514
1465 extern struct type *make_pointer_type (struct type *, struct type **); 1515 extern struct type *make_pointer_type (struct type *, struct type **);
1466 1516
1467 extern struct type *lookup_pointer_type (struct type *); 1517 extern struct type *lookup_pointer_type (struct type *);
1468 1518
1469 extern struct type *make_function_type (struct type *, struct type **); 1519 extern struct type *make_function_type (struct type *, struct type **);
1470 1520
1471 extern struct type *lookup_function_type (struct type *); 1521 extern struct type *lookup_function_type (struct type *);
1472 1522
1523 extern struct type *lookup_function_type_with_arguments (struct type *,
1524 int,
1525 struct type **);
1526
1473 extern struct type *create_range_type (struct type *, struct type *, LONGEST, 1527 extern struct type *create_range_type (struct type *, struct type *, LONGEST,
1474 LONGEST); 1528 LONGEST);
1475 1529
1476 extern struct type *create_array_type (struct type *, struct type *, 1530 extern struct type *create_array_type (struct type *, struct type *,
1477 struct type *); 1531 struct type *);
1478 extern struct type *lookup_array_range_type (struct type *, int, int); 1532 extern struct type *lookup_array_range_type (struct type *, int, int);
1479 1533
1480 extern struct type *create_string_type (struct type *, struct type *, 1534 extern struct type *create_string_type (struct type *, struct type *,
1481 struct type *); 1535 struct type *);
1482 extern struct type *lookup_string_range_type (struct type *, int, int); 1536 extern struct type *lookup_string_range_type (struct type *, int, int);
1483 1537
1484 extern struct type *create_set_type (struct type *, struct type *); 1538 extern struct type *create_set_type (struct type *, struct type *);
1485 1539
1486 extern struct type *lookup_unsigned_typename (const struct language_defn *, 1540 extern struct type *lookup_unsigned_typename (const struct language_defn *,
1487 » » » » » struct gdbarch *,char *); 1541 » » » » » struct gdbarch *, const char *);
1488 1542
1489 extern struct type *lookup_signed_typename (const struct language_defn *, 1543 extern struct type *lookup_signed_typename (const struct language_defn *,
1490 » » » » » struct gdbarch *,char *); 1544 » » » » » struct gdbarch *, const char *);
1491 1545
1492 extern struct type *check_typedef (struct type *); 1546 extern struct type *check_typedef (struct type *);
1493 1547
1494 #define CHECK_TYPEDEF(TYPE) \ 1548 #define CHECK_TYPEDEF(TYPE) \
1495 do { \ 1549 do { \
1496 (TYPE) = check_typedef (TYPE); \ 1550 (TYPE) = check_typedef (TYPE); \
1497 } while (0) 1551 } while (0)
1498 1552
1499 extern void check_stub_method_group (struct type *, int); 1553 extern void check_stub_method_group (struct type *, int);
1500 1554
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
1597 1651
1598 extern htab_t create_copied_types_hash (struct objfile *objfile); 1652 extern htab_t create_copied_types_hash (struct objfile *objfile);
1599 1653
1600 extern struct type *copy_type_recursive (struct objfile *objfile, 1654 extern struct type *copy_type_recursive (struct objfile *objfile,
1601 struct type *type, 1655 struct type *type,
1602 htab_t copied_types); 1656 htab_t copied_types);
1603 1657
1604 extern struct type *copy_type (const struct type *type); 1658 extern struct type *copy_type (const struct type *type);
1605 1659
1606 #endif /* GDBTYPES_H */ 1660 #endif /* GDBTYPES_H */
OLDNEW
« no previous file with comments | « gdb/gdbthread.h ('k') | gdb/gdbtypes.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698