Solve both parts ,---- | /// INITIAL /// | void phase02(){ | int a = atoi(next_input()); | > int b = atoi(next_input()); | int c = atoi(next_input()); | .... | | char *next_input(){ | input_idx++; | int ret = fscanf(input_fh, "%s", inputs[input_idx]); | ... | `---- When the `next' command is executed by GDB, then the debugger executes some code and leaves the state of the running program in one of the following positions: ,---- | /// OPTION A /// | void phase02(){ | int a = atoi(next_input()); | int b = atoi(next_input()); | > int c = atoi(next_input()); | .... | | char *next_input(){ | input_idx++; | int ret = fscanf(input_fh, "%s", inputs[input_idx]); | ... | | /// OPTION B /// | void phase02(){ | int a = atoi(next_input()); | > int b = atoi(next_input()); | int c = atoi(next_input()); | .... | | char *next_input(){ | input_idx++; | int ret = fscanf(input_fh, "%s", inputs[input_idx]); | ... | | /// OPTION C /// | void phase02(){ | int a = atoi(next_input()); | int b = atoi(next_input()); | int c = atoi(next_input()); | .... | | char *next_input(){ | > input_idx++; | int ret = fscanf(input_fh, "%s", inputs[input_idx]); | ... `---- (A) After executing `next', which option correctly indicates where GDB will get control back? (B) Instead of using the `next' command in the above example, what if the `step' command was used instead from the `INITIAL' position? Which `OPTION' represents the code position GDB would be at after `step'
Solve both parts
,----
| /// INITIAL ///
| void phase02(){
| int a = atoi(next_input());
| > int b = atoi(next_input());
| int c = atoi(next_input());
| ....
|
| char *next_input(){
| input_idx++;
| int ret = fscanf(input_fh, "%s", inputs[input_idx]);
| ...
|
`----
When the `next' command is executed by GDB, then the debugger executes
some code and leaves the state of the running program in one of the
following positions:
,----
| /// OPTION A ///
| void phase02(){
| int a = atoi(next_input());
| int b = atoi(next_input());
| > int c = atoi(next_input());
| ....
|
| char *next_input(){
| input_idx++;
| int ret = fscanf(input_fh, "%s", inputs[input_idx]);
| ...
|
| /// OPTION B ///
| void phase02(){
| int a = atoi(next_input());
| > int b = atoi(next_input());
| int c = atoi(next_input());
| ....
|
| char *next_input(){
| input_idx++;
| int ret = fscanf(input_fh, "%s", inputs[input_idx]);
| ...
|
| /// OPTION C ///
| void phase02(){
| int a = atoi(next_input());
| int b = atoi(next_input());
| int c = atoi(next_input());
| ....
|
| char *next_input(){
| > input_idx++;
| int ret = fscanf(input_fh, "%s", inputs[input_idx]);
| ...
`----
(A) After executing `next', which option correctly indicates where GDB
will get control back?
(B) Instead of using the `next' command in the above example, what if the
`step' command was used instead from the `INITIAL' position? Which
`OPTION' represents the code position GDB would be at after `step'?
![](/static/compass_v2/shared-icons/check-mark.png)
Step by step
Solved in 3 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)