Skip to content

Commit 5e25086

Browse files
authored
Merge branch 'master' into Issue5
2 parents 242bf58 + 80780c5 commit 5e25086

File tree

16 files changed

+700
-4
lines changed

16 files changed

+700
-4
lines changed

.github/ISSUE_TEMPLATE/topic-proposal.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Topic proposal
33
about: Describes a topic that should be considered by SG20 for education guidelines
44
title: "[TOPIC-REQUEST]"
55
labels: Needs triaging
6-
assignees: BobSteagall, cjdb, jcvw
6+
assignees: vulder, jcvw
77

88
---
99

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: Collect git metadata
2424
id: git_metadata
2525
run: |
26-
echo "{VERSION}::{${GITHUB_REF#refs/tags/v}}" >> $GITHUB_OUTPUT
26+
echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
2727
# The following builds the document in multiple formats for deployment.
2828
- name: Build the document.
2929
shell: bash

sources/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ knowledge_areas_summary.md: $(SOURCES) knowledge_areas.dat
115115
$(MAKE_MARKDOWN) < knowledge_areas.dat > knowledge_areas_summary.md
116116

117117
contributors.md:
118-
git log --all --pretty="%aN" | sort | uniq > contributors.md
118+
git log --format="%aN%n%(trailers:key=Co-authored-by,valueonly=true)" | sed 's/ <.*>//g' | sort | uniq > contributors.md
119119

120120
################################################################################
121121
# Establish Pandoc settings.

