)]}'
{
  "commit": "6b4f72a01e60c854654a46f4faa555e258fa98b0",
  "tree": "30558df1eb809cd2ea390ab66837ee1bd606b0d4",
  "parents": [
    "8dd54de0a83dcf57fdaef68902c73e35e0ea274d"
  ],
  "author": {
    "name": "Tom de Vries",
    "email": "tdevries@suse.de",
    "time": "Mon May 26 15:15:31 2025 +0200"
  },
  "committer": {
    "name": "Tom de Vries",
    "email": "tdevries@suse.de",
    "time": "Mon May 26 15:15:31 2025 +0200"
  },
  "message": "[gdb/breakpoints] Stabilize info breakpoints output\n\nWith test-case gdb.multi/pending-bp-del-inferior.exp, occasionally I run into:\n...\n(gdb) info breakpoints^M\nNum     Type           Disp Enb Address    What^M\n3       dprintf        keep y   \u003cMULTIPLE\u003e ^M\n        printf \"in foo\"^M\n3.1                         y   0x004004dc in foo at $c:21 inf 2^M\n3.2                         y   0x004004dc in foo at $c:21 inf 1^M\n(gdb) FAIL: $exp: bp_pending\u003dfalse: info breakpoints before inferior removal\n...\n\nThe FAIL happens because the test-case expects:\n- breakpoint location 3.1 to be in inferior 1, and\n- breakpoint location 3.2 to be in inferior 2\nbut it\u0027s the other way around.\n\nI managed to reproduce this with a trigger patch in\ncompare_symbols from gdb/linespec.c:\n...\n   uia \u003d (uintptr_t) a.symbol-\u003esymtab ()-\u003ecompunit ()-\u003eobjfile ()-\u003epspace ();\n   uib \u003d (uintptr_t) b.symbol-\u003esymtab ()-\u003ecompunit ()-\u003eobjfile ()-\u003epspace ();\n\n-  if (uia \u003c uib)\n+  if (uia \u003e uib)\n     return true;\n-  if (uia \u003e uib)\n+  if (uia \u003c uib)\n     return false;\n...\n\nThe order enforced by compare_symbols shows up in the \"info breakpoints\"\noutput because breakpoint::add_location doesn\u0027t enforce an ordering for equal\naddresses:\n...\n  auto ub \u003d std::upper_bound (m_locations.begin (), m_locations.end (),\n\t\t\t      loc,\n\t\t\t      [] (const bp_location \u0026left,\n\t\t\t\t  const bp_location \u0026right)\n\t\t\t\t{ return left.address \u003c right.address; });\n   m_locations.insert (ub, loc);\n...\n\nFix this by using new function bp_location_is_less_than\n(forwarding to bp_location_ptr_is_less_than) in breakpoint::add_location.\n\nTested on x86_64-linux.\n\nReviewed-By: Guinevere Larsen \u003cguinevere@redhat.com\u003e\nApproved-By: Andrew Burgess \u003caburgess@redhat.com\u003e\n\nPR gdb/32202\nBug: https://sourceware.org/bugzilla/show_bug.cgi?id\u003d32202\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "bbafa096309c472fa1dd686f4a643ced87c80ded",
      "old_mode": 33188,
      "old_path": "gdb/breakpoint.c",
      "new_id": "abae16fe23f5d37563df78e0913561e1d904fb5c",
      "new_mode": 33188,
      "new_path": "gdb/breakpoint.c"
    }
  ]
}
