debugDDe (1158408), страница 3

Файл №1158408 debugDDe (Раздаточные материалы) 3 страницаdebugDDe (1158408) страница 32019-09-18СтудИзба
Просмтор этого файла доступен только зарегистрированным пользователям. Но у нас супер быстрая регистрация: достаточно только электронной почты!

Текст из файла (страница 3)

Figure 2. The variable-table representation

The following structure is used to store elements of table of variables:

typedef struct tag_VarInfo

{

byte

Busy;

void *

VarAddr;

long

PrevNo;

int

EnvirIndex;

byte

Type;

SysHandle *

Handle;

void *

Info;

int

Tag;

byte

IsInit;

PFN_VARTABLE_ELEMDESTRUCTOR

pfnDestructor;

}

VarInfo;

Busy

flag is equal 1 if this element contains valid variable information and 0 if variable is removed from the table of variables. This flag is used for work optimization and preventing frequent memory copying.

VarAddr

variable address;

PrevNo

the number of table of variables element that describes the same variable on a previous level

EnvirIndex

number of the variable level

Type

the class of variable using

Handle

handle of a distributed array. It is not equal to zero if this element describes a distributed array

Info

pointer to an additional variable information structure. It is depended on a variable type.

Tag

flag to store various variable attributes according to type of variable usage

IsInit

flag of variable initialization. Is used for scalar variables.

pfnDestructor

pointer to variable description destructor. This function is called when variable is removed from the table of variables. It can be equal NULL

The following structure describes a variable table:

typedef struct tag_VAR_TABLE

{

HASH_TABLE

hIndex;

TABLE

vTable;

}

VAR_TABLE;

hIndex

hash-table. It is used for searching variable information by its address.

vTable

table used to keep variable information

The following functions are intended for work with table of variables:

void vartable_Init( VAR_TABLE *VT, int vTableSize, int hIndexSize, int hTableSize, PFN_CALC_HASH_FUNC Func )

VT

pointer to table of variables structure to be initialized

vTableSize

size of vTable expanding;

hIndexSize

size of hash-index array of hIndex;

hTableSize

size of hash-table hIndex expanding;

Func

pointer to a function that calculates hash-value by variable address.

The function initializes the table of variables.

void vartable_Done( VAR_TABLE *VT );

VT

pointer to table of variables structure

The function destructs table of variables.

VarInfo *vartable_GetVarInfo( VAR_TABLE *VT, long NoVar )

VT

pointer to table of variables structure

NoVar

number of variable in the table of variables

The function returns the variable information from the table of variables by variable number. The NoVar should point to a valid table of variables element.

VarInfo *vartable_FindVar( VAR_TABLE *VT, void * Addr )

VT

pointer to table of variables structure

Addr

variable address.

The function returns the variable information from the table of variables by variable address. The function returns NULL if a variable with such address is not registered.

long vartable_FindNoVar( VAR_TABLE *VT, void * Addr )

VT

pointer to table of variables structure

Addr

variable address.

The function returns the variable number by variable address. The function returns –1 if a variable with such address is not registered.

long vartable_PutVariable(VAR_TABLE* VT, void* Addr, int Env, byte Type, SysHandle* Handle, int Tag, void* Info, PFN_VARTABLE_ELEMDESTRUCTOR pfnDestructor)

VT

pointer to table of variables structure

Addr

variable address.

Env

variable level

Type

class of variable usage

Handle

distributed array handle if distributed array is registered

Tag

variable attributes;

Info

pointer to additional variable information;

pfnDestructor

pointer to variable information destructor. It can be NULL

The function registers of a new variable in the table of variables and returns a number of the registered variable.

void vartable_VariableDone( VarInfo* Var )

Var

pointer to variable information structure

The function uninitializes variable information structure. The function sets the Busy flag to 0 and calls corresponding variable information destructor if available.

void vartable_RemoveVariable( VAR_TABLE *VT, void * Addr )

VT

pointer to table of variables structure.

Addr

variable address.

The function removes variable information from the table of variables.

void vartable_RemoveAll( VAR_TABLE *VT );

VT

pointer to table of variables structure.

The function removes all variables from the table of variables.

void vartable_RemoveVarOnLevel( VAR_TABLE *VT, int Level )

VT

pointer to table of variables structure.

Level

executed level

The function removes all variables with the specified variable level.

void vartable_Iterator( VAR_TABLE *VT, PFN_VARTABLEITERATION Func )

VT

pointer to table of variables structure.

Func

iteration function with the following prototype:

void (*PFN_VARTABLEITERATION)( VarInfo * ).

All the pointers to variable information structures from the variable table are passed to the function.

The function applies the same operation for all the elements of the table of variables.

void vartable_LevelIterator(VAR_TABLE* VT, int Level, PFN_VARTABLEITERATION Func)

VT

pointer to table of variables structure.

Level

variable level

Func

iteration function with the following prototype:

