Lecture 8 Flashcards

1
Q

What does the gdb Run

command do?

A

Execute the program

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What does break do?

A

Sets a breakpoint, a place for the program to stop

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What does next do?

A

Runs until the next instruction in the this function

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What does step do?

A

Stops at the next instruction call anywhere

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What does continue do?

A

run until the next breakpoint

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What does print do?

A

show the value of a variable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What does set do?

A

Change the value of a variable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What does jump do?

A

Start executing at a different line number

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is enable/disable?

A

Turn breakpoints on or off

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the anatomy of a running program?

A

Executable code of the program
Global Variables
Call Stack
Heap

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What two parts of the anatomy of a running program are created at compile time?

A

Executable code of the program

Global Variables

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the executable?

A

the instructions to run

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is the call stack?

A

where we track function calls

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the heap?

A

where dynamic memory allocation happens. Space that lives beyond the end of a function.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What do we use the call stack for?

A

We use it to track which function we’re currently using.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What happens when we call a function?

A
  • We create a stack frame for it

- Add the frame to the stack

17
Q

What does the stack frame hold?

A

The instructions to execute in the calling function when the function ends

Hardware information
Register Values
Parameters for the function
Space for local variables in the function

18
Q

What happens when a function ends?

A

The stack frame for the function is removed from the call stack, so all the information disappears.

19
Q

How are startup information values provided to the program?

A

It’s provided as parameters to main()

One parameter to say how many items are passed to your program

One array of strings to hold all of the items passed to your program

20
Q

Will a char hold unicode values?

A

No, it holds ascii values

Why? Because it’s only a byte