TAILIEUCHUNG - Lecture Visual programming: Chapter 23 - Muhammad Bilal Zafar

The following will be discussed in this chapter: Constructing LALR parsing tables, efficient construction of LALR parsing tables, compaction of LR parsing tables, ambiguous grammars, precedence and associativity t o resolve conflicts, the "dangling-else" ambiguity, error recovery in LR parsing. | LESSON 22 Overview of Previous Lesson(s) Over View Assertions assert() library function is declared in the cassert header to check logical conditions in native C++ program that should always be true. _DEBUG symbol The preprocessor symbol DEBUG is automatically defined in the debug version of a native C++program. 3 Over View Debugging code Add our own debugging code by enclosing it between an #ifdef / #endif pair of directives testing for DEBUG. header The header supplies declarations for functions to provide debugging of free store operations. 4 Over View _crtDbgFlag flag By setting the crtDbgFlag appropriately enables automatic checking of program for memory leaks. Debug output To direct output messages from the free store debugging functions, we can call the CrtSetReportMode() and CrtSetReportFile() functions. 5 Over View. Debugging Dynamic Memory Allocating memory dynamically is a major source of bugs. In this context most common bugs are memory leaks. Sometimes, this can result in a tragic failure of the program when all available memory has been allocated. 6 Over View. Problem diagnosed Name class is allocating memory for its data members, and never releasing it. The problem is that in implementing the class, we forgot the fundamental rules related to classes. Solution A destructor A copy constructor The assignment operator. 7 TODAY’S LESSON Contents C++ / CLI Programming Using the Debug and Trace Classes Generating Output Setting the Output Destination Indenting the Output Controlling Output Assertions Program 9 Debugging CLI Programs Life is simpler with C++/CLI programming. No complications of corrupted pointers or memory leaks arise in CLR programs, so this reduces the debugging problem substantially. Breakpoints and tracepoints can be set exactly the same way. 10 Debugging CLI Programs We have a specific option that applies to C++/CLI code for preventing the debugger from stepping through library code. 11 Debug & Trace Classes The

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.