void (*PFN_VARTABLEITERATION)( VarInfo * ).

All the variable information structures of the table of variables with specified variable level are passed to the function

The function applies the same operation for all the elements of the table of variables with specified variable level.

4.4Diagnostics output module

The module of diagnostics output has special requirements. The special requirements are demanded to the module of diagnostics. In the first, the detailed context of detected error should be reported. In the second, it is necessary to prevent output of many errors of the same type and in the same execution context that is possible when examining a program with the large loops.

At last, it is necessary to allow the user to output diagnostics both on a screen, and in a file for the consequent analysis.

The diagnostics module consists of two modules. The sub-module of context processing monitors current execution context of the program and allows to get a detailed current context description for diagnostics. The sub-module of diagnostics output prints detected errors and filters errors of the same type.

4.4.1Processing diagnostics context

The program execution context represents description of all current executed loops and current values of all their iteration variables. The current context varies each time, when entering or leaving the parallel or sequential loop or when new iteration execution begins.

Характеристики

Список файлов учебной работы

Свежие статьи
Популярно сейчас
Как Вы думаете, сколько людей до Вас делали точно такое же задание? 99% студентов выполняют точно такие же задания, как и их предшественники год назад. Найдите нужный учебный материал на СтудИзбе!
Ответы на популярные вопросы
Да! Наши авторы собирают и выкладывают те работы, которые сдаются в Вашем учебном заведении ежегодно и уже проверены преподавателями.
Да! У нас любой человек может выложить любую учебную работу и зарабатывать на её продажах! Но каждый учебный материал публикуется только после тщательной проверки администрацией.
Вернём деньги! А если быть более точными, то автору даётся немного времени на исправление, а если не исправит или выйдет время, то вернём деньги в полном объёме!
Да! На равне с готовыми студенческими работами у нас продаются услуги. Цены на услуги видны сразу, то есть Вам нужно только указать параметры и сразу можно оплачивать.
Отзывы студентов
Ставлю 10/10
Все нравится, очень удобный сайт, помогает в учебе. Кроме этого, можно заработать самому, выставляя готовые учебные материалы на продажу здесь. Рейтинги и отзывы на преподавателей очень помогают сориентироваться в начале нового семестра. Спасибо за такую функцию. Ставлю максимальную оценку.
Лучшая платформа для успешной сдачи сессии
Познакомился со СтудИзбой благодаря своему другу, очень нравится интерфейс, количество доступных файлов, цена, в общем, все прекрасно. Даже сам продаю какие-то свои работы.
Студизба ван лав ❤
Очень офигенный сайт для студентов. Много полезных учебных материалов. Пользуюсь студизбой с октября 2021 года. Серьёзных нареканий нет. Хотелось бы, что бы ввели подписочную модель и сделали материалы дешевле 300 рублей в рамках подписки бесплатными.
Отличный сайт
Лично меня всё устраивает - и покупка, и продажа; и цены, и возможность предпросмотра куска файла, и обилие бесплатных файлов (в подборках по авторам, читай, ВУЗам и факультетам). Есть определённые баги, но всё решаемо, да и администраторы реагируют в течение суток.
Маленький отзыв о большом помощнике!
Студизба спасает в те моменты, когда сроки горят, а работ накопилось достаточно. Довольно удобный сайт с простой навигацией и огромным количеством материалов.
Студ. Изба как крупнейший сборник работ для студентов
Тут дофига бывает всего полезного. Печально, что бывают предметы по которым даже одного бесплатного решения нет, но это скорее вопрос к студентам. В остальном всё здорово.
Спасательный островок
Если уже не успеваешь разобраться или застрял на каком-то задание поможет тебе быстро и недорого решить твою проблему.
Всё и так отлично
Всё очень удобно. Особенно круто, что есть система бонусов и можно выводить остатки денег. Очень много качественных бесплатных файлов.
Отзыв о системе "Студизба"
Отличная платформа для распространения работ, востребованных студентами. Хорошо налаженная и качественная работа сайта, огромная база заданий и аудитория.
Отличный помощник
Отличный сайт с кучей полезных файлов, позволяющий найти много методичек / учебников / отзывов о вузах и преподователях.
Отлично помогает студентам в любой момент для решения трудных и незамедлительных задач
Хотелось бы больше конкретной информации о преподавателях. А так в принципе хороший сайт, всегда им пользуюсь и ни разу не было желания прекратить. Хороший сайт для помощи студентам, удобный и приятный интерфейс. Из недостатков можно выделить только отсутствия небольшого количества файлов.
Спасибо за шикарный сайт
Великолепный сайт на котором студент за не большие деньги может найти помощь с дз, проектами курсовыми, лабораторными, а также узнать отзывы на преподавателей и бесплатно скачать пособия.
Популярные преподаватели
Добавляйте материалы
и зарабатывайте!
Продажи идут автоматически
7021
Авторов
на СтудИзбе
260
Средний доход
с одного платного файла
Обучение Подробнее