sources/knowledge_areas.dat

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ EH Error Handling
5555
? ? ? ? errno
5656
? ? ? ? Error Codes
5757
eh y y y Exception Handling
58+
PD Program Design
59+
cont y y y Containers
60+
DE Debugging Errors
61+
compiletimeerr y y y Compile-Time Errors
62+
runtimeerr y y y Run-time Errors
5863
SL Standard Library
5964
? ? ? ? Input/Output (I/O)
6065
? ? ? ? Containers, Iterators, and Algorithms
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
## Module name: Build systems
2+
3+
_Skeleton descriptions are typeset in italic text,_
4+
_so please don't remove these descriptions when editing the topic._
5+
6+
### Overview
7+
8+
_Provides a short natural language abstract of the module’s contents._
9+
_Specifies the different levels of teaching._
10+
11+
------------------------------------------------------------------------
12+
Level Objective
13+
----------------- ------------------------------------------------------
14+
Foundational --- Knowledge about build systems
15+
16+
Main --- Usage of build system to compile a executable
17+
18+
Advanced --- Add external libraries as a dependencies
19+
20+
------------------------------------------------------------------------
21+
22+
### Motivation
23+
24+
_Why is this important?_
25+
_Why do we want to learn/teach this topic?_
26+
27+
* Building complex C++ projects by hand is tricky
28+
* Build systems can help to resolve dependencies
29+
* Build systems can help do distribute C++ code and help other to compile the code
30+
* Build systems can help to find and include libraries as dependencies
31+
* Build systems faciliate project management
32+
* All major C++ projects are distributed with build systems
33+
34+
### Topic introduction
35+
36+
_Very brief introduction to the topic._
37+
38+
Build systems are used to configure, build, and install complex C++ projects.
39+
40+
41+
### Foundational: Knowledge about build systems
42+
43+
#### Background/Required Knowledge
44+
45+
A student:
46+
* Should know how to compile and link C++ programs
47+
48+
49+
#### Student outcomes
50+
51+
_A list of things "a student should be able to" after the curriculum._
52+
_The next word should be an action word and testable in an exam._
53+
_Max 5 items._
54+
55+
A student should be able to:
56+
57+
1. To explain what a build system is
58+
2. To explain that a build systems resolves dependencies
59+
3. To explain that a build system supports compilation for different operating systems and architectures
60+
61+
#### Caveats
62+
63+
_This section mentions subtle points to understand, like anything resulting in
64+
implementation-defined, unspecified, or undefined behavior._
65+
66+
None
67+
68+
#### Points to cover
69+
70+
_This section lists important details for each point._
71+
72+
* Mention that many build systems are available for C++
73+
* Mention benefits and challenges
74+
* Build system help to only compile the C++ files with code changes and not the complete project
75+
76+
### Main: Usage of build system to compile a executable
77+
78+
#### Background/Required Knowledge
79+
80+
* All of the above.
81+
82+
#### Student outcomes
83+
84+
A student should be able to:
85+
86+
1. Download a C++ package and build the package
87+
2. Write a configuration file to compile a C++ executable
88+
3. Pass compiler options via the build system
89+
4. Use the build system to generate the executable
90+
5. Write a configuration file to compile a library and link the library to a C++ executable
91+
92+
#### Caveats
93+
94+
The instructions are restricted to the chosen build system and
95+
not easily transferable.
96+
97+
98+
#### Points to cover
99+
100+
* Include paths to header files to the configuration
101+
* Adding compiler flags
102+
* How to build Release and Debug builds
103+
* Linking external libraries to the C++ project
104+
* Support compilation on different operating systems, compilers, and architectures
105+
106+
107+
### Advanced
108+
109+
_These are important topics that are not expected to be covered but provide
110+
guidance where one can continue to investigate this topic in more depth._
111+
112+
* How to build libraries
113+
* How to have external libraries be downloaded during the build process
114+
* Mention that build systems provide support for unit testing
115+
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
## Debugging Errors: Build errors
2+
3+
_Skeleton descriptions are typeset in italic text,_
4+
_so please don't remove these descriptions when editing the topic._
5+
6+
This topic is currently under construction and will soon be filled with information :)
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
## Debugging Errors: Compile-time errors {#compiletimeerr}
2+
3+
_Skeleton descriptions are typeset in italic text,_
4+
_so please don't remove these descriptions when editing the topic._
5+
6+
### Overview
7+
8+
_Provides a short natural language abstract of the module’s contents._
9+
_Specifies the different levels of teaching._
10+
11+
------------------------------------------------------------------------
12+
Level Objective
13+
----------------- ------------------------------------------------------
14+
Foundational Understanding elementary error messages
15+
16+
Main Dealing with most error messages
17+
18+
Advanced ---
19+
20+
------------------------------------------------------------------------
21+
22+
### Motivation
23+
24+
_Why is this important?_
25+
_Why do we want to learn/teach this topic?_
26+
27+
Compiler error messages can be hard to read and even compiler specific.
28+
However, they contain valuable information for determining the cause of the compile-time errors.
29+
Oftentimes the error messages are very verbose to give you the most precise information about the error context, so learning how to extract the valuable information from the error message is an important skill that one should acquire.
30+
31+
### Topic introduction
32+
33+
_Very brief introduction to the topic._
34+
35+
C++ compilers try to statically determine errors at compile time to shift detection of problems that would occur later on (e.g., at link time or run time) to earlier point in time, where they can be addressed in an earlier stage of the development process.
36+
The error message that the compiler generates directly relates to the C++ language definition and precisely lays out why the code is not valid and where it does not comply with the language rules.
37+
38+
### Foundational: Understanding elementary error messages {#compiletimeerr-found}
39+
40+
#### Background/Required Knowledge
41+
42+
A student:
43+
44+
* definitions [[C++ Object Model: Definitions - Foundational]][1]
45+
46+
#### Student outcomes
47+
48+
_A list of things "a student should be able to" after the curriculum._
49+
_The next word should be an action word and testable in an exam._
50+
_Max 5 items._
51+
52+
A student should be able to:
53+
54+
1. distill the core of an elementary error message.
55+
2. act on elementary error messages.
56+
3. differentiate between different error kinds (e.g., type errors, syntax errors, ...).
57+
4. give examples for different kinds of errors.
58+
59+
60+
#### Caveats
61+
62+
_This section mentions subtle points to understand, like anything resulting in
63+
implementation-defined, unspecified, or undefined behavior._
64+
65+
* names mentioned in error message are presented in full detail and may not look exactly like specified by the programmer (e.g., `std::string` -> `std::basic_string<char>`)
66+
67+
#### Points to cover
68+
69+
_This section lists important details for each point._
70+
71+
* methodology of reading error messages
72+
* start with the first error
73+
* read top down
74+
* parse error message / pattern matching to error kinds
75+
* linker errors [[Debugging Errors: Build errors - Foundational]][2]
76+
77+
78+
### Main: Dealing with most error messages {#compiletimeerr-main}
79+
80+
#### Background/Required Knowledge
81+
82+
* compile-time programming [Soft dependency]
83+
84+
#### Student outcomes
85+
86+
A student should be able to:
87+
88+
1. locate the principle template involved in a template error message.
89+
2. determine why a specific overload is chosen, from the compiler’s error message.
90+
3. apply common debugging techniques in a constexpr context.
91+
92+
#### Caveats
93+
94+
* argument dependent lookup
95+
* there is currently no good debugger support for constexpr context
96+
97+
#### Points to cover
98+
99+
* templates related error messages
100+
* overload resolution related errors
101+
* reasoning about errors during constexpr execution (consteval)
102+
* reverting to non-constexpr run-time debugging
103+
* employing static_assert
104+
105+
### Advanced
106+
107+
_These are important topics that are not expected to be covered but provide
108+
guidance where one can continue to investigate this topic in more depth._
109+
110+
* Full error analysis, there are error messages that are out of the scope for students.
111+
* Complicated SFINAE constructs
112+
113+
[1]: ../object-model/definitions.md
114+
[2]: ../debugging-errors/build-errors.md
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
## Debugging errors: Run-time errors {#runtimeerr}
2+
3+
_Skeleton descriptions are typeset in italic text,_
4+
_so please don't remove these descriptions when editing the topic._
5+
6+
### Overview
7+
8+
_Provides a short natural language abstract of the module’s contents._
9+
_Specifies the different levels of teaching._
10+
11+
------------------------------------------------------------------------
12+
Level Objective
13+
----------------- ------------------------------------------------------
14+
Foundational Identifying the run-time error cause
15+
16+
Main Introspection methodologies to trackdown run-time errors
17+
18+
Advanced ---
19+
20+
------------------------------------------------------------------------
21+
22+
### Motivation
23+
24+
_Why is this important?_
25+
_Why do we want to learn/teach this topic?_
26+
27+
Code correctness is important, as erroneous programs can lead to real-world catastrophes, take for example, medical equipment failures that lead to people being exposed to too much radiation.
28+
Techniques, such as, testing or fuzzing, help developers to identify erroneous states of the program.
29+
However, when these techniques discover a run-time error, it’s up to the programmer to reason about and find the root cause of such run-time errors, so they need a well established process to debug run-time errors.
30+
31+
### Topic introduction
32+
33+
_Very brief introduction to the topic._
34+
35+
There exists a wide variety of methodologies, techniques, and tools to debug run-time errors.
36+
In this topic, we give an overview of these and highlight how they can be applied to track down run-time errors in C++ programs.
37+
38+
### Foundational: Identifying the run-time error cause {#runtimeerr-found}
39+
40+
#### Background/Required Knowledge
41+
42+
A student:
43+
44+
* should be able to produce a basic running program.
45+
46+
#### Student outcomes
47+
48+
_A list of things "a student should be able to" after the curriculum._
49+
_The next word should be an action word and testable in an exam._
50+
_Max 5 items._
51+
52+
A student should be able to:
53+
54+
1. verify the output of the program and identify incorrect outcomes.
55+
2. phrase hypothesis what could cause the run-time error.
56+
3. observe and extract program state at specific points of the program, to verify hypotheses.
57+
4. make their program as observable as possible.
58+
59+
#### Caveats
60+
61+
_This section mentions subtle points to understand, like anything resulting in
62+
implementation-defined, unspecified, or undefined behavior._
63+
64+
* run-time debugging can be domain specific
65+
* not everything about the program state can be easily observed, students should be aware of that and learn basic techniques to make programs more observable
66+
* students should be aware that the compilation mode (optimized vs debug) affects the debugging experience and also the program state itself
67+
68+
69+
#### Points to cover
70+
71+
_This section lists important details for each point._
72+
73+
* the basics of using a debugger
74+
* compiling with debug information
75+
* observability techniques, such as, logging output or even `printf` statements
76+
77+
### Main: Introspection methodologies to trackdown run-time errors {#runtimeerr-main}
78+
79+
#### Background/Required Knowledge
80+
81+
* All of the above.
82+
83+
#### Student outcomes
84+
85+
A student should be able to:
86+
87+
1. use a debugger to inspect and manipulate program state
88+
2. extract crash information using proper libraries
89+
3. can create a minimal reproducible example
90+
91+
#### Caveats
92+
93+
* Different forms of multiprocessing programs can have varying impact on debuggability, such as:
94+
* parallel stl algorithms
95+
* multi threading
96+
* coroutines
97+
* vector parallelism
98+
99+
100+
#### Points to cover
101+
102+
* How to use debuggers and the multitude of features they offer to manipulate and observe program state (e.g., break points, trap points, stack traces, manipulating program state).
103+
* Use (non) standard library support for crash information extraction, e.g., logging libraries, libraries to capture crash reports, and sanitizer libraries (asan/ubsan/tsan).
104+
* Creating minimal reproducible example and regressions tests from the extracted crash information.
105+
106+
107+
### Advanced {#runtimeerr-advanced}
108+
109+
_These are important topics that are not expected to be covered but provide
110+
guidance where one can continue to investigate this topic in more depth._
111+
112+
* ABI incompatibilities can have impact debugging experience where even observability tools, such as, debuggers, cannot correctly show the state of the program.
113+
* Debugging in embedded environments.

0 commit comments

Comments
 (0)