Skip to content

Commit f4f1ac8

Browse files
authored
Merge pull request numpy#26070 from adrinjalali/doc/debug
DOC clarifications on debugging numpy
2 parents 0cfd0c5 + 7641d8d commit f4f1ac8

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

doc/source/dev/development_environment.rst

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,10 @@ of Python is encouraged, see :ref:`advanced_debugging`.
247247

248248
In terms of debugging, NumPy also needs to be built in a debug mode. You need to use
249249
``debug`` build type and disable optimizations to make sure ``-O0`` flag is used
250-
during object building. To generate source-level debug information within the build process run::
250+
during object building. Note that NumPy should NOT be installed in your environment
251+
before you build with the ``spin build`` command.
252+
253+
To generate source-level debug information within the build process run::
251254

252255
$ spin build --clean -- -Dbuildtype=debug -Ddisable-optimization=true
253256

@@ -271,13 +274,14 @@ you want to debug. For instance ``mytest.py``::
271274
x = np.arange(5)
272275
np.empty_like(x)
273276

274-
Now, you can run::
277+
Note that your test file needs to be outside the NumPy clone you have. Now, you can
278+
run::
275279

276-
$ spin gdb mytest.py
280+
$ spin gdb /path/to/mytest.py
277281

278282
In case you are using clang toolchain::
279283

280-
$ lldb python mytest.py
284+
$ spin lldb /path/to/mytest.py
281285

282286
And then in the debugger::
283287

0 commit comments

Comments
 (0)