)]}'
{
  "commit": "b7a5722ebdd24a0d15d56e96d30a649ea1d7b0ee",
  "tree": "17846ef2a41131008510993c370b92172320e768",
  "parents": [
    "e89496f42ac7b2d6fbba15f98f3caf496de050f4"
  ],
  "author": {
    "name": "Andrew Burgess",
    "email": "aburgess@redhat.com",
    "time": "Fri Dec 22 11:29:13 2023 +0000"
  },
  "committer": {
    "name": "Andrew Burgess",
    "email": "aburgess@redhat.com",
    "time": "Thu Jan 04 09:24:18 2024 +0000"
  },
  "message": "gdb: improve error reporting from expression parser\n\nThis commits changes how errors are reported from the expression\nparser.  Previously, parser errors were reported like this:\n\n  (gdb) p a1 +}\u003d 432\n  A syntax error in expression, near `}\u003d 432\u0027.\n  (gdb) p a1 +\n  A syntax error in expression, near `\u0027.\n\nThe first case is fine, a user can figure out what\u0027s going wrong, but\nthe second case is a little confusing; as the error occurred at the\nend of the expression GDB just reports the empty string to the user.\n\nAfter this commit the first case is unchanged, but the second case now\nreports like this:\n\n  (gdb) p a1 +\n  A syntax error in expression, near the end of `a1 +\u0027.\n\nWhich I think is clearer.  There is a possible issue if the expression\nbeing parsed is very long, GDB will repeat the whole expression.  But\nthis issue already exists in the standard case; if the error occurs\nearly in a long expression GDB will repeat everything after the syntax\nerror.  So I\u0027ve not worried about this case in my new code either,\nwhich keeps things simpler.\n\nI did consider trying to have multi-line errors here, in the style\nthat gcc produces, with some kind of \u0027~~~~~^\u0027 marker on the second\nline to indicate where the error occurred; but I rejected this due to\nthe places in GDB where we catch an error and repackage the message\nwithin some longer string, I don\u0027t think multi-line error messages\nwould work well in that case.  At a minimum it would require some\nsignificant work in order to make all our error handling multi-line\naware.\n\nI\u0027ve added a couple of extra tests in gdb.base/exprs.exp.\n\nApproved-By: John Baldwin \u003cjhb@FreeBSD.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "efac0dee1af5a4c9d715c4a3ba9fbc36ae7a9764",
      "old_mode": 33188,
      "old_path": "gdb/parse.c",
      "new_id": "e8bb112177fc9d0eb46f7525719585905398520e",
      "new_mode": 33188,
      "new_path": "gdb/parse.c"
    },
    {
      "type": "modify",
      "old_id": "24522bbbb15fcdbd73a8c0b047c2d71a88dd40d5",
      "old_mode": 33188,
      "old_path": "gdb/parser-defs.h",
      "new_id": "44728980a5b897980ced3035f28791b04f032c05",
      "new_mode": 33188,
      "new_path": "gdb/parser-defs.h"
    },
    {
      "type": "modify",
      "old_id": "79ae905fccfe6d520b2d2f76c66bd5ec8044f27f",
      "old_mode": 33188,
      "old_path": "gdb/testsuite/gdb.base/exprs.exp",
      "new_id": "8c85b579b9d6a1c19ddd2446a80b866df03101d0",
      "new_mode": 33188,
      "new_path": "gdb/testsuite/gdb.base/exprs.exp"
    }
  ]
}
