)]}'
{
  "commit": "180a5d4e6e1521d466cad739007e9f00480188e3",
  "tree": "1bb37b02cd688ded28fc567e37bf2ff986ef9f8f",
  "parents": [
    "17953bea613c7852121bb3dc1cbb6579eceaece9"
  ],
  "author": {
    "name": "Michael Pratt",
    "email": "mpratt@google.com",
    "time": "Tue Jun 27 11:07:48 2023 -0400"
  },
  "committer": {
    "name": "Michael Pratt",
    "email": "mpratt@google.com",
    "time": "Fri Jun 30 18:45:26 2023 +0000"
  },
  "message": "internal/core: refactor loading for maintainability\n\nLoading a new core.Process in core.Core is a rather long, complex\nprocess. Currently, this function creates a stub Process with very few\nfields set, and then subsequent method calls initially the remaining\nfields.\n\nThe problem with this approach is that the inputs/requirements and\noutputs of these initialization methods is poorly documented. These\nmethods (e.g., readCore) usually have some prerequisite fields in Process\nthat must be set on entry, and some fields that they set prior to\nreturn.\n\nNeither of these are well documented, and many are far from obvious. For\nexample, Process.mainExecName is initialized in readCore -\u003e readNote -\u003e\nreadNTFile -\u003e openMappedFile.\n\nThis is made more of a mess by the fact that Process tries to do most\ninitialization with a single pass, resulting in fields getting\ninitialized in unintuitive locations (such as mainExecName).\n\nThese combine to make refactoring to support new functionality\ndifficult, as changing ordering breaks implicit dependencies between\nmethods.\n\nThis CL addresses these issues by eliminating the iterative\ninitialization of Process. Instead, Process is only instantiated once\nall fields are ready. During loading, all work is done by free\nfunctions/types, where inputs and outputs are explicit via function\narguments/returns.\n\nThis may inadvertently improve golang/go#44757, as it makes main binary\nlookup more explicit.\n\nThis CL intends to keep behavior the same, but there are a few changes:\n\n* If the entry point is unknown, We no longer apply the heuristic of\n  assuming that first executable mapping is the main binary. This could\n  be added back, but it is probably better to ensure that the entry\n  point is available on all architectures.\n\n* Failure to ELF parse a file for symbols isn\u0027t a hard error (as the\n  mapped file might not even be an ELF).\n\nFor golang/go#57447.\n\nChange-Id: I7c3712ccb99ceddddc6adbae57d477c25ff4e5ba\nReviewed-on: https://go-review.googlesource.com/c/debug/+/506558\nReviewed-by: Michael Knyszek \u003cmknyszek@google.com\u003e\nRun-TryBot: Michael Pratt \u003cmpratt@google.com\u003e\nTryBot-Result: Gopher Robot \u003cgobot@golang.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "654422e44a2e095c2a3e013aefc05590de5cf61a",
      "old_mode": 33188,
      "old_path": "internal/core/core_test.go",
      "new_id": "7c16bda5f6bcdedb91d2d3b838a30c306dc81391",
      "new_mode": 33188,
      "new_path": "internal/core/core_test.go"
    },
    {
      "type": "modify",
      "old_id": "18ef4e27e7b8ff595142121b87091952a837d856",
      "old_mode": 33188,
      "old_path": "internal/core/mapping.go",
      "new_id": "4c8c3cfb343832b2647a2c833676ac09bf007e4c",
      "new_mode": 33188,
      "new_path": "internal/core/mapping.go"
    },
    {
      "type": "modify",
      "old_id": "cc7328b839edbfa3958281624a1d07f637faf0b6",
      "old_mode": 33188,
      "old_path": "internal/core/process.go",
      "new_id": "441549355fa8578796d4d6580a3409ecebf15dc7",
      "new_mode": 33188,
      "new_path": "internal/core/process.go"
    },
    {
      "type": "modify",
      "old_id": "6d3b7ddcc15fc135979b592d89ebfcc9bf1e9157",
      "old_mode": 33188,
      "old_path": "internal/core/read.go",
      "new_id": "338a7aabef3639998fdd5c66bd73c67db9f15ecb",
      "new_mode": 33188,
      "new_path": "internal/core/read.go"
    }
  ]
}
