Changeset 321
- Timestamp:
- Jun 11, 2003, 9:44:08 PM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/emx/src/emxomf/stabshll.c
-
Property cvs2svn:cvs-rev
changed from
1.9
to1.10
r320 r321 21 21 22 22 23 /******************************************************************************* 24 * Header Files * 25 *******************************************************************************/ 23 26 #include <stdio.h> 24 27 #include <stdlib.h> … … 31 34 #include "stabshll.h" 32 35 36 37 /******************************************************************************* 38 * Defined Constants And Macros * 39 *******************************************************************************/ 33 40 /* Field ID values for the type table. */ 34 41 … … 80 87 #define STRUC_FORWARD 0x01 /* Structure declared forward */ 81 88 89 90 /******************************************************************************* 91 * Structures and Typedefs * 92 *******************************************************************************/ 82 93 enum type_tag 83 94 { … … 259 270 #pragma pack() 260 271 272 273 /******************************************************************************* 274 * Global Variables * 275 *******************************************************************************/ 261 276 /* This variable points to the next character of a stabs type being 262 277 parsed. */ … … 351 366 /* kso #456 2003-06-11: Reversed quiet workaround. */ 352 367 #define no_warning warning 368 369 370 /******************************************************************************* 371 * Internal Functions * 372 *******************************************************************************/ 373 static void parse_typedef (int *index); 374 375 353 376 354 377 … … 910 933 911 934 #endif 935 936 937 /** 938 * Tries to complete a struct forward reference. 939 * 940 * @returns 0 on success 941 * @returns 1 on failure. 942 * @param tp Pointer to the struct/class to complete. 943 * @remark Nasy hack for strstreambuf. 944 */ 945 static int try_complete_struct(const struct type *tp) 946 { 947 int cch; 948 const char *pszName; 949 int i; 950 951 if (tp->tag == ty_struc) 952 return 0; 953 if (tp->d.struc.flags != STRUC_FORWARD) 954 return 1; 955 956 pszName = tp->d.struc.name; 957 cch = strlen(pszName); 958 for (i = 0; i < sym_count; ++i) 959 switch (sym_ptr[i].n_type) 960 { 961 case N_LSYM: 962 case N_LCSYM: 963 case N_GSYM: 964 case N_PSYM: 965 case N_RSYM: 966 case N_STSYM: 967 case N_FUN: 968 if ( !memcmp(str_ptr + sym_ptr[i].n_un.n_strx, pszName, cch) 969 && *(char*)(str_ptr + sym_ptr[i].n_un.n_strx + cch) == ':' 970 ) 971 { 972 parse_typedef(&i); 973 return 1; 974 } /* if */ 975 } /* switch */ 976 977 return 0; 978 } 979 912 980 913 981 … … 955 1023 case ty_stabs_ref: 956 1024 1025 #if 0 957 1026 /* This should not happen. */ 958 1027 959 1028 no_warning ("stabs type %d not defined", tp->d.stabs_ref); 1029 960 1030 return 4; 1031 #else 1032 /* This seems to happen although it shouldn't... Try do something at least. */ 1033 1034 tp = follow_refs (tp); 1035 if (!tp) 1036 { 1037 no_warning ("stabs type %d not defined", tp->d.stabs_ref); 1038 return 4; 1039 } 1040 return type_size (tp); 1041 #endif 961 1042 962 1043 case ty_alias: … … 977 1058 /* The size of a structure is stored in the type structure. */ 978 1059 979 if (tp->d.struc.flags & STRUC_FORWARD) 980 { 981 no_warning ("size of incomplete structure %s is unknown", 982 tp->d.struc.name); 1060 if ( tp->d.struc.flags & STRUC_FORWARD 1061 && try_complete_struct(tp)) 1062 { 1063 no_warning ("size of incomplete structure %s is unknown (off %ld)\n stabs: %s", 1064 tp->d.struc.name, parse_ptr - parse_start, parse_start); 983 1065 return 0; 984 1066 } … … 1378 1460 { 1379 1461 case '<': 1462 #if 0 1463 /* workaround for "operator<::" and "operator<::" 1464 * */ 1465 if (!cNesting || (psz[1] == ':' && psz[2] == ':')) 1466 return psz + 1; 1467 if (!cNesting || (psz[1] == '<' && psz[2] == ':' && psz[3] == ':')) 1468 return psz + 2; 1469 #else 1470 /* general and faster check: < or > followed by : means the end. */ 1471 #endif 1472 if (psz[1] == ':') 1473 return psz + 1; 1380 1474 cNesting++; 1381 1475 break; 1382 1476 case '>': 1477 if (psz[1] == ':') 1478 return psz + 1; 1383 1479 cNesting--; 1384 1480 break; -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.