Firefox symbols

There is only a script for GDB available hat downloads the symbols.

The important part of the script is this function:

def munge_build_id(build_id):
    '''
    Breakpad stuffs the build id into a GUID struct so the bytes are
    flipped from the standard presentation.
    '''
    b = list(map(''.join, list(zip(*[iter(build_id.upper())]*2))))
    return ''.join(itertools.chain(reversed(b[:4]), reversed(b[4:6]),
                                   reversed(b[6:8]), b[8:16])) + '0'

Then the procedure to get symbols is:

  • Run file on the file you want to get symbols for, and note the part after BuildID[sha1]
  • Use the function above to convert the build id
  • Download https://symbols.mozilla.org/{filename}/{url_id}/{filename}.dbg.gz

Now you can use the symbols after gunzip One thing to make it easier is to use objcopy --add-gnu-debuglink so afterwards it is automatically loaded.