Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tips for disabling compiler optimization in debug guide #442

Merged
merged 1 commit into from
Sep 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion content/guides/debugging.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@
* one that includes debugging information and symbols (`.dbg` file extension)
* one that does not

Before using GDB, go to the configuration menu under `Build Options` and select a `Debug information level` that is bigger than 0.
Before using GDB, make sure compiler optimization is turned off: in the configuration menu, go to `Build Options` --> `Optimization level` and select `No optimizations`.
Then, under `Build Options`, select a `Debug information level` that is bigger than 0.
We recommend 3, the highest level.

<Image
Expand Down Expand Up @@ -360,7 +361,7 @@

For instructions on building `app-hellworld` using the manual method, see the [application README](https://github.com/unikraft/app-helloworld).

#### Linuxu

Check failure on line 364 in content/guides/debugging.mdx

View workflow job for this annotation

GitHub Actions / Markdown Linter

Multiple headings with the same content [Context: "#### Linuxu"]

For the image for the **linuxu** platform we can use GDB directly with the binary already created because
the resulting image is an actual Linux binary.
Expand All @@ -369,7 +370,7 @@
gdb build/app-helloworld_linuxu-x86_64.dbg
```

#### KVM

Check failure on line 373 in content/guides/debugging.mdx

View workflow job for this annotation

GitHub Actions / Markdown Linter

Multiple headings with the same content [Context: "#### KVM"]

To avoid using a command with a lot of parameters that you noticed above in the **KVM** section, we can use [the `qemu-guest` script](https://github.com/unikraft/unikraft/blob/staging/support/scripts/qemu-guest).

Expand Down Expand Up @@ -487,7 +488,7 @@

1. Investigate memory addresses (using the `x` instruction - such as `x/s $rbp-0x120`), do instruction stepping (`stepi` or `nexti`), use breakpoints (`break *<address>`) and find out the secret.

### 03. Bug or feature?

Check failure on line 491 in content/guides/debugging.mdx

View workflow job for this annotation

GitHub Actions / Markdown Linter

line per sentence one line (and only one line) per sentence [Expected one sentence per line. Multiple end of sentence punctuation signs found on one line!]

There are two kernel images located in the `03-bug-or-feature` folder.
One of them is build for **Linuxu**, the other for **KVM**.
Expand All @@ -500,7 +501,7 @@
It was built from the code source, but when you will try to run it, you will not get a segmentation fault.
Is this a bug or a feature?

#### Support Instructions

Check failure on line 504 in content/guides/debugging.mdx

View workflow job for this annotation

GitHub Actions / Markdown Linter

Multiple headings with the same content [Context: "#### Support Instructions"]

Use the `connect.sh` and `debug.sh` scripts located in the task directory for debugging a Unikraft instance.

Expand Down Expand Up @@ -543,7 +544,7 @@

1. Deduce what the issue is.

### 04. Nginx with or without main? That's the question

Check failure on line 547 in content/guides/debugging.mdx

View workflow job for this annotation

GitHub Actions / Markdown Linter

line per sentence one line (and only one line) per sentence [Expected one sentence per line. Multiple end of sentence punctuation signs found on one line!]

Let's try a new application based on networking, **Nginx**.

Expand Down
Loading