Skip to content

Commit

Permalink
updated gdb.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Ameenafz248 committed Aug 19, 2024
1 parent db0d425 commit 759a95d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/gdb.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ $1 = (struct tnode\*) 0x0

![start](img/gdb/t2.jpeg)

We habe reached Null node represented by 0x0 in hexadecimal
We have reached the Null node represented by 0x0 in hexadecimal

---

Expand Down Expand Up @@ -319,7 +319,7 @@ As expected we found "hij" to the right of "\*" node

---

Further continuing the debugging, we will find Null node to the left of "hij" node
Further continuing the debugging, we will find the Null node to the left of "hij" node

Now, when we move right from node "hij"

Expand Down Expand Up @@ -347,7 +347,7 @@ GDB will monitor the value of the root pointer, and whenever the value of the va

## Infinte Loop

One of the important use cases of GDB start when we encounter a segmentation fault or infinte loop, and trust me, we encounter such errors more often than we thin in the upcoming stages, as the syntax tree becomes more and more complex, during those times, GDB debugging of the syntax tree to verify the contents and to find out went wrong is very helpful and saves a lot of time.
One of the most critical use cases for GDB arises when we encounter a segmentation fault or an infinite loop. These issues become increasingly common as the syntax tree grows more complex in later stages. In such situations, using GDB to debug the syntax tree, verify its contents, and identify what went wrong is invaluable. It can save a significant amount of time and effort in troubleshooting these complex errors.

In this example, we can see an infinite loop, for the problem infix to prefix problem. let us see how we can use GDB to find the error in the construction of the express tree / syntax tree.

Expand Down

0 comments on commit 759a95d

Please sign in to comment.