Skip to content

Commit

Permalink
Add info about debugging during julia's bootstrap
Browse files Browse the repository at this point in the history
  • Loading branch information
timholy committed Apr 29, 2015
1 parent 048706a commit c991a23
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions doc/devdocs/debuggingtips.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,23 @@ Calling a particular method

Since this function is used for every call, you will make everything 1000x slower if you do this.

Debugging during julia's build process (bootstrap)
--------------------------------------------------

Errors that occur during ``make`` need special handling. Julia is built in two stages, constructing
``sys0`` and ``sys.ji``. To see what commands are running at the time of failure, use ``make VERBOSE=1``.

At the time of this writing, you can debug build errors during the ``sys0`` phase from the ``base``
directory using::

julia/base$ gdb --args ../usr/bin/julia-debug -C native --build ../usr/lib/julia/sys0 sysimg.jl

You might need to delete all the files in ``usr/lib/julia/`` to get this to work.

You can debug the ``sys.ji`` phase using::

julia/base$ gdb --args .../usr/bin/julia-debug -C native --build ../usr/lib/julia/sys -J ../usr/lib/julia/sys0.ji sysimg.jl

Mozilla's Record and Replay Framework (rr)
---------------------------------------------

Expand Down

3 comments on commit c991a23

@ihnorton
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Jameson pointed out that the full path to sysimg is no longer necessary, so you can do julia -C native --build sys sysimg.jl (or sys0)

@ihnorton
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, I try to avoid debugging bootstrap at all costs now:

@timholy
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're my new best friend. This hadn't penetrated my consciousness yet, so thanks for the reminder about its existence!

For what I'm doing now, the old way isn't too bad, because almost all of my changes are to the C code (which, paradoxically, is in a few ways easier because building is so much faster). But for the future, I'm totally sold on this.

I'll add a version of this to the docs.

Please sign in to comment.