00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040 #include "dwarf_DST_producer.h"
00041 #include "errors.h"
00042
00043
00044
00045
00046
00047
00048
00049 #define DST_ASSERT(truth, msg) Is_True(truth, (msg))
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059 typedef enum DST_producer_state
00060 {
00061 DST_begin_state,
00062 DST_making_include_dirs,
00063 DST_making_file_names,
00064 DST_making_macinfo,
00065 DST_making_dbg_info,
00066 DST_end_state
00067 } DST_PRODUCER_STATE;
00068
00069 static DST_PRODUCER_STATE pstate = DST_begin_state;
00070 static DST_DIR_IDX last_include_dir = DST_INVALID_INIT;
00071 static DST_FILE_IDX last_file_name = DST_INVALID_INIT;
00072 static DST_INFO_IDX last_info_idx = DST_INVALID_INIT;
00073 static DST_INFO_IDX file_scope_info = DST_INVALID_INIT;
00074 static DST_INFO_IDX forced_exit_info = DST_INVALID_INIT;
00075
00076 static mUINT16 num_file_names = 0;
00077 static mUINT16 num_incl_dirs = 0;
00078
00079 static BOOL begin_PU = FALSE;
00080 static mINT32 file_scope_locks = 0;
00081
00082
00083
00084
00085
00086
00087 #define DST_64_allign 8
00088 #define DST_32_align 4
00089 #define DST_char_align 1
00090 #define DST_default_align DST_64_allign
00091
00092
00093
00094
00095 #define DST_mk(type) DST_allocate(sizeof(type), DST_default_align)
00096
00097 #define DST_mk_file() (DST_mk(DST_FILE_NAME));
00098 #define DST_mk_dir() (DST_mk(DST_INCLUDE_DIR));
00099 #define DST_mk_info() (DST_mk(DST_INFO));
00100 #define DST_mk_attr(type) (DST_mk(type));
00101
00102 #if defined(MONGOOSE_BE)
00103
00104
00105 #define DST_enter_mk(a, b)
00106 #endif
00107
00108 DST_STR_IDX
00109 DST_mk_string(const char *s)
00110 {
00111 DST_STR_IDX str_idx;
00112
00113 if (s!=NULL)
00114 {
00115 str_idx = DST_allocate(strlen(s) + 1, DST_char_align);
00116 (void)strcpy(DST_STR_IDX_TO_PTR(str_idx), s);
00117 }
00118 else
00119 str_idx = DST_INVALID_IDX;
00120
00121 return str_idx;
00122 }
00123
00124
00125 static DST_STR_IDX
00126 DST_mk_name(const char *s)
00127 {
00128 DST_STR_IDX str_idx;
00129
00130
00131
00132
00133 if ((s != NULL) && (*s != '\0'))
00134 {
00135 str_idx = DST_allocate(strlen(s) + 1, DST_char_align);
00136 (void)strcpy(DST_STR_IDX_TO_PTR(str_idx), s);
00137 }
00138 else
00139 str_idx = DST_INVALID_IDX;
00140
00141 return str_idx;
00142 }
00143
00144
00145 #if (!defined(MONGOOSE_BE))
00146
00147
00148
00149
00150
00151
00152 static void
00153 DST_enter_mk(DST_PRODUCER_STATE new_state, DST_IDX last_idx)
00154 {
00155 if (file_scope_locks && new_state==DST_making_dbg_info)
00156 {
00157
00158 if (pstate != new_state)
00159 {
00160 DST_return_to_block(last_idx);
00161 pstate = new_state;
00162 }
00163 if (!DST_IS_NULL(file_scope_info) && DST_IS_NULL(forced_exit_info))
00164 {
00165 forced_exit_info = last_info_idx;
00166 DST_return_to_block(file_scope_info);
00167 }
00168 }
00169 else if (begin_PU && new_state==DST_making_dbg_info)
00170 {
00171
00172 DST_ASSERT(!DST_IS_NULL(file_scope_info), "Premature entry into PU");
00173 DST_begin_block(DST_local_scope_block);
00174 pstate = new_state;
00175 begin_PU = FALSE;
00176 }
00177 else if (pstate != new_state)
00178 {
00179 DST_return_to_block(last_idx);
00180 pstate = new_state;
00181 }
00182 }
00183 #endif
00184
00185 #define DST_check_info_idx(required_tag, idx)\
00186 DST_ASSERT((DST_IS_FOREIGN_OBJ(idx)) || (DST_INFO_tag(DST_INFO_IDX_TO_PTR(idx)) == required_tag),\
00187 "Found invalid DST_info index")
00188
00189 #if defined(_SUPPORT_IPA) || defined(_STANDALONE_INLINER)
00190
00191
00192
00193 static void
00194 DST_set_last_file_name(void)
00195 {
00196 DST_IDX idx;
00197 num_file_names = 0;
00198 for (idx = DST_get_file_names (); !DST_IS_NULL(idx); idx = DST_FILE_NAME_next(DST_FILE_IDX_TO_PTR(idx))) {
00199 num_file_names++;
00200 last_file_name = idx;
00201 }
00202 }
00203
00204 static void
00205 DST_set_last_include_dir(void)
00206 {
00207 DST_IDX idx;
00208 num_incl_dirs = 0;
00209 for (idx = DST_get_include_dirs (); !DST_IS_NULL(idx); idx = DST_INCLUDE_DIR_next(DST_DIR_IDX_TO_PTR(idx))) {
00210 num_incl_dirs++;
00211 last_include_dir = idx;
00212 }
00213 }
00214
00215 #endif
00216
00217
00218
00219
00220
00221
00222
00223
00224 DST_IDX
00225 DST_mk_include_dir(char *path)
00226 {
00227 DST_INCLUDE_DIR *dir_ptr, *prev_ptr;
00228 DST_DIR_IDX dir_idx;
00229
00230
00231 if (DST_IS_NULL(last_include_dir))
00232 {
00233 DST_begin_block(DST_include_dirs_block);
00234
00235 #if !(defined(_SUPPORT_IPA) || defined(_STANDALONE_INLINER))
00236 pstate = DST_making_include_dirs;
00237 #endif
00238 }
00239 #if !(defined(_SUPPORT_IPA) || defined(_STANDALONE_INLINER))
00240 else
00241 DST_enter_mk(DST_making_include_dirs, last_include_dir);
00242 #endif
00243
00244
00245 dir_idx = DST_mk_dir();
00246 dir_ptr = DST_DIR_IDX_TO_PTR(dir_idx);
00247 DST_INCLUDE_DIR_path(dir_ptr) = DST_mk_string(path);
00248 DST_INCLUDE_DIR_next(dir_ptr) = DST_INVALID_IDX;
00249 if (!DST_IS_NULL(last_include_dir))
00250 {
00251 prev_ptr = DST_DIR_IDX_TO_PTR(last_include_dir);
00252 DST_INCLUDE_DIR_next(prev_ptr) = dir_idx;
00253 }
00254 last_include_dir = dir_idx;
00255 num_incl_dirs += 1;
00256 return dir_idx;
00257 }
00258
00259
00260 mUINT16
00261 DST_number_of_include_dirs(void)
00262 {
00263 return num_incl_dirs;
00264 }
00265
00266
00267
00268
00269
00270
00271
00272
00273
00274
00275
00276
00277
00278 DST_IDX
00279 DST_mk_file_name(char *file_name,
00280 mUINT16 incl_dir,
00281 UINT64 size,
00282 UINT64 modt)
00283 {
00284 DST_FILE_NAME *f_ptr, *prev_ptr;
00285 DST_FILE_IDX f_idx;
00286
00287
00288 if (DST_IS_NULL(last_file_name))
00289 {
00290 DST_begin_block(DST_file_names_block);
00291 pstate = DST_making_file_names;
00292 }
00293 #if !(defined(_SUPPORT_IPA) || defined(_STANDALONE_INLINER))
00294 else
00295 DST_enter_mk(DST_making_file_names, last_file_name);
00296 #endif
00297
00298
00299 f_idx = DST_mk_file();
00300 f_ptr = DST_FILE_IDX_TO_PTR(f_idx);
00301 DST_FILE_NAME_name(f_ptr) = DST_mk_string(file_name);
00302 DST_FILE_NAME_dir(f_ptr) = incl_dir;
00303 DST_FILE_NAME_size(f_ptr) = size;
00304 DST_FILE_NAME_modt(f_ptr) = modt;
00305 DST_FILE_NAME_next(f_ptr) = DST_INVALID_IDX;
00306 if (!DST_IS_NULL(last_file_name))
00307 {
00308 prev_ptr = DST_FILE_IDX_TO_PTR(last_file_name);
00309 DST_FILE_NAME_next(prev_ptr) = f_idx;
00310 }
00311 last_file_name = f_idx;
00312 num_file_names += 1;
00313 return f_idx;
00314 }
00315
00316
00317 mUINT16
00318 DST_number_of_files(void)
00319 {
00320 return num_file_names;
00321 }
00322
00323
00324
00325
00326
00327
00328
00329
00330
00331
00332
00333
00334
00335
00336
00337
00338
00339
00340
00341 void DST_lock_to_file_scope_mem(void)
00342 {
00343 DST_ASSERT(file_scope_locks >= 0, "Erroneous state for file-scope lock");
00344 file_scope_locks += 1;
00345 }
00346
00347 void DST_release_from_file_scope_mem(void)
00348 {
00349 DST_ASSERT(file_scope_locks > 0, "Missing lock for file-scope release");
00350 file_scope_locks -= 1;
00351 if (!file_scope_locks && !DST_IS_NULL(forced_exit_info))
00352 {
00353 last_info_idx = forced_exit_info;
00354 forced_exit_info = DST_INVALID_IDX;
00355 if (pstate == DST_making_dbg_info)
00356 DST_return_to_block(last_info_idx);
00357 }
00358 }
00359
00360 mINT32 DST_unwind_locks(void)
00361 {
00362 mINT32 number_of_locks = file_scope_locks;
00363
00364 file_scope_locks = 1;
00365 DST_release_from_file_scope_mem();
00366 return number_of_locks;
00367 }
00368
00369 extern void DST_wind_up_locks(mINT32 number_of_locks)
00370 {
00371 file_scope_locks += number_of_locks;
00372 }
00373
00374 BOOL DST_is_locked_to_file_scope_mem(void)
00375 {
00376 return file_scope_locks > 0;
00377 }
00378
00379
00380
00381
00382
00383 static DST_INFO_IDX
00384 DST_init_info(DST_INFO_IDX info_idx,
00385 DST_DW_tag tag,
00386 DST_flag flag,
00387 DST_ATTR_IDX attrs)
00388 {
00389 DST_INFO *info_ptr;
00390
00391 info_ptr = DST_INFO_IDX_TO_PTR(info_idx);
00392 DST_INFO_tag(info_ptr) = tag;
00393 DST_INFO_flag(info_ptr) = flag;
00394 DST_INFO_sibling(info_ptr) = DST_INVALID_IDX;
00395 DST_INFO_attributes(info_ptr) = attrs;
00396 DST_INFO_dieptr(info_ptr) = NULL;
00397 last_info_idx = attrs;
00398 return info_idx;
00399 }
00400
00401
00402
00403
00404
00405 DST_INFO_IDX
00406 DST_mk_compile_unit(char *src_path,
00407 char *comp_dir,
00408 char *comp_info,
00409 DST_language language,
00410 DST_identifier_case id_case)
00411 {
00412 DST_INFO_IDX info_idx;
00413 DST_ATTR_IDX cu_idx;
00414 DST_COMPILE_UNIT *cu;
00415
00416
00417 DST_ASSERT(DST_IS_NULL(last_info_idx),
00418 "Illegal attempt to start DST file-scope twice");
00419 pstate = DST_making_dbg_info;
00420
00421
00422 DST_begin_block(DST_file_scope_block);
00423 info_idx = DST_mk_info();
00424 cu_idx = DST_mk_attr(DST_COMPILE_UNIT);
00425 cu = DST_ATTR_IDX_TO_PTR(cu_idx, DST_COMPILE_UNIT);
00426 DST_COMPILE_UNIT_name(cu) = DST_mk_string(src_path);
00427 DST_COMPILE_UNIT_comp_dir(cu) = DST_mk_string(comp_dir);
00428 DST_COMPILE_UNIT_producer(cu) = DST_mk_string(comp_info);
00429 DST_COMPILE_UNIT_language(cu) = language;
00430 DST_COMPILE_UNIT_identifier_case(cu) = id_case;
00431 DST_COMPILE_UNIT_first_child(cu) = DST_INVALID_IDX;
00432 DST_COMPILE_UNIT_last_child(cu) = DST_INVALID_IDX;
00433
00434 return DST_init_info(info_idx, DW_TAG_compile_unit, DST_no_flag, cu_idx);
00435 }
00436
00437
00438
00439
00440
00441
00442
00443
00444 void
00445 DST_begin_PU(void)
00446 {
00447 DST_ASSERT(!file_scope_locks && DST_IS_NULL(file_scope_info) && !begin_PU,
00448 "Attempt to nest PU");
00449 begin_PU = TRUE;
00450 file_scope_info = last_info_idx;
00451 }
00452
00453
00454
00455
00456
00457 void
00458 DST_end_PU(void)
00459 {
00460 DST_ASSERT(!file_scope_locks && !DST_IS_NULL(file_scope_info) || begin_PU,
00461 "Premature attempt to end DST PU");
00462
00463 last_info_idx = file_scope_info;
00464 file_scope_info = DST_INVALID_IDX;
00465 if (begin_PU)
00466 begin_PU = FALSE;
00467 else
00468 {
00469 pstate = DST_making_dbg_info;
00470 DST_return_to_block(last_info_idx);
00471 }
00472 }
00473
00474
00475
00476
00477 DST_INFO_IDX
00478 DST_mk_inlined_subroutine(void *low_pc,
00479 void *high_pc,
00480 DST_INFO_IDX abstract_origin)
00481 {
00482 DST_INFO_IDX info_idx;
00483 DST_ATTR_IDX attr_idx;
00484 DST_flag flag = DST_no_flag;
00485 DST_INLINED_SUBROUTINE *attr;
00486
00487
00488 #if !(defined(_SUPPORT_IPA) || defined(_STANDALONE_INLINER))
00489 DST_enter_mk(DST_making_dbg_info, last_info_idx);
00490 #endif
00491 DST_check_info_idx(DW_TAG_subprogram, abstract_origin);
00492
00493 info_idx = DST_mk_info();
00494 attr_idx = DST_mk_attr(DST_INLINED_SUBROUTINE);
00495 attr = DST_ATTR_IDX_TO_PTR(attr_idx, DST_INLINED_SUBROUTINE);
00496
00497 #if defined(_SUPPORT_IPA) || defined(_STANDALONE_INLINER)
00498
00499
00500
00501
00502
00503 DST_ASSOC_INFO_st_idx(DST_INLINED_SUBROUTINE_low_pc (attr))
00504 = pDST_ASSOC_INFO_st_idx((DST_ASSOC_INFO *)low_pc);
00505 DST_ASSOC_INFO_st_idx(DST_INLINED_SUBROUTINE_high_pc (attr))
00506 = pDST_ASSOC_INFO_st_idx((DST_ASSOC_INFO *)high_pc);
00507 #else
00508 DST_ASSOC_INFO_fe_ptr(DST_INLINED_SUBROUTINE_low_pc (attr)) = low_pc;
00509 DST_ASSOC_INFO_fe_ptr(DST_INLINED_SUBROUTINE_high_pc(attr)) = high_pc;
00510 DST_SET_assoc_fe(flag);
00511 #endif
00512 DST_INLINED_SUBROUTINE_abstract_origin(attr) = abstract_origin;
00513 DST_INLINED_SUBROUTINE_first_child(attr) = DST_INVALID_IDX;
00514 DST_INLINED_SUBROUTINE_last_child(attr) = DST_INVALID_IDX;
00515
00516 return DST_init_info(info_idx, DW_TAG_inlined_subroutine,
00517 flag, attr_idx);
00518 }
00519
00520 #if defined(_SUPPORT_IPA) || defined(_STANDALONE_INLINER)
00521
00522
00523 void
00524 DST_label_add_name(DST_LABEL *attr, char *label_name)
00525 {
00526 DST_LABEL_name(attr) = DST_mk_name(label_name);
00527 }
00528
00529 void
00530 DST_lexical_block_add_name(DST_LEXICAL_BLOCK *attr, char *block_name)
00531 {
00532 DST_LEXICAL_BLOCK_name(attr) = DST_mk_name(block_name);
00533 }
00534
00535
00536
00537
00538
00539 static mUINT16
00540 DST_get_ordinal_num(DST_DIR_IDX dir_idx, char *dir_name)
00541 {
00542 DST_DIR_IDX idx = dir_idx;
00543 mUINT16 num = 0;
00544 DST_INCLUDE_DIR *dir;
00545
00546 if (DST_IS_NULL(idx))
00547 return 0;
00548
00549 dir = DST_DIR_IDX_TO_PTR(idx);
00550
00551 while (dir != NULL) {
00552 num += 1;
00553 if (strcmp(DST_STR_IDX_TO_PTR(DST_INCLUDE_DIR_path(dir)), dir_name) == 0)
00554 return num;
00555 else {
00556 idx = DST_INCLUDE_DIR_next(dir);
00557 if (!DST_IS_NULL(idx))
00558 dir = DST_DIR_IDX_TO_PTR(idx);
00559 else
00560 dir = NULL;
00561 }
00562 }
00563
00564 if (dir == NULL) {
00565 (void)DST_mk_include_dir(dir_name);
00566 return num_incl_dirs;
00567 }
00568 return 0;
00569 }
00570
00571
00572 static char *
00573 DST_get_dirname(mUINT16 ordinal)
00574 {
00575 DST_DIR_IDX d_idx = DST_get_include_dirs();
00576 DST_INCLUDE_DIR *dir;
00577 mUINT16 i;
00578
00579 for (i = 0; i < ordinal; i++) {
00580 dir = DST_DIR_IDX_TO_PTR(d_idx);
00581 d_idx = DST_INCLUDE_DIR_next(dir);
00582 }
00583 return (DST_STR_IDX_TO_PTR(DST_INCLUDE_DIR_path(dir)));
00584 }
00585
00586
00587 char *
00588 DST_get_file(mUINT16 ordinal, UINT64 *file_size, UINT64 *fmod_time, char **dirname)
00589 {
00590 DST_FILE_IDX f_idx = DST_get_file_names();
00591 DST_FILE_NAME *file;
00592 mUINT16 i;
00593
00594
00595 if (ordinal == 0)
00596 return NULL;
00597
00598 for (i = 0; i < ordinal; i++) {
00599 file = DST_FILE_IDX_TO_PTR(f_idx);
00600 f_idx = DST_FILE_NAME_next(file);
00601 }
00602 *file_size = DST_FILE_NAME_size(file);
00603 *fmod_time = DST_FILE_NAME_modt(file);
00604 *dirname = DST_get_dirname(DST_FILE_NAME_dir(file));
00605 return (DST_STR_IDX_TO_PTR(DST_FILE_NAME_name(file)));
00606 }
00607
00608
00609
00610
00611 static mUINT16
00612 DST_get_file_id(char *filename, char *dirname, UINT64 file_size, UINT64 fmod_time)
00613 {
00614 DST_FILE_IDX f_idx = DST_get_file_names();
00615 DST_FILE_NAME *f_ptr;
00616 mUINT16 num = 0;
00617
00618
00619 while (!DST_IS_NULL(f_idx)) {
00620 f_ptr = DST_FILE_IDX_TO_PTR(f_idx);
00621 num += 1;
00622 if ((DST_FILE_NAME_size(f_ptr) == file_size) &&
00623 (DST_FILE_NAME_modt(f_ptr) == fmod_time) &&
00624 (strcmp(filename, DST_STR_IDX_TO_PTR(DST_FILE_NAME_name(f_ptr))) == 0) &&
00625 (strcmp(dirname, DST_get_dirname(DST_FILE_NAME_dir(f_ptr))) == 0)) {
00626
00627 return num;
00628 }
00629 f_idx = DST_FILE_NAME_next(f_ptr);
00630 }
00631 return 0;
00632 }
00633
00634
00635
00636
00637 static mUINT16
00638 DST_enter_file(char *filename, char *dirname, UINT64 file_size, UINT64 fmod_time)
00639 {
00640 DST_mk_file_name(filename, DST_get_ordinal_num(DST_get_include_dirs(),
00641 dirname),
00642 file_size,
00643 fmod_time);
00644
00645 return (num_file_names);
00646 }
00647
00648
00649 mUINT16
00650 DST_get_cross_inlined_file_id
00651 (char *filename,
00652 char *dirname,
00653 UINT64 file_size,
00654 UINT64 fmod_time)
00655
00656 {
00657 mUINT16 file_id = 0;
00658
00659
00660
00661 DST_set_last_include_dir();
00662 DST_set_last_file_name();
00663
00664 file_id = DST_get_file_id(filename, dirname, file_size, fmod_time);
00665 if (file_id == 0) {
00666 return(DST_enter_file(filename, dirname, file_size, fmod_time));
00667 }
00668 return file_id;
00669 }
00670
00671
00672 DST_INFO_IDX
00673 DST_mk_cross_inlined_subroutine(
00674 void *low_pc,
00675 void *high_pc,
00676 char *name,
00677
00678 mUINT16 *file_index,
00679 UINT64 file_size,
00680 UINT64 fmod_time,
00681 USRCPOS inl_decl,
00682 char *filename,
00683 char *dirname)
00684
00685 {
00686 DST_INFO_IDX info_idx;
00687 DST_ATTR_IDX attr_idx;
00688 DST_flag flag = DST_no_flag;
00689 DST_INLINED_SUBROUTINE *attr;
00690 USRCPOS decl;
00691 DST_INFO_IDX abstract_origin = DST_FOREIGN_INIT;
00692 mUINT16 file_id = 0;
00693
00694 USRCPOS_clear(decl);
00695 USRCPOS_column(decl) = USRCPOS_column(inl_decl);
00696 USRCPOS_linenum(decl) = USRCPOS_linenum(inl_decl);
00697 info_idx = DST_mk_info();
00698 attr_idx = DST_mk_attr(DST_INLINED_SUBROUTINE);
00699 attr = DST_ATTR_IDX_TO_PTR(attr_idx, DST_INLINED_SUBROUTINE);
00700
00701 DST_set_last_include_dir();
00702 DST_set_last_file_name();
00703
00704
00705
00706
00707
00708
00709 DST_ASSOC_INFO_st_idx(DST_INLINED_SUBROUTINE_low_pc (attr))
00710 = pDST_ASSOC_INFO_st_idx((DST_ASSOC_INFO *)low_pc);
00711 DST_ASSOC_INFO_st_idx(DST_INLINED_SUBROUTINE_high_pc (attr))
00712 = pDST_ASSOC_INFO_st_idx((DST_ASSOC_INFO *)high_pc);
00713
00714 DST_INLINED_SUBROUTINE_abstract_name(attr) = DST_mk_name(name);
00715
00716
00717
00718 if (*file_index == 0) {
00719 file_id = DST_get_file_id(filename, dirname, file_size, fmod_time);
00720 if (file_id == 0) {
00721 file_id = DST_enter_file(filename, dirname, file_size, fmod_time);
00722 }
00723 *file_index = file_id;
00724 }
00725
00726 USRCPOS_filenum(decl) = *file_index;
00727
00728 DST_INLINED_SUBROUTINE_decl(attr) = decl;
00729 DST_INLINED_SUBROUTINE_abstract_origin(attr) = abstract_origin;;
00730 DST_INLINED_SUBROUTINE_first_child(attr) = DST_INVALID_IDX;
00731 DST_INLINED_SUBROUTINE_last_child(attr) = DST_INVALID_IDX;
00732
00733 return DST_init_info(info_idx, DW_TAG_inlined_subroutine,
00734 flag, attr_idx);
00735 }
00736
00737 #endif
00738
00739
00740
00741 DST_INFO_IDX
00742 DST_mk_subprogram_memdef(USRCPOS decl,
00743 void *subpr,
00744 BOOL is_prototyped,
00745 DST_INFO_IDX spec)
00746 {
00747 DST_INFO_IDX info_idx;
00748 DST_ATTR_IDX attr_idx;
00749 DST_flag flag = DST_no_flag;
00750 DST_SUBPROGRAM *attr;
00751
00752 #if !(defined(_SUPPORT_IPA) || defined(_STANDALONE_INLINER))
00753 DST_enter_mk(DST_making_dbg_info, last_info_idx);
00754 #endif
00755 DST_check_info_idx(DW_TAG_subprogram, spec);
00756
00757 info_idx = DST_mk_info();
00758 attr_idx = DST_mk_attr(DST_SUBPROGRAM);
00759 attr = DST_ATTR_IDX_TO_PTR(attr_idx, DST_SUBPROGRAM);
00760 DST_SUBPROGRAM_memdef_decl(attr) = decl;
00761 DST_SUBPROGRAM_memdef_spec(attr) = spec;
00762
00763
00764
00765
00766 DST_ASSOC_INFO_fe_ptr(DST_SUBPROGRAM_memdef_st(attr)) = subpr;
00767 DST_SET_assoc_fe(flag);
00768
00769 DST_SUBPROGRAM_memdef_first_child(attr) = DST_INVALID_IDX;
00770 DST_SUBPROGRAM_memdef_last_child(attr) = DST_INVALID_IDX;
00771
00772 DST_SET_memdef(flag);
00773 if (is_prototyped)
00774 DST_SET_prototyped(flag);
00775 return DST_init_info(info_idx, DW_TAG_subprogram,
00776 DST_flag_memdef, attr_idx);
00777 }
00778
00779
00780
00781
00782
00783 DST_INFO_IDX
00784 DST_mk_subprogram(USRCPOS decl,
00785 char *name,
00786 DST_INFO_IDX type,
00787 DST_INFO_IDX origin,
00788 void *subpr,
00789 DST_inline inlin,
00790 DST_virtuality virtuality,
00791 DST_vtable_elem_location vtable_elem_location,
00792 BOOL is_declaration,
00793 BOOL is_prototyped,
00794 BOOL is_artificial,
00795 BOOL is_external)
00796 {
00797 DST_INFO_IDX info_idx;
00798 DST_ATTR_IDX attr_idx;
00799 DST_flag flag = DST_no_flag;
00800 DST_SUBPROGRAM *attr;
00801
00802 #if !(defined(_SUPPORT_IPA) || defined(_STANDALONE_INLINER))
00803 DST_enter_mk(DST_making_dbg_info, last_info_idx);
00804 #endif
00805
00806 info_idx = DST_mk_info();
00807 attr_idx = DST_mk_attr(DST_SUBPROGRAM);
00808 attr = DST_ATTR_IDX_TO_PTR(attr_idx, DST_SUBPROGRAM);
00809 if (is_declaration)
00810 {
00811 DST_SUBPROGRAM_decl_decl(attr) = decl;
00812 DST_SUBPROGRAM_decl_name(attr) = DST_mk_name(name);
00813 DST_SUBPROGRAM_decl_linkage_name(attr) = DST_INVALID_IDX;
00814 DST_SUBPROGRAM_decl_type(attr) = type;
00815 DST_SUBPROGRAM_decl_origin(attr) = origin;
00816 DST_SUBPROGRAM_decl_inline(attr) = inlin;
00817 #ifdef CPLUSPLUSIL
00818 DST_SUBPROGRAM_decl_virtuality(attr) = virtuality;
00819 DST_SUBPROGRAM_decl_vtable_elem_location(attr) = vtable_elem_location;
00820 #endif
00821 DST_SUBPROGRAM_decl_first_child(attr) = DST_INVALID_IDX;
00822 DST_SUBPROGRAM_decl_last_child(attr) = DST_INVALID_IDX;
00823 DST_SET_declaration(flag);
00824 }
00825 else
00826 {
00827 DST_SUBPROGRAM_def_decl(attr) = decl;
00828 DST_SUBPROGRAM_def_name(attr) = DST_mk_name(name);
00829 DST_SUBPROGRAM_decl_linkage_name(attr) = DST_INVALID_IDX;
00830 DST_SUBPROGRAM_def_pubname(attr) = DST_INVALID_IDX;
00831 DST_SUBPROGRAM_def_specification(attr) = DST_INVALID_IDX;
00832 DST_SUBPROGRAM_def_type(attr) = type;
00833
00834
00835
00836
00837 DST_ASSOC_INFO_fe_ptr(DST_SUBPROGRAM_def_st(attr)) = subpr;
00838 DST_SET_assoc_fe(flag);
00839
00840 DST_SUBPROGRAM_def_inline(attr) = inlin;
00841 #ifdef CPLUSPLUSIL
00842 DST_SUBPROGRAM_def_virtuality(attr) = virtuality;
00843 DST_SUBPROGRAM_def_vtable_elem_location(attr) = vtable_elem_location;
00844 #endif
00845 DST_SUBPROGRAM_def_clone_origin(attr) = DST_INVALID_IDX;
00846 DST_SUBPROGRAM_def_first_child(attr) = DST_INVALID_IDX;
00847 DST_SUBPROGRAM_def_last_child(attr) = DST_INVALID_IDX;
00848 }
00849 if (is_artificial)
00850 DST_SET_artificial(flag);
00851 if (is_prototyped)
00852 DST_SET_prototyped(flag);
00853 if (is_external)
00854 DST_SET_external(flag);
00855 DST_INFO_IDX t =
00856 DST_init_info(info_idx, DW_TAG_subprogram, flag, attr_idx);
00857 return t;
00858 }
00859
00860
00861
00862 #if defined(_SUPPORT_IPA) || defined(_STANDALONE_INLINER)
00863
00864
00865
00866
00867
00868 void
00869 DST_subprogram_concrete_to_abstract(DST_INFO_IDX subprogram)
00870 {
00871 DST_INFO *info;
00872 DST_ATTR_IDX attr_idx;
00873 DST_SUBPROGRAM *attr;
00874 DST_flag flag;
00875
00876 info = DST_INFO_IDX_TO_PTR(subprogram);
00877
00878 DST_ASSERT((DST_INFO_tag(info) == DW_TAG_subprogram), "Bad DST_INFO_IDX input to DST_subprogram_concrete_to_abstract -- should be DW_TAG_subprogram");
00879
00880 flag = DST_INFO_flag(info);
00881 attr_idx = DST_INFO_attributes(info);
00882 attr = DST_ATTR_IDX_TO_PTR(attr_idx, DST_SUBPROGRAM);
00883
00884 if (DST_IS_declaration(flag))
00885 {
00886 if (DST_SUBPROGRAM_decl_inline(attr) == DW_INL_declared_not_inlined)
00887 DST_SUBPROGRAM_decl_inline(attr) = DW_INL_declared_inlined;
00888 else
00889 DST_SUBPROGRAM_decl_inline(attr) = DW_INL_inlined;
00890 }
00891 else
00892 {
00893 if (DST_SUBPROGRAM_def_inline(attr) == DW_INL_declared_not_inlined)
00894 DST_SUBPROGRAM_def_inline(attr) = DW_INL_declared_inlined;
00895 else
00896 DST_SUBPROGRAM_def_inline(attr) = DW_INL_inlined;
00897 }
00898 }
00899 #endif
00900
00901
00902 #if defined(_SUPPORT_IPA) || defined(_STANDALONE_INLINER) || defined(_LEGO_CLONER)
00903
00904
00905
00906 DST_INFO_IDX
00907 DST_mk_cloned_subprogram(USRCPOS decl,
00908 char *name,
00909 DST_INFO_IDX type,
00910 DST_INFO_IDX clone_origin,
00911 void *subst,
00912 DST_inline inlin,
00913 DST_virtuality virtuality)
00914 {
00915 DST_INFO_IDX info_idx;
00916 DST_ATTR_IDX attr_idx;
00917 DST_flag flag = DST_no_flag;
00918 DST_SUBPROGRAM *attr;
00919
00920 info_idx = DST_mk_info();
00921 attr_idx = DST_mk_attr(DST_SUBPROGRAM);
00922 attr = DST_ATTR_IDX_TO_PTR(attr_idx, DST_SUBPROGRAM);
00923
00924 DST_SUBPROGRAM_def_decl(attr) = decl;
00925 DST_SUBPROGRAM_def_name(attr) = DST_mk_name(name);
00926 DST_SUBPROGRAM_decl_linkage_name(attr) = DST_INVALID_IDX;
00927 DST_SUBPROGRAM_def_pubname(attr) = DST_INVALID_IDX;
00928 DST_SUBPROGRAM_def_specification(attr) = DST_INVALID_IDX;
00929 DST_SUBPROGRAM_def_type(attr) = type;
00930
00931
00932
00933
00934 DST_ASSOC_INFO_st_idx(DST_SUBPROGRAM_def_st (attr))
00935 = pDST_ASSOC_INFO_st_idx((DST_ASSOC_INFO *)subst);
00936
00937
00938
00939
00940
00941 if (inlin == DW_INL_declared_inlined)
00942 DST_SUBPROGRAM_def_inline(attr) = DW_INL_declared_not_inlined;
00943 else
00944 DST_SUBPROGRAM_def_inline(attr) = DW_INL_not_inlined;
00945
00946 DST_SUBPROGRAM_def_virtuality(attr) = virtuality;
00947 DST_SUBPROGRAM_def_first_child(attr) = DST_INVALID_IDX;
00948 DST_SUBPROGRAM_def_last_child(attr) = DST_INVALID_IDX;
00949 DST_SUBPROGRAM_def_clone_origin(attr) = clone_origin;
00950 DST_SET_external(flag);
00951 return DST_init_info(info_idx, DW_TAG_subprogram, flag, attr_idx);
00952 }
00953 #endif
00954
00955
00956
00957
00958
00959
00960 void
00961 DST_add_pubname_to_subprogram (DST_INFO_IDX subprogram,
00962 char *pubname)
00963 {
00964 DST_INFO *info;
00965 DST_ATTR_IDX attr_idx;
00966 DST_SUBPROGRAM *attr;
00967
00968 info = DST_INFO_IDX_TO_PTR(subprogram);
00969 attr_idx = DST_INFO_attributes(info);
00970 attr = DST_ATTR_IDX_TO_PTR(attr_idx, DST_SUBPROGRAM);
00971
00972 DST_ASSERT(!(DST_IS_declaration (DST_INFO_flag(info))),
00973 "Try to put pubname on declaration");
00974
00975 DST_ASSERT (DST_INFO_tag(info) == DW_TAG_subprogram,
00976 "Try to set pubname on non subprogram");
00977
00978 DST_SUBPROGRAM_def_pubname(attr) = DST_mk_name(pubname);
00979 }
00980
00981
00982
00983
00984
00985
00986 void
00987 DST_add_linkage_name_to_subprogram(DST_INFO_IDX subprogram,
00988 char *linkage_name)
00989 {
00990 DST_INFO *info;
00991 DST_ATTR_IDX attr_idx;
00992 DST_SUBPROGRAM *attr;
00993
00994 info = DST_INFO_IDX_TO_PTR(subprogram);
00995 if(DST_INFO_tag(info) == DW_TAG_subprogram) {
00996 DST_ASSERT (DST_INFO_tag(info) == DW_TAG_subprogram,
00997 "Try to set linkage_name on non subprogram");
00998 attr_idx = DST_INFO_attributes(info);
00999 attr = DST_ATTR_IDX_TO_PTR(attr_idx, DST_SUBPROGRAM);
01000 if (DST_IS_declaration(DST_INFO_flag(info)))
01001 DST_SUBPROGRAM_decl_linkage_name(attr) = DST_mk_name(linkage_name);
01002 else
01003 DST_SUBPROGRAM_def_linkage_name(attr) = DST_mk_name(linkage_name);
01004 }
01005 }
01006
01007
01008
01009
01010
01011 void
01012 DST_add_specification_to_subprogram (DST_INFO_IDX subprogram_def,
01013 DST_INFO_IDX subprogram_decl)
01014 {
01015 DST_INFO *def_info;
01016 DST_ATTR_IDX def_attr_idx;
01017 DST_SUBPROGRAM *def_attr;
01018
01019 def_info = DST_INFO_IDX_TO_PTR(subprogram_def);
01020
01021 DST_ASSERT(!(DST_IS_declaration (DST_INFO_flag(def_info))),
01022 "Try to put specification on declaration");
01023 DST_ASSERT (DST_INFO_tag(def_info) == DW_TAG_subprogram,
01024 "Try to set specification on non subprogram");
01025
01026 def_attr_idx = DST_INFO_attributes(def_info);
01027 def_attr = DST_ATTR_IDX_TO_PTR(def_attr_idx, DST_SUBPROGRAM);
01028 DST_SUBPROGRAM_def_specification(def_attr) = subprogram_decl;
01029 }
01030
01031
01032
01033
01034 void
01035 DST_add_specification_to_variable (DST_INFO_IDX variable_def,
01036 DST_INFO_IDX field_decl)
01037 {
01038 DST_INFO *def_info;
01039 DST_ATTR_IDX def_attr_idx;
01040 DST_VARIABLE *def_attr;
01041
01042 def_info = DST_INFO_IDX_TO_PTR(variable_def);
01043
01044 DST_ASSERT(!(DST_IS_declaration (DST_INFO_flag(def_info))),
01045 "Try to put specification on declaration");
01046 DST_ASSERT (DST_INFO_tag(def_info) == DW_TAG_variable,
01047 "Try to set field specification on non variable");
01048
01049 def_attr_idx = DST_INFO_attributes(def_info);
01050 def_attr = DST_ATTR_IDX_TO_PTR(def_attr_idx, DST_VARIABLE);
01051 DST_VARIABLE_def_specification(def_attr) = field_decl;
01052 }
01053
01054
01055
01056 void
01057 DST_add_linkage_name_to_variable (DST_INFO_IDX variable_def,
01058 char *linkage_name)
01059 {
01060 DST_INFO *info;
01061 DST_ATTR_IDX attr_idx;
01062 DST_VARIABLE *attr;
01063
01064 info = DST_INFO_IDX_TO_PTR(variable_def);
01065
01066 DST_ASSERT (DST_INFO_tag(info) == DW_TAG_variable,
01067 "Try to set field linkage_name on non variable");
01068
01069 attr_idx = DST_INFO_attributes(info);
01070 attr = DST_ATTR_IDX_TO_PTR(attr_idx, DST_VARIABLE);
01071
01072 if (DST_IS_declaration(DST_INFO_flag(info))) {
01073 DST_VARIABLE_decl_linkage_name(attr) = DST_mk_name(linkage_name);
01074 } else {
01075 DST_VARIABLE_def_linkage_name(attr) = DST_mk_name(linkage_name);
01076 }
01077 }
01078
01079
01080
01081 DST_INFO_IDX
01082 DST_mk_entry_point(USRCPOS decl,
01083 char *name,
01084 DST_INFO_IDX type,
01085 void *subpr)
01086 {
01087 DST_INFO_IDX info_idx;
01088 DST_ATTR_IDX attr_idx;
01089 DST_flag flag = DST_no_flag;
01090 DST_ENTRY_POINT *attr;
01091
01092 #if !(defined(_SUPPORT_IPA) || defined(_STANDALONE_INLINER))
01093 DST_enter_mk(DST_making_dbg_info, last_info_idx);
01094 #endif
01095
01096 info_idx = DST_mk_info();
01097 attr_idx = DST_mk_attr(DST_ENTRY_POINT);
01098 attr = DST_ATTR_IDX_TO_PTR(attr_idx, DST_ENTRY_POINT);
01099
01100 DST_ENTRY_POINT_name(attr) = DST_mk_name(name);
01101 DST_ENTRY_POINT_type(attr) = type;
01102 DST_ENTRY_POINT_decl(attr) = decl;
01103 DST_ENTRY_POINT_first_child(attr) = DST_INVALID_IDX;
01104 DST_ENTRY_POINT_last_child(attr) = DST_INVALID_IDX;
01105 DST_ASSOC_INFO_fe_ptr(DST_ENTRY_POINT_st(attr)) = subpr;
01106 DST_SET_assoc_fe(flag);
01107 return DST_init_info(info_idx, DW_TAG_entry_point, flag, attr_idx);
01108 }
01109
01110
01111
01112
01113 DST_INFO_IDX
01114 DST_mk_common_block(char *name,
01115 void *subpr)
01116 {
01117 DST_INFO_IDX info_idx;
01118 DST_ATTR_IDX attr_idx;
01119 DST_flag flag = DST_no_flag;
01120 DST_COMMON_BLOCK *attr;
01121
01122 #if !(defined(_SUPPORT_IPA) || defined(_STANDALONE_INLINER))
01123 DST_enter_mk(DST_making_dbg_info, last_info_idx);
01124 #endif
01125
01126 info_idx = DST_mk_info();
01127 attr_idx = DST_mk_attr(DST_COMMON_BLOCK);
01128 attr = DST_ATTR_IDX_TO_PTR(attr_idx, DST_COMMON_BLOCK);
01129 DST_COMMON_BLOCK_name(attr) = DST_mk_name(name);
01130 DST_COMMON_BLOCK_first_child(attr) = DST_INVALID_IDX;
01131 DST_COMMON_BLOCK_last_child(attr) = DST_INVALID_IDX;
01132 DST_ASSOC_INFO_fe_ptr(DST_COMMON_BLOCK_st(attr)) = subpr;
01133 DST_SET_assoc_fe(flag);
01134 return DST_init_info(info_idx, DW_TAG_common_block, flag, attr_idx);
01135 }
01136
01137
01138
01139
01140 DST_INFO_IDX
01141 DST_mk_common_incl( USRCPOS decl,
01142 DST_INFO_IDX comblk)
01143 {
01144 DST_INFO_IDX info_idx;
01145 DST_ATTR_IDX attr_idx;
01146 DST_flag flag = DST_no_flag;
01147 DST_COMMON_INCL *attr;
01148
01149 #if !(defined(_SUPPORT_IPA) || defined(_STANDALONE_INLINER))
01150 DST_enter_mk(DST_making_dbg_info, last_info_idx);
01151 #endif
01152
01153 info_idx = DST_mk_info();
01154 attr_idx = DST_mk_attr(DST_COMMON_INCL);
01155 attr = DST_ATTR_IDX_TO_PTR(attr_idx, DST_COMMON_INCL);
01156 DST_COMMON_INCL_decl(attr) = decl;
01157 DST_COMMON_INCL_com_blk(attr) = comblk;
01158 return DST_init_info(info_idx, DW_TAG_common_inclusion, flag, attr_idx);
01159 }
01160
01161
01162
01163
01164 DST_INFO_IDX
01165 DST_mk_lexical_block(char *name,
01166 void *low_pc,
01167 void *high_pc,
01168 DST_INFO_IDX abstract_origin)
01169 {
01170 DST_INFO_IDX info_idx;
01171 DST_ATTR_IDX attr_idx;
01172 DST_flag flag = DST_no_flag;
01173 DST_LEXICAL_BLOCK *attr;
01174
01175 #if !(defined(_SUPPORT_IPA) || defined(_STANDALONE_INLINER))
01176 DST_enter_mk(DST_making_dbg_info, last_info_idx);
01177 #endif
01178 info_idx = DST_mk_info();
01179 attr_idx = DST_mk_attr(DST_LEXICAL_BLOCK);
01180 attr = DST_ATTR_IDX_TO_PTR(attr_idx, DST_LEXICAL_BLOCK);
01181 DST_LEXICAL_BLOCK_name(attr) = DST_mk_name(name);
01182 if (low_pc != NULL && high_pc != NULL)
01183 {
01184
01185
01186
01187 #if defined(_SUPPORT_IPA) || defined(_STANDALONE_INLINER) || defined(_LEGO_CLONER)
01188
01189
01190
01191
01192
01193 DST_ASSOC_INFO_st_idx(DST_LEXICAL_BLOCK_low_pc (attr))
01194 = pDST_ASSOC_INFO_st_idx((DST_ASSOC_INFO *)low_pc);
01195 DST_ASSOC_INFO_st_idx(DST_LEXICAL_BLOCK_high_pc (attr))
01196 = pDST_ASSOC_INFO_st_idx((DST_ASSOC_INFO *)high_pc);
01197 #else
01198 DST_ASSOC_INFO_fe_ptr(DST_LEXICAL_BLOCK_low_pc(attr)) = low_pc;
01199 DST_ASSOC_INFO_fe_ptr(DST_LEXICAL_BLOCK_high_pc(attr)) = high_pc;
01200 DST_SET_assoc_fe(flag);
01201 #endif
01202 }
01203 DST_LEXICAL_BLOCK_abstract_origin(attr) = abstract_origin;
01204 DST_LEXICAL_BLOCK_first_child(attr) = DST_INVALID_IDX;
01205 DST_LEXICAL_BLOCK_last_child(attr) = DST_INVALID_IDX;
01206
01207 return DST_init_info(info_idx, DW_TAG_lexical_block, flag, attr_idx);
01208 }
01209
01210
01211
01212
01213
01214 extern DST_INFO_IDX
01215 DST_mk_label(char *name,
01216 void *low_pc,
01217 DST_INFO_IDX abstract_origin)
01218 {
01219 DST_INFO_IDX info_idx;
01220 DST_ATTR_IDX attr_idx;
01221 DST_flag flag = DST_no_flag;
01222 DST_LABEL *attr;
01223
01224 DST_ASSERT(low_pc != NULL, "Missing low_pc value for label");
01225
01226 #if !(defined(_SUPPORT_IPA) || defined(_STANDALONE_INLINER))
01227 DST_enter_mk(DST_making_dbg_info, last_info_idx);
01228 #endif
01229 info_idx = DST_mk_info();
01230 attr_idx = DST_mk_attr(DST_LABEL);
01231 attr = DST_ATTR_IDX_TO_PTR(attr_idx, DST_LABEL);
01232 DST_LABEL_name(attr) = DST_mk_name(name);
01233
01234
01235
01236
01237 #if defined(_SUPPORT_IPA) || defined(_STANDALONE_INLINER) || defined(_LEGO_CLONER)
01238
01239
01240
01241
01242
01243 DST_ASSOC_INFO_st_idx(DST_LABEL_low_pc (attr))
01244 = pDST_ASSOC_INFO_st_idx((DST_ASSOC_INFO *)low_pc);
01245 #else
01246 DST_ASSOC_INFO_fe_ptr(DST_LABEL_low_pc(attr)) = low_pc;
01247 DST_SET_assoc_fe(flag);
01248 #endif
01249
01250 DST_LABEL_abstract_origin(attr) = abstract_origin;
01251 return DST_init_info(info_idx, DW_TAG_label, flag, attr_idx);
01252 }
01253
01254
01255
01256
01257
01258
01259 DST_INFO_IDX
01260 DST_mk_variable_const(USRCPOS decl,
01261 char *name,
01262 DST_INFO_IDX type,
01263 BOOL is_automatic,
01264 BOOL is_external,
01265 DST_CONST_VALUE cval)
01266 {
01267 DST_INFO_IDX info_idx;
01268 DST_ATTR_IDX attr_idx;
01269 DST_flag flag = DST_no_flag;
01270 DST_VARIABLE *attr;
01271
01272 #if !(defined(_SUPPORT_IPA) || defined(_STANDALONE_INLINER))
01273 DST_enter_mk(DST_making_dbg_info, last_info_idx);
01274 #endif
01275
01276 info_idx = DST_mk_info();
01277 attr_idx = DST_mk_attr(DST_VARIABLE);
01278 attr = DST_ATTR_IDX_TO_PTR(attr_idx, DST_VARIABLE);
01279 DST_VARIABLE_constant_decl(attr) = decl;
01280 DST_VARIABLE_constant_name(attr) = DST_mk_name(name);
01281 DST_VARIABLE_constant_type(attr) = type;
01282 DST_VARIABLE_constant_cval(attr) = cval;
01283 DST_SET_const(flag);
01284 if (is_automatic)
01285 DST_SET_automatic(flag);
01286 else if (is_external)
01287 DST_SET_external(flag);
01288 return DST_init_info(info_idx, DW_TAG_variable, flag, attr_idx);
01289 }
01290
01291
01292
01293
01294 DST_INFO_IDX
01295 DST_mk_variable_comm( USRCPOS decl,
01296 char *name,
01297 DST_INFO_IDX type,
01298 void *feptr,
01299 UINT64 offset)
01300 {
01301 DST_INFO_IDX info_idx;
01302 DST_ATTR_IDX attr_idx;
01303 DST_flag flag = DST_no_flag;
01304 DST_VARIABLE *attr;
01305
01306 #if !(defined(_SUPPORT_IPA) || defined(_STANDALONE_INLINER))
01307 DST_enter_mk(DST_making_dbg_info, last_info_idx);
01308 #endif
01309
01310 info_idx = DST_mk_info();
01311 attr_idx = DST_mk_attr(DST_VARIABLE);
01312 attr = DST_ATTR_IDX_TO_PTR(attr_idx, DST_VARIABLE);
01313 DST_VARIABLE_comm_decl(attr) = decl;
01314 DST_VARIABLE_comm_name(attr) = DST_mk_name(name);
01315 DST_VARIABLE_comm_type(attr) = type;
01316 DST_ASSOC_INFO_fe_ptr(DST_VARIABLE_comm_st(attr)) = feptr;
01317 DST_SET_assoc_fe(flag);
01318 DST_VARIABLE_comm_offs(attr) = offset;
01319 DST_SET_comm(flag);
01320 return DST_init_info(info_idx, DW_TAG_variable, flag, attr_idx);
01321 }
01322
01323
01324
01325
01326 DST_INFO_IDX
01327 DST_mk_variable_memdef(USRCPOS decl,
01328 void *var,
01329 DST_INFO_IDX spec)
01330 {
01331 DST_INFO_IDX info_idx;
01332 DST_ATTR_IDX attr_idx;
01333 DST_flag flag = DST_no_flag;
01334 DST_VARIABLE *attr;
01335
01336 #if !(defined(_SUPPORT_IPA) || defined(_STANDALONE_INLINER))
01337 DST_enter_mk(DST_making_dbg_info, last_info_idx);
01338 #endif
01339
01340 info_idx = DST_mk_info();
01341 attr_idx = DST_mk_attr(DST_VARIABLE);
01342 attr = DST_ATTR_IDX_TO_PTR(attr_idx, DST_VARIABLE);
01343 DST_VARIABLE_memdef_decl(attr) = decl;
01344 DST_VARIABLE_memdef_spec(attr) = spec;
01345
01346
01347 DST_ASSOC_INFO_fe_ptr(DST_VARIABLE_memdef_st(attr)) = var;
01348 DST_SET_assoc_fe(flag);
01349
01350 DST_SET_memdef(flag);
01351 return DST_init_info(info_idx, DW_TAG_variable, flag, attr_idx);
01352 }
01353
01354
01355
01356
01357
01358 DST_INFO_IDX
01359 DST_mk_variable(USRCPOS decl,
01360 char *name,
01361 DST_INFO_IDX type,
01362 UINT64 offs,
01363 void *var,
01364 DST_INFO_IDX abstract_origin,
01365 BOOL is_declaration,
01366 BOOL is_automatic,
01367 BOOL is_external,
01368 BOOL is_artificial)
01369 {
01370 DST_INFO_IDX info_idx;
01371 DST_ATTR_IDX attr_idx;
01372 DST_flag flag = DST_no_flag;
01373 DST_VARIABLE *attr;
01374
01375 DST_ASSERT(!(is_automatic && is_declaration), "automatic must be def!");
01376
01377 #if !(defined(_SUPPORT_IPA) || defined(_STANDALONE_INLINER))
01378 DST_enter_mk(DST_making_dbg_info, last_info_idx);
01379 #endif
01380 info_idx = DST_mk_info();
01381 attr_idx = DST_mk_attr(DST_VARIABLE);
01382 attr = DST_ATTR_IDX_TO_PTR(attr_idx, DST_VARIABLE);
01383 if (is_declaration)
01384 {
01385 DST_VARIABLE_decl_decl(attr) = decl;
01386 DST_VARIABLE_decl_name(attr) = DST_mk_name(name);
01387 DST_VARIABLE_decl_type(attr) = type;
01388 DST_VARIABLE_decl_linkage_name(attr) = DST_INVALID_IDX;
01389 DST_SET_declaration(flag);
01390 }
01391 else
01392 {
01393 DST_VARIABLE_def_decl(attr) = decl;
01394 DST_VARIABLE_def_name(attr) = DST_mk_name(name);
01395 DST_VARIABLE_def_type(attr) = type;
01396 DST_VARIABLE_def_offs(attr) = offs;
01397 DST_VARIABLE_def_abstract_origin(attr) = abstract_origin;
01398 DST_VARIABLE_def_specification(attr) = DST_INVALID_IDX;
01399 DST_VARIABLE_def_linkage_name(attr) = DST_INVALID_IDX;
01400
01401 #if defined(_SUPPORT_IPA) || defined(_STANDALONE_INLINER)
01402
01403
01404
01405
01406
01407 DST_ASSOC_INFO_st_idx(DST_VARIABLE_def_st (attr)) =
01408 pDST_ASSOC_INFO_st_idx((DST_ASSOC_INFO *)var);
01409 #else
01410 #ifdef _LEGO_CLONER
01411 if (var != NULL) {
01412 DST_ASSOC_INFO_st_idx(DST_VARIABLE_def_st (attr)) =
01413 pDST_ASSOC_INFO_st_idx((DST_ASSOC_INFO *)var);
01414 }
01415 else {
01416
01417
01418
01419 DST_ASSOC_INFO_fe_ptr(DST_VARIABLE_def_st(attr)) = var;
01420 DST_SET_assoc_fe(flag);
01421 }
01422 #else
01423
01424 DST_ASSOC_INFO_fe_ptr(DST_VARIABLE_def_st(attr)) = var;
01425 DST_SET_assoc_fe(flag);
01426 #endif
01427 #endif
01428 }
01429 if (is_automatic)
01430 DST_SET_automatic(flag);
01431 else if (is_external)
01432 DST_SET_external(flag);
01433 if (is_artificial)
01434 DST_SET_artificial(flag);
01435 return DST_init_info(info_idx, DW_TAG_variable, flag, attr_idx);
01436 }
01437
01438
01439
01440
01441 DST_INFO_IDX
01442 DST_mk_formal_parameter(USRCPOS decl,
01443 char *name,
01444 DST_INFO_IDX type,
01445 void *parm,
01446 DST_INFO_IDX abstract_origin,
01447 DST_INFO_IDX default_val,
01448 BOOL is_optional,
01449 BOOL is_variable,
01450
01451
01452
01453
01454
01455 BOOL is_artificial,
01456 BOOL is_declaration_only)
01457 {
01458 DST_INFO_IDX info_idx;
01459 DST_ATTR_IDX attr_idx;
01460 DST_flag flag = DST_no_flag;
01461 DST_FORMAL_PARAMETER *attr;
01462
01463 #if !(defined(_SUPPORT_IPA) || defined(_STANDALONE_INLINER))
01464 DST_enter_mk(DST_making_dbg_info, last_info_idx);
01465 #endif
01466
01467 info_idx = DST_mk_info();
01468 attr_idx = DST_mk_attr(DST_FORMAL_PARAMETER);
01469 attr = DST_ATTR_IDX_TO_PTR(attr_idx, DST_FORMAL_PARAMETER);
01470 DST_FORMAL_PARAMETER_decl(attr) = decl;
01471 if (name != NULL)
01472 DST_FORMAL_PARAMETER_name(attr) = DST_mk_name(name);
01473 else
01474 DST_FORMAL_PARAMETER_name(attr) = DST_INVALID_IDX;
01475 DST_FORMAL_PARAMETER_type(attr) = type;
01476
01477
01478 #if defined(_SUPPORT_IPA) || defined(_STANDALONE_INLINER)
01479
01480
01481
01482
01483
01484 DST_ASSOC_INFO_st_idx(DST_FORMAL_PARAMETER_st (attr)) =
01485 pDST_ASSOC_INFO_st_idx((DST_ASSOC_INFO *)parm);
01486 #else
01487 #ifdef _LEGO_CLONER
01488 if (parm != NULL) {
01489 DST_ASSOC_INFO_st_idx(DST_FORMAL_PARAMETER_st (attr)) =
01490 pDST_ASSOC_INFO_st_idx((DST_ASSOC_INFO *)parm);
01491 }
01492 else {
01493
01494
01495 DST_ASSOC_INFO_fe_ptr(DST_FORMAL_PARAMETER_st(attr)) = parm;
01496 }
01497 #else
01498 DST_ASSOC_INFO_fe_ptr(DST_FORMAL_PARAMETER_st(attr)) = parm;
01499 if (parm != NULL)
01500 DST_SET_assoc_fe(flag);
01501 #endif
01502 #endif
01503
01504 DST_FORMAL_PARAMETER_default_val(attr) = default_val;
01505 DST_FORMAL_PARAMETER_abstract_origin(attr) = abstract_origin;
01506 if (is_declaration_only)
01507 DST_SET_declaration(flag);
01508 if (is_optional)
01509 DST_SET_optional_parm(flag);
01510 if (is_variable)
01511 DST_SET_variable_parm(flag);
01512 if (is_artificial)
01513 DST_SET_artificial(flag);
01514 return DST_init_info(info_idx, DW_TAG_formal_parameter, flag, attr_idx);
01515 }
01516
01517
01518
01519
01520
01521 DST_INFO_IDX
01522 DST_mk_unspecified_parameters(USRCPOS decl,
01523 DST_INFO_IDX abstract_origin)
01524 {
01525 DST_INFO_IDX info_idx;
01526 DST_ATTR_IDX attr_idx;
01527 DST_flag flag = DST_no_flag;
01528 DST_UNSPECIFIED_PARAMETERS *attr;
01529
01530 #if !(defined(_SUPPORT_IPA) || defined(_STANDALONE_INLINER))
01531 DST_enter_mk(DST_making_dbg_info, last_info_idx);
01532 #endif
01533
01534 info_idx = DST_mk_info();
01535 attr_idx = DST_mk_attr(DST_UNSPECIFIED_PARAMETERS);
01536 attr = DST_ATTR_IDX_TO_PTR(attr_idx, DST_UNSPECIFIED_PARAMETERS);
01537 DST_UNSPECIFIED_PARAMETERS_decl(attr) = decl;
01538 DST_UNSPECIFIED_PARAMETERS_abstract_origin(attr) = abstract_origin;
01539 return DST_init_info(info_idx, DW_TAG_unspecified_parameters,
01540 flag, attr_idx);
01541 }
01542
01543
01544
01545
01546 DST_INFO_IDX
01547 DST_mk_constant_def(USRCPOS decl,
01548 char *name,
01549 DST_INFO_IDX type,
01550 DST_CONST_VALUE cval,
01551 BOOL is_external)
01552 {
01553 DST_INFO_IDX info_idx;
01554 DST_ATTR_IDX attr_idx;
01555 DST_flag flag = DST_no_flag;
01556 DST_CONSTANT *attr;
01557
01558 #if !(defined(_SUPPORT_IPA) || defined(_STANDALONE_INLINER))
01559 DST_enter_mk(DST_making_dbg_info, last_info_idx);
01560 #endif
01561
01562 info_idx = DST_mk_info();
01563 attr_idx = DST_mk_attr(DST_CONSTANT);
01564 attr = DST_ATTR_IDX_TO_PTR(attr_idx, DST_CONSTANT);
01565 DST_CONSTANT_def_decl(attr) = decl;
01566 DST_CONSTANT_def_name(attr) = DST_mk_name(name);
01567 DST_CONSTANT_def_type(attr) = type;
01568 DST_CONSTANT_def_cval(attr) = cval;
01569 if (is_external)
01570 DST_SET_external(flag);
01571 return DST_init_info(info_idx, DW_TAG_constant, flag, attr_idx);
01572 }
01573
01574
01575
01576
01577
01578 DST_INFO_IDX
01579 DST_mk_constant_decl(USRCPOS decl,
01580 char *name,
01581 DST_INFO_IDX type,
01582 BOOL is_external)
01583 {
01584 DST_INFO_IDX info_idx;
01585 DST_ATTR_IDX attr_idx;
01586 DST_flag flag = DST_no_flag;
01587 DST_CONSTANT *attr;
01588
01589 #if !(defined(_SUPPORT_IPA) || defined(_STANDALONE_INLINER))
01590 DST_enter_mk(DST_making_dbg_info, last_info_idx);
01591 #endif
01592
01593 info_idx = DST_mk_info();
01594 attr_idx = DST_mk_attr(DST_CONSTANT);
01595 attr = DST_ATTR_IDX_TO_PTR(attr_idx, DST_CONSTANT);
01596 DST_CONSTANT_decl_decl(attr) = decl;
01597 DST_CONSTANT_decl_name(attr) = DST_mk_name(name);
01598 DST_CONSTANT_decl_type(attr) = type;
01599 if (is_external)
01600 DST_SET_external(flag);
01601 DST_SET_declaration(flag);
01602 return DST_init_info(info_idx, DW_TAG_constant, flag, attr_idx);
01603 }
01604
01605
01606
01607
01608
01609 DST_INFO_IDX
01610 DST_mk_basetype(char *name,
01611 DST_ATE_encoding encoding,
01612 DST_size_t byte_size)
01613 {
01614 DST_INFO_IDX info_idx;
01615 DST_ATTR_IDX attr_idx;
01616 DST_flag flag = DST_no_flag;
01617 DST_BASETYPE *attr;
01618
01619 #if !(defined(_SUPPORT_IPA) || defined(_STANDALONE_INLINER))
01620 DST_enter_mk(DST_making_dbg_info, last_info_idx);
01621 #endif
01622
01623 info_idx = DST_mk_info();
01624 attr_idx = DST_mk_attr(DST_BASETYPE);
01625 attr = DST_ATTR_IDX_TO_PTR(attr_idx, DST_BASETYPE);
01626 DST_BASETYPE_name(attr) = DST_mk_name(name);
01627 DST_BASETYPE_encoding(attr) = encoding;
01628 DST_BASETYPE_byte_size(attr) = byte_size;
01629
01630 return DST_init_info(info_idx, DW_TAG_base_type, flag, attr_idx);
01631 }
01632
01633
01634
01635
01636 DST_INFO_IDX
01637 DST_mk_const_type(DST_INFO_IDX type)
01638 {
01639 DST_INFO_IDX info_idx;
01640 DST_ATTR_IDX attr_idx;
01641 DST_flag flag = DST_no_flag;
01642 DST_CONST_TYPE *attr;
01643
01644 #if !(defined(_SUPPORT_IPA) || defined(_STANDALONE_INLINER))
01645 DST_enter_mk(DST_making_dbg_info, last_info_idx);
01646 #endif
01647
01648 info_idx = DST_mk_info();
01649 attr_idx = DST_mk_attr(DST_CONST_TYPE);
01650 attr = DST_ATTR_IDX_TO_PTR(attr_idx, DST_CONST_TYPE);
01651 DST_CONST_TYPE_type(attr) = type;
01652 return DST_init_info(info_idx, DW_TAG_const_type, flag, attr_idx);
01653 }
01654
01655
01656
01657
01658 DST_INFO_IDX
01659 DST_mk_volatile_type(DST_INFO_IDX type)
01660 {
01661 DST_INFO_IDX info_idx;
01662 DST_ATTR_IDX attr_idx;
01663 DST_flag flag = DST_no_flag;
01664 DST_VOLATILE_TYPE *attr;
01665
01666 #if !(defined(_SUPPORT_IPA) || defined(_STANDALONE_INLINER))
01667 DST_enter_mk(DST_making_dbg_info, last_info_idx);
01668 #endif
01669
01670 info_idx = DST_mk_info();
01671 attr_idx = DST_mk_attr(DST_VOLATILE_TYPE);
01672 attr = DST_ATTR_IDX_TO_PTR(attr_idx, DST_VOLATILE_TYPE);
01673 DST_VOLATILE_TYPE_type(attr) = type;
01674 return DST_init_info(info_idx, DW_TAG_volatile_type, flag, attr_idx);
01675 }
01676
01677
01678
01679
01680 DST_INFO_IDX
01681 DST_mk_pointer_type(DST_INFO_IDX type,
01682 DST_addr_class address_class,
01683 DST_size_t byte_size)
01684 {
01685 DST_INFO_IDX info_idx;
01686 DST_ATTR_IDX attr_idx;
01687 DST_flag flag = DST_no_flag;
01688 DST_POINTER_TYPE *attr;
01689
01690 #if !(defined(_SUPPORT_IPA) || defined(_STANDALONE_INLINER))
01691 DST_enter_mk(DST_making_dbg_info, last_info_idx);
01692 #endif
01693
01694 info_idx = DST_mk_info();
01695 attr_idx = DST_mk_attr(DST_POINTER_TYPE);
01696 attr = DST_ATTR_IDX_TO_PTR(attr_idx, DST_POINTER_TYPE);
01697 DST_POINTER_TYPE_type(attr) = type;
01698 DST_POINTER_TYPE_address_class(attr) = address_class;
01699 DST_POINTER_TYPE_byte_size(attr) = byte_size;
01700 return DST_init_info(info_idx, DW_TAG_pointer_type, flag, attr_idx);
01701 }
01702
01703
01704
01705
01706 DST_INFO_IDX
01707 DST_mk_reference_type(DST_INFO_IDX type,
01708 DST_addr_class address_class,
01709 DST_size_t byte_size)
01710 {
01711 DST_INFO_IDX info_idx;
01712 DST_ATTR_IDX attr_idx;
01713 DST_flag flag = DST_no_flag;
01714 DST_REFERENCE_TYPE *attr;
01715
01716 #if !(defined(_SUPPORT_IPA) || defined(_STANDALONE_INLINER))
01717 DST_enter_mk(DST_making_dbg_info, last_info_idx);
01718 #endif
01719
01720 info_idx = DST_mk_info();
01721 attr_idx = DST_mk_attr(DST_REFERENCE_TYPE);
01722 attr = DST_ATTR_IDX_TO_PTR(attr_idx, DST_REFERENCE_TYPE);
01723 DST_REFERENCE_TYPE_type(attr) = type;
01724 DST_REFERENCE_TYPE_address_class(attr) = address_class;
01725 DST_REFERENCE_TYPE_byte_size(attr) = byte_size;
01726 return DST_init_info(info_idx, DW_TAG_reference_type, flag, attr_idx);
01727 }
01728
01729
01730
01731
01732 DST_INFO_IDX
01733 DST_mk_typedef(USRCPOS decl,
01734 char *name,
01735 DST_INFO_IDX type,
01736 DST_INFO_IDX abstract_origin)
01737 {
01738 DST_INFO_IDX info_idx;
01739 DST_ATTR_IDX attr_idx;
01740 DST_flag flag = DST_no_flag;
01741 DST_TYPEDEF *attr;
01742
01743 #if !(defined(_SUPPORT_IPA) || defined(_STANDALONE_INLINER))
01744 DST_enter_mk(DST_making_dbg_info, last_info_idx);
01745 #endif
01746
01747 info_idx = DST_mk_info();
01748 attr_idx = DST_mk_attr(DST_TYPEDEF);
01749 attr = DST_ATTR_IDX_TO_PTR(attr_idx, DST_TYPEDEF);
01750 DST_TYPEDEF_decl(attr) = decl;
01751 DST_TYPEDEF_name(attr) = DST_mk_name(name);
01752 DST_TYPEDEF_type(attr) = type;
01753 DST_TYPEDEF_abstract_origin(attr) = abstract_origin;
01754 return DST_init_info(info_idx, DW_TAG_typedef, flag, attr_idx);
01755 }
01756
01757
01758
01759 DST_INFO_IDX
01760 DST_mk_ptr_to_member_type(USRCPOS decl,
01761 char * name,
01762 DST_INFO_IDX type,
01763 DST_INFO_IDX class_type)
01764 {
01765 DST_INFO_IDX info_idx;
01766 DST_ATTR_IDX attr_idx;
01767 DST_flag flag = DST_no_flag;
01768 DST_PTR_TO_MEMBER_TYPE *attr;
01769
01770 #if !(defined(_SUPPORT_IPA) || defined(_STANDALONE_INLINER))
01771 DST_enter_mk(DST_making_dbg_info, last_info_idx);
01772 #endif
01773
01774 info_idx = DST_mk_info();
01775 attr_idx = DST_mk_attr(DST_PTR_TO_MEMBER_TYPE);
01776 attr = DST_ATTR_IDX_TO_PTR(attr_idx, DST_PTR_TO_MEMBER_TYPE);
01777 DST_PTR_TO_MEMBER_TYPE_name(attr) = DST_mk_name(name);
01778 DST_PTR_TO_MEMBER_TYPE_type(attr) = type;
01779 DST_PTR_TO_MEMBER_TYPE_class_type(attr) = class_type;
01780 return DST_init_info(info_idx,
01781 DW_TAG_ptr_to_member_type,
01782 flag,
01783 attr_idx);
01784 }
01785
01786
01787
01788 DST_INFO_IDX
01789 DST_mk_array_type(USRCPOS decl,
01790 char *name,
01791 DST_INFO_IDX type,
01792 DST_size_t byte_size,
01793 DST_INFO_IDX abstract_origin,
01794 BOOL is_incomplete)
01795 {
01796 DST_INFO_IDX info_idx;
01797 DST_ATTR_IDX attr_idx;
01798 DST_flag flag = DST_no_flag;
01799 DST_ARRAY_TYPE *attr;
01800
01801 #if !(defined(_SUPPORT_IPA) || defined(_STANDALONE_INLINER))
01802 DST_enter_mk(DST_making_dbg_info, last_info_idx);
01803 #endif
01804
01805 info_idx = DST_mk_info();
01806 attr_idx = DST_mk_attr(DST_ARRAY_TYPE);
01807 attr = DST_ATTR_IDX_TO_PTR(attr_idx, DST_ARRAY_TYPE);
01808 DST_ARRAY_TYPE_decl(attr) = decl;
01809 DST_ARRAY_TYPE_name(attr) = DST_mk_name(name);
01810 DST_ARRAY_TYPE_type(attr) = type;
01811 DST_ARRAY_TYPE_byte_size(attr) = byte_size;
01812 DST_ARRAY_TYPE_abstract_origin(attr) = abstract_origin;
01813 DST_ARRAY_TYPE_first_child(attr) = DST_INVALID_IDX;
01814 DST_ARRAY_TYPE_last_child(attr) = DST_INVALID_IDX;
01815 if (is_incomplete)
01816 DST_SET_declaration(flag);
01817 return DST_init_info(info_idx, DW_TAG_array_type, flag, attr_idx);
01818 }
01819
01820
01821
01822
01823 DST_INFO_IDX
01824 DST_mk_subrange_type(DST_flag is_lb_cval,
01825 DST_cval_ref low,
01826 DST_flag is_ub_cval,
01827 DST_cval_ref high)
01828 {
01829 DST_INFO_IDX info_idx;
01830 DST_ATTR_IDX attr_idx;
01831 DST_flag flag = DST_no_flag;
01832 DST_SUBRANGE_TYPE *attr;
01833
01834 #if !(defined(_SUPPORT_IPA) || defined(_STANDALONE_INLINER))
01835 DST_enter_mk(DST_making_dbg_info, last_info_idx);
01836 #endif
01837
01838 info_idx = DST_mk_info();
01839 attr_idx = DST_mk_attr(DST_SUBRANGE_TYPE);
01840 attr = DST_ATTR_IDX_TO_PTR(attr_idx, DST_SUBRANGE_TYPE);
01841 if (is_lb_cval) {
01842 DST_SUBRANGE_TYPE_lower_cval(attr) = low.cval;
01843 DST_SET_lb_cval(flag);
01844 } else {
01845 DST_SUBRANGE_TYPE_lower_ref(attr) = low.ref;
01846 }
01847 if (is_ub_cval) {
01848 DST_SUBRANGE_TYPE_upper_cval(attr) = high.cval;
01849 DST_SET_ub_cval(flag);
01850 } else {
01851 DST_SUBRANGE_TYPE_upper_ref(attr) = high.ref;
01852 }
01853
01854 DST_SUBRANGE_TYPE_stride_ref(attr) = DST_INVALID_IDX ;
01855
01856 return DST_init_info(info_idx, DW_TAG_subrange_type, flag, attr_idx);
01857 }
01858
01859
01860
01861
01862 extern DST_INFO_IDX
01863 DST_mk_string_type(USRCPOS decl,
01864 char *name,
01865 DST_flag is_len_cval,
01866 DST_cval_ref len)
01867 {
01868 DST_INFO_IDX info_idx;
01869 DST_ATTR_IDX attr_idx;
01870 DST_flag flag = DST_no_flag;
01871 DST_STRING_TYPE *attr;
01872
01873 #if !(defined(_SUPPORT_IPA) || defined(_STANDALONE_INLINER))
01874 DST_enter_mk(DST_making_dbg_info, last_info_idx);
01875 #endif
01876
01877 info_idx = DST_mk_info();
01878 attr_idx = DST_mk_attr(DST_STRING_TYPE);
01879 attr = DST_ATTR_IDX_TO_PTR(attr_idx, DST_STRING_TYPE);
01880 DST_STRING_TYPE_decl(attr) = decl;
01881 DST_STRING_TYPE_name(attr) = DST_mk_name(name);
01882 if (is_len_cval) {
01883 DST_STRING_TYPE_len_cval(attr) = len.cval;
01884 DST_SET_cval(flag);
01885 } else {
01886 DST_STRING_TYPE_len_ref(attr) = len.ref;
01887 }
01888 return DST_init_info(info_idx, DW_TAG_string_type, flag, attr_idx);
01889 }
01890
01891
01892
01893
01894 DST_INFO_IDX
01895 DST_mk_structure_type(USRCPOS decl,
01896 char *name,
01897 DST_size_t byte_size,
01898 DST_INFO_IDX abstract_origin,
01899 BOOL is_incomplete)
01900 {
01901 DST_INFO_IDX info_idx;
01902 DST_ATTR_IDX attr_idx;
01903 DST_flag flag = DST_no_flag;
01904 DST_STRUCTURE_TYPE *attr;
01905
01906 #if !(defined(_SUPPORT_IPA) || defined(_STANDALONE_INLINER))
01907 DST_enter_mk(DST_making_dbg_info, last_info_idx);
01908 #endif
01909
01910 info_idx = DST_mk_info();
01911 attr_idx = DST_mk_attr(DST_STRUCTURE_TYPE);
01912 attr = DST_ATTR_IDX_TO_PTR(attr_idx, DST_STRUCTURE_TYPE);
01913 DST_STRUCTURE_TYPE_decl(attr) = decl;
01914 DST_STRUCTURE_TYPE_name(attr) = DST_mk_name(name);
01915 DST_STRUCTURE_TYPE_byte_size(attr) = byte_size;
01916 DST_STRUCTURE_TYPE_abstract_origin(attr) = abstract_origin;
01917 DST_STRUCTURE_TYPE_first_child(attr) = DST_INVALID_IDX;
01918 DST_STRUCTURE_TYPE_last_child(attr) = DST_INVALID_IDX;
01919 if (is_incomplete)
01920 DST_SET_declaration(flag);
01921 return DST_init_info(info_idx, DW_TAG_structure_type, flag, attr_idx);
01922 }
01923
01924
01925
01926
01927 DST_INFO_IDX
01928 DST_mk_union_type(USRCPOS decl,
01929 char *name,
01930 DST_size_t byte_size,
01931 DST_INFO_IDX abstract_origin,
01932 BOOL is_incomplete)
01933 {
01934 DST_INFO_IDX info_idx;
01935 DST_ATTR_IDX attr_idx;
01936 DST_flag flag = DST_no_flag;
01937 DST_UNION_TYPE *attr;
01938
01939 #if !(defined(_SUPPORT_IPA) || defined(_STANDALONE_INLINER))
01940 DST_enter_mk(DST_making_dbg_info, last_info_idx);
01941 #endif
01942
01943 info_idx = DST_mk_info();
01944 attr_idx = DST_mk_attr(DST_UNION_TYPE);
01945 attr = DST_ATTR_IDX_TO_PTR(attr_idx, DST_UNION_TYPE);
01946 DST_UNION_TYPE_decl(attr) = decl;
01947 DST_UNION_TYPE_name(attr) = DST_mk_name(name);
01948 DST_UNION_TYPE_byte_size(attr) = byte_size;
01949 DST_UNION_TYPE_abstract_origin(attr) = abstract_origin;
01950 DST_UNION_TYPE_first_child(attr) = DST_INVALID_IDX;
01951 DST_UNION_TYPE_last_child(attr) = DST_INVALID_IDX;
01952 if (is_incomplete)
01953 DST_SET_declaration(flag);
01954 return DST_init_info(info_idx, DW_TAG_union_type, flag, attr_idx);
01955 }
01956
01957
01958
01959
01960 DST_INFO_IDX
01961 DST_mk_class_type(USRCPOS decl,
01962 char *name,
01963 DST_size_t byte_size,
01964 DST_INFO_IDX abstract_origin,
01965 BOOL is_incomplete)
01966 {
01967 DST_INFO_IDX info_idx;
01968 DST_ATTR_IDX attr_idx;
01969 DST_flag flag = DST_no_flag;
01970 DST_CLASS_TYPE *attr;
01971
01972 #if !(defined(_SUPPORT_IPA) || defined(_STANDALONE_INLINER))
01973 DST_enter_mk(DST_making_dbg_info, last_info_idx);
01974 #endif
01975
01976 info_idx = DST_mk_info();
01977 attr_idx = DST_mk_attr(DST_CLASS_TYPE);
01978 attr = DST_ATTR_IDX_TO_PTR(attr_idx, DST_CLASS_TYPE);
01979 DST_CLASS_TYPE_decl(attr) = decl;
01980 DST_CLASS_TYPE_name(attr) = DST_mk_name(name);
01981 DST_CLASS_TYPE_byte_size(attr) = byte_size;
01982 DST_CLASS_TYPE_abstract_origin(attr) = abstract_origin;
01983 DST_CLASS_TYPE_first_child(attr) = DST_INVALID_IDX;
01984 DST_CLASS_TYPE_last_child(attr) = DST_INVALID_IDX;
01985 if (is_incomplete)
01986 DST_SET_declaration(flag);
01987 return DST_init_info(info_idx, DW_TAG_class_type, flag, attr_idx);
01988 }
01989
01990
01991
01992
01993
01994
01995
01996 DST_INFO_IDX
01997 DST_mk_member(USRCPOS decl,
01998 char *name,
01999 DST_INFO_IDX type,
02000 DST_size_t memb_loc,
02001 DST_size_t byte_size,
02002 DST_bitsize bit_offset,
02003 DST_bitsize bit_size,
02004 BOOL is_bitfield,
02005 BOOL is_static,
02006 BOOL is_declaration,
02007 BOOL is_artificial)
02008 {
02009 DST_INFO_IDX info_idx;
02010 DST_ATTR_IDX attr_idx;
02011 DST_flag flag = DST_no_flag;
02012 DST_MEMBER *attr;
02013
02014 #if !(defined(_SUPPORT_IPA) || defined(_STANDALONE_INLINER))
02015 DST_enter_mk(DST_making_dbg_info, last_info_idx);
02016 #endif
02017
02018 info_idx = DST_mk_info();
02019 attr_idx = DST_mk_attr(DST_MEMBER);
02020 attr = DST_ATTR_IDX_TO_PTR(attr_idx, DST_MEMBER);
02021 DST_MEMBER_decl(attr) = decl;
02022 DST_MEMBER_name(attr) = DST_mk_name(name);
02023 DST_MEMBER_type(attr) = type;
02024 if (is_declaration)
02025 DST_SET_declaration(flag);
02026 else {
02027 DST_MEMBER_memb_loc(attr) = memb_loc;
02028 DST_MEMBER_byte_size(attr) = byte_size;
02029 DST_MEMBER_bit_offset(attr) = bit_offset;
02030 DST_MEMBER_bit_size(attr) = bit_size;
02031 if (is_bitfield)
02032 DST_SET_bitfield(flag);
02033 }
02034 if (is_static)
02035 DST_SET_static(flag);
02036 if (is_artificial)
02037 DST_SET_artificial(flag);
02038 return DST_init_info(info_idx, DW_TAG_member, flag, attr_idx);
02039 }
02040
02041
02042
02043
02044 DST_INFO_IDX
02045 DST_mk_inheritance(USRCPOS decl,
02046 DST_INFO_IDX type,
02047 DST_virtuality virtuality,
02048 DST_size_t memb_loc)
02049 {
02050 DST_INFO_IDX info_idx;
02051 DST_ATTR_IDX attr_idx;
02052 DST_flag flag = DST_no_flag;
02053 DST_INHERITANCE *attr;
02054
02055 #if !(defined(_SUPPORT_IPA) || defined(_STANDALONE_INLINER))
02056 DST_enter_mk(DST_making_dbg_info, last_info_idx);
02057 #endif
02058
02059 info_idx = DST_mk_info();
02060 attr_idx = DST_mk_attr(DST_INHERITANCE);
02061 attr = DST_ATTR_IDX_TO_PTR(attr_idx, DST_INHERITANCE);
02062 DST_INHERITANCE_decl(attr) = decl;
02063 DST_INHERITANCE_type(attr) = type;
02064 DST_INHERITANCE_virtuality(attr) = virtuality;
02065 DST_INHERITANCE_memb_loc(attr) = memb_loc;
02066 return DST_init_info(info_idx, DW_TAG_inheritance, flag, attr_idx);
02067 }
02068
02069
02070
02071
02072 extern DST_INFO_IDX
02073 DST_mk_template_type_parameter(USRCPOS decl,
02074 char *name,
02075 DST_INFO_IDX type)
02076 {
02077 DST_INFO_IDX info_idx;
02078 DST_ATTR_IDX attr_idx;
02079 DST_flag flag = DST_no_flag;
02080 DST_TEMPLATE_TYPE_PARAMETER *attr;
02081
02082 #if !(defined(_SUPPORT_IPA) || defined(_STANDALONE_INLINER))
02083 DST_enter_mk(DST_making_dbg_info, last_info_idx);
02084 #endif
02085
02086 info_idx = DST_mk_info();
02087 attr_idx = DST_mk_attr(DST_TEMPLATE_TYPE_PARAMETER);
02088 attr = DST_ATTR_IDX_TO_PTR(attr_idx, DST_TEMPLATE_TYPE_PARAMETER);
02089 DST_TEMPLATE_TYPE_PARAMETER_decl(attr) = decl;
02090 DST_TEMPLATE_TYPE_PARAMETER_name(attr) = DST_mk_name(name);
02091 DST_TEMPLATE_TYPE_PARAMETER_type(attr) = type;
02092 return DST_init_info(info_idx, DW_TAG_template_type_param,
02093 flag, attr_idx);
02094 }
02095
02096
02097
02098
02099 extern DST_INFO_IDX
02100 DST_mk_template_value_parameter(USRCPOS decl,
02101 char *name,
02102 DST_INFO_IDX type,
02103 DST_CONST_VALUE cval)
02104 {
02105 DST_INFO_IDX info_idx;
02106 DST_ATTR_IDX attr_idx;
02107 DST_flag flag = DST_no_flag;
02108 DST_TEMPLATE_VALUE_PARAMETER *attr;
02109
02110 #if !(defined(_SUPPORT_IPA) || defined(_STANDALONE_INLINER))
02111 DST_enter_mk(DST_making_dbg_info, last_info_idx);
02112 #endif
02113
02114 info_idx = DST_mk_info();
02115 attr_idx = DST_mk_attr(DST_TEMPLATE_VALUE_PARAMETER);
02116 attr = DST_ATTR_IDX_TO_PTR(attr_idx, DST_TEMPLATE_VALUE_PARAMETER);
02117 DST_TEMPLATE_VALUE_PARAMETER_decl(attr) = decl;
02118 DST_TEMPLATE_VALUE_PARAMETER_name(attr) = DST_mk_name(name);
02119 DST_TEMPLATE_VALUE_PARAMETER_cval(attr) = cval;
02120 DST_TEMPLATE_VALUE_PARAMETER_type(attr) = type;
02121 return DST_init_info(info_idx, DW_TAG_template_value_param,
02122 flag, attr_idx);
02123 }
02124
02125
02126
02127
02128
02129 DST_INFO_IDX
02130 DST_mk_enumeration_type(USRCPOS decl,
02131 char *name,
02132 DST_size_t byte_size,
02133 DST_INFO_IDX abstract_origin,
02134 BOOL is_incomplete)
02135 {
02136 DST_INFO_IDX info_idx;
02137 DST_ATTR_IDX attr_idx;
02138 DST_flag flag = DST_no_flag;
02139 DST_ENUMERATION_TYPE *attr;
02140
02141 #if !(defined(_SUPPORT_IPA) || defined(_STANDALONE_INLINER))
02142 DST_enter_mk(DST_making_dbg_info, last_info_idx);
02143 #endif
02144
02145 info_idx = DST_mk_info();
02146 attr_idx = DST_mk_attr(DST_ENUMERATION_TYPE);
02147 attr = DST_ATTR_IDX_TO_PTR(attr_idx, DST_ENUMERATION_TYPE);
02148 DST_ENUMERATION_TYPE_decl(attr) = decl;
02149 DST_ENUMERATION_TYPE_name(attr) = DST_mk_name(name);
02150 DST_ENUMERATION_TYPE_byte_size(attr) = byte_size;
02151 DST_ENUMERATION_TYPE_abstract_origin(attr) = abstract_origin;
02152 DST_ENUMERATION_TYPE_first_child(attr) = DST_INVALID_IDX;
02153 DST_ENUMERATION_TYPE_last_child(attr) = DST_INVALID_IDX;
02154 if (is_incomplete)
02155 DST_SET_declaration(flag);
02156 return DST_init_info(info_idx, DW_TAG_enumeration_type, flag, attr_idx);
02157 }
02158
02159
02160
02161
02162 DST_INFO_IDX
02163 DST_mk_enumerator(USRCPOS decl,
02164 char *name,
02165 DST_CONST_VALUE cval)
02166 {
02167 DST_INFO_IDX info_idx;
02168 DST_ATTR_IDX attr_idx;
02169 DST_flag flag = DST_no_flag;
02170 DST_ENUMERATOR *attr;
02171
02172 #if !(defined(_SUPPORT_IPA) || defined(_STANDALONE_INLINER))
02173 DST_enter_mk(DST_making_dbg_info, last_info_idx);
02174 #endif
02175
02176 info_idx = DST_mk_info();
02177 attr_idx = DST_mk_attr(DST_ENUMERATOR);
02178 attr = DST_ATTR_IDX_TO_PTR(attr_idx, DST_ENUMERATOR);
02179 DST_ENUMERATOR_decl(attr) = decl;
02180 DST_ENUMERATOR_name(attr) = DST_mk_name(name);
02181 DST_ENUMERATOR_cval(attr) = cval;
02182 return DST_init_info(info_idx, DW_TAG_enumerator, flag, attr_idx);
02183 }
02184
02185
02186
02187
02188 DST_INFO_IDX
02189 DST_mk_subroutine_type(USRCPOS decl,
02190 char *name,
02191 DST_INFO_IDX type,
02192 DST_INFO_IDX abstract_origin,
02193 BOOL is_prototyped)
02194 {
02195 DST_INFO_IDX info_idx;
02196 DST_ATTR_IDX attr_idx;
02197 DST_flag flag = DST_no_flag;
02198 DST_SUBROUTINE_TYPE *attr;
02199
02200 #if !(defined(_SUPPORT_IPA) || defined(_STANDALONE_INLINER))
02201 DST_enter_mk(DST_making_dbg_info, last_info_idx);
02202 #endif
02203
02204 info_idx = DST_mk_info();
02205 attr_idx = DST_mk_attr(DST_SUBROUTINE_TYPE);
02206 attr = DST_ATTR_IDX_TO_PTR(attr_idx, DST_SUBROUTINE_TYPE);
02207 DST_SUBROUTINE_TYPE_decl(attr) = decl;
02208 DST_SUBROUTINE_TYPE_name(attr) = DST_mk_name(name);
02209 DST_SUBROUTINE_TYPE_type(attr) = type;
02210 DST_SUBROUTINE_TYPE_abstract_origin(attr) = abstract_origin;
02211 DST_SUBROUTINE_TYPE_first_child(attr) = DST_INVALID_IDX;
02212 DST_SUBROUTINE_TYPE_last_child(attr) = DST_INVALID_IDX;
02213 if (is_prototyped)
02214 DST_SET_prototyped(flag);
02215 return DST_init_info(info_idx, DW_TAG_subroutine_type, flag, attr_idx);
02216 }
02217