Sunday, 6 March 2016

Low Level Programming Sessions Summary18, 6th March

Low Level Programming Sessions Summary 18

6th March

This session we talked a lot about debugging techniques and how to use and implement them in our codebase. This was quite helpful, now I know about some additional functionality to visual studio and how I may be able to debug crashes after release, which was something I was eager to know. After all, the release build can be broken even if the debug build isn't.

Crash dumps are snapshots of a system which are taken at the point of a crash. They record the line number of the crash as well as what was in the stack, and sometimes even the heap at that time. They can be quite useful in debugging, but also, can not be much use at all. I see them being of limited use, though they may help in showing how the crash happened and how the compiler may be at fault. 

The compiler rearranges code to be effective in release build, which can often cause crashes and bugs to occur. The programmer can use preprocessor directives to stop this, but otherwise, will be limited by the compiler. 

We also discussed linking errors, symbol tables and pdb files. Symbol files are functions and variables and their place in memory. Each of these are assigned a symbol and put in a 'table' which the complier can use to select functions and variables for reading and writing. These symbol files are generated at the linking phase, so they are linking errors rather than compile errors. The tables themselves are stored in pdb files which are generated by visual studio.

We also talked about all of the other extra files that visual studio generates and why it needs to do this. Essentially it is converting memory addresses and bytes of data into human friendly symbols, which are the tags we use when writing code.

The source and header files are stored as .object files, which are generated at compile time once again. These are temporary files which visual studio uses to create our codebase.

Overall, perhaps not the most useful things to know, but it could help quite a bit when it comes to debugging release builds and trying to work with visual studio.

No comments:

Post a Comment