def generateSourceLink()

in crashes.py [0:0]


def generateSourceLink(frame):
  # examples:
  # https://hg.mozilla.org/mozilla-central/file/2da6d806f45732e169fd8e7ea9a9761fa7fed93d/netwerk/protocol/http/OpaqueResponseUtils.cpp#l208
  # https://crash-stats.mozilla.org/sources/highlight/?url=https://gecko-generated-sources.s3.amazonaws.com/7d3f7c890af...e97be06f948921153/ipc/ipdl/PCompositorManagerParent.cpp&line=200#L-200
  # 'file': 's3:gecko-generated-sources:8276fd848664bea270...8e363bdbc972cdb7eb661c4043de93ce27810b54/ipc/ipdl/PWebGLParent.cpp:',
  # 'file': 'hg:hg.mozilla.org/mozilla-central:dom/canvas/WebGLParent.cpp:52d2c9e672d0a0c50af4d6c93cc0239b9e751d18',
  # 'line': 59,
  srcLineNumer = str()
  srcfileData = str()
  srcUrl = str()
  try:
    srcLineNumber = frame['line']
    srcfileData = frame['file']
    tokenList = srcfileData.split(':')
    if (len(tokenList) != 4):
      print("bad token list " + tokenList)
      return str()
  except:
    return str()

  if tokenList[0].find('s3') == 0:
    srcUrl = 'https://crash-stats.mozilla.org/sources/highlight/?url=https://gecko-generated-sources.s3.amazonaws.com/'
    srcUrl += tokenList[2]
    srcUrl += '&line='
    srcUrl += str(srcLineNumber)
    srcUrl += '#L-'
    srcUrl += str(srcLineNumber)
  elif tokenList[0].find('hg') == 0:
    srcUrl = 'https://'
    srcUrl += tokenList[1]
    srcUrl += '/file/'
    srcUrl += tokenList[3]
    srcUrl += '/'
    srcUrl += tokenList[2]
    srcUrl += '#l' + str(srcLineNumber)
  else:
    #print("Unknown src annoutation source") this happens a lot
    return str()

  return srcUrl