Skip to content

Commit dc5d385

Browse files
committed
update rust docs for mac users
1 parent 10bcd5d commit dc5d385

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

docs/RUN.md

+20-2
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,29 @@ You can start debugging with a simple
3636

3737
There are a couple of small difficulties.
3838

39-
Instead of showing your `main` function the initial screen will be blank and `gdbgui` will print `File not found: main`.
39+
1.) Instead of showing your `main` function the initial screen will be blank and `gdbgui` will print `File not found: main`.
4040
You need to help `gdbgui` out by typing `main` into the file browser box:
4141

4242
![](https://raw.githubusercontent.com/cs01/gdbgui/master/screenshots/rust_main.png)
4343

4444
and selecting the `main.rs` file. The source code should then appear in the browser and you can click to set breakpoints
4545
and run the program. Of course, if you want to break in some other file, you can find that in the file browser instead.
4646

47-
The second difficulty is with the GDB pretty-printing macros that Rust ships with. GDB can't find these by default,
47+
**Note for macOS Users:** When you load your rust binary on a mac, you may see many warnings like this
48+
49+
> warning /Users/user/examples/rust/target/debug/deps/hello-486956f9dde465e5.9elsx31vb4it187.rcgu.o': can't open to read symbols: No such file or directory.
50+
51+
Symbols are names of variables, functions and types defined in your program. You can define symbols for your program by loading symbol files. gdb usually does this automatically for you, but sometimes has trouble finding the right paths.
52+
53+
In this case, you need to manually tell gdb where the symbol files is; it's usually the first part of the missing file. In the above example, it's `hello-486956f9dde465e5.9elsx31vb4it187.rcgu.o`.
54+
55+
You can load this into gdb with the following command (changed as appropriate):
56+
57+
```
58+
symbol-file /Users/user/git/gdbgui/examples/rust/target/debug/deps/hello-486956f9dde465e5
59+
```
60+
61+
2.) The GDB pretty-printing macros that Rust ships with. GDB can't find these by default,
4862
which makes it print the message
4963

5064
```
@@ -60,6 +74,10 @@ describes the workarounds necessary (create a `.gdbinit` file and paste a few li
6074
* If you want to debug programs compiled in Release mode, you will need to create a `profile.release` section in your
6175
`Cargo.toml` and add `debug = true` to it. See the [Cargo manifest](https://doc.rust-lang.org/stable/cargo/reference/manifest.html) for details.
6276

77+
78+
79+
and now gdb will be able to see which files were used to compile your binary, among other things.
80+
6381
### Running gdbgui Remotely
6482
Because gdbgui is a server, it naturally allows you to debug programs running on other computers.
6583

0 commit comments

Comments
 (0)