)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"7f00873eded83042ef0ec160bdcfd7b1eb924c9b","unresolved":true,"context_lines":[{"line_number":4,"context_line":"Commit:     Ian Thompson \u003cianst@cadence.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2022-08-01 15:58:20 -0700"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"target/server: custom target-specific GDB queries"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Provide a customizable hook for handling target-specific GDB queries"},{"line_number":10,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"a8d156bf_7bce0752","line":7,"updated":"2022-08-03 16:47:27.000000000","message":"please use:\ngdb_server: ...","commit_id":"264f4e3101c88c1bead8922a26713b5a75773702"},{"author":{"_account_id":1001982,"name":"Ian Thompson","email":"ianst@cadence.com","username":"ianstcdns"},"change_message_id":"0929e59c1c9c9209468f60e8944fa2b33454bfb9","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Ian Thompson \u003cianst@cadence.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2022-08-01 15:58:20 -0700"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"target/server: custom target-specific GDB queries"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Provide a customizable hook for handling target-specific GDB queries"},{"line_number":10,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"59196edc_41da7bfd","line":7,"in_reply_to":"a8d156bf_7bce0752","updated":"2022-08-03 17:51:23.000000000","message":"Done","commit_id":"264f4e3101c88c1bead8922a26713b5a75773702"}],"/PATCHSET_LEVEL":[{"author":{"_account_id":1001982,"name":"Ian Thompson","email":"ianst@cadence.com","username":"ianstcdns"},"change_message_id":"f5ec06baa5f2c5d86bcf3ea536337be971c4f651","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"7d26cc54_690a7337","updated":"2022-07-11 19:34:45.000000000","message":"GDB support for Xtensa processors has been upstreamed for many years now.  The changes in this patch are required for OpenOCD to function with Xtensa-specific features, e.g. non-contiguous registers (as specified by \"targno\" in gdb/gdb/xtensa-config.c).","commit_id":"bca1ffb3a374fc5cf8b47b423ac4f72f0955866e"},{"author":{"_account_id":1001982,"name":"Ian Thompson","email":"ianst@cadence.com","username":"ianstcdns"},"change_message_id":"de20749d05582861c8e505772c4bc46452671682","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"7c3b0376_9e2240f0","updated":"2022-07-11 00:39:50.000000000","message":"Required for review 7055.  Thanks in advance for your comments/suggestions.","commit_id":"bca1ffb3a374fc5cf8b47b423ac4f72f0955866e"},{"author":{"_account_id":1001982,"name":"Ian Thompson","email":"ianst@cadence.com","username":"ianstcdns"},"change_message_id":"a2aada5cfb9200b0463e2d57ada8b152d284403f","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"5d8f387b_0923fec9","updated":"2022-08-01 23:22:17.000000000","message":"Thanks for your feedback, Antonio.  Comments addressed and updated patchset coming shortly.","commit_id":"bca1ffb3a374fc5cf8b47b423ac4f72f0955866e"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"262daab20e28b634a4ea0f4dbc78b00401d54817","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"527ddd0d_b06d9c82","updated":"2022-07-25 14:20:35.000000000","message":"This should be in 3 separate patches to help following the git log.\nI know that each patch would be really small, but better having a simple and specific commit message for each of them","commit_id":"bca1ffb3a374fc5cf8b47b423ac4f72f0955866e"},{"author":{"_account_id":1001982,"name":"Ian Thompson","email":"ianst@cadence.com","username":"ianstcdns"},"change_message_id":"a2aada5cfb9200b0463e2d57ada8b152d284403f","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"6b6e12b3_aacc0dd2","in_reply_to":"527ddd0d_b06d9c82","updated":"2022-08-01 23:22:17.000000000","message":"Split this patch out into 3.  Please see https://review.openocd.org/c/openocd/+/7102 and https://review.openocd.org/c/openocd/+/7103 for additional changes.","commit_id":"bca1ffb3a374fc5cf8b47b423ac4f72f0955866e"},{"author":{"_account_id":1001982,"name":"Ian Thompson","email":"ianst@cadence.com","username":"ianstcdns"},"change_message_id":"0929e59c1c9c9209468f60e8944fa2b33454bfb9","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"5ef9fc8e_aac08710","updated":"2022-08-03 17:51:23.000000000","message":"Sorry for neglecting to commit the comment changes.  They were still sitting in my client, unstaged!  Thanks for catching this, Antonio.","commit_id":"264f4e3101c88c1bead8922a26713b5a75773702"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"5cfa95066de211edb0ed73cbd757436d7f28bb66","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"cf7d78bf_a7c36dba","updated":"2022-08-03 17:59:58.000000000","message":"thanks!","commit_id":"42429b06e67bdb7597909d063ecdb0926b7eef03"}],"src/server/gdb_server.c":[{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"262daab20e28b634a4ea0f4dbc78b00401d54817","unresolved":true,"context_lines":[{"line_number":1784,"context_line":"\t\t\tif (packet[0] \u003d\u003d \u0027Z\u0027) {"},{"line_number":1785,"context_line":"\t\t\t\tretval \u003d breakpoint_add(target, address, size, bp_type);"},{"line_number":1786,"context_line":"\t\t\t\tif (retval \u003d\u003d ERROR_TARGET_INVALID) {"},{"line_number":1787,"context_line":"\t\t\t\t\t/* SW breakpoints not supported */"},{"line_number":1788,"context_line":"\t\t\t\t\tgdb_put_packet(connection, \"\", 0);"},{"line_number":1789,"context_line":"\t\t\t\t} else if (retval !\u003d ERROR_OK) {"},{"line_number":1790,"context_line":"\t\t\t\t\tretval \u003d gdb_error(connection, retval);"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"e66900e2_3f13e531","line":1787,"updated":"2022-07-25 14:20:35.000000000","message":"be more explicit, this reply is specified in the GDB remote protocol. Plus it\u0027s for both HW and SW breakpoints.\n/* Send empty reply to report that breakpoints of this type are not supported */\n\nSimilar code should be used also below for watchpoints, but I think it\u0027s not in your scope.","commit_id":"bca1ffb3a374fc5cf8b47b423ac4f72f0955866e"},{"author":{"_account_id":1001982,"name":"Ian Thompson","email":"ianst@cadence.com","username":"ianstcdns"},"change_message_id":"a2aada5cfb9200b0463e2d57ada8b152d284403f","unresolved":false,"context_lines":[{"line_number":1784,"context_line":"\t\t\tif (packet[0] \u003d\u003d \u0027Z\u0027) {"},{"line_number":1785,"context_line":"\t\t\t\tretval \u003d breakpoint_add(target, address, size, bp_type);"},{"line_number":1786,"context_line":"\t\t\t\tif (retval \u003d\u003d ERROR_TARGET_INVALID) {"},{"line_number":1787,"context_line":"\t\t\t\t\t/* SW breakpoints not supported */"},{"line_number":1788,"context_line":"\t\t\t\t\tgdb_put_packet(connection, \"\", 0);"},{"line_number":1789,"context_line":"\t\t\t\t} else if (retval !\u003d ERROR_OK) {"},{"line_number":1790,"context_line":"\t\t\t\t\tretval \u003d gdb_error(connection, retval);"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"ab3d0efd_17ed3c60","line":1787,"in_reply_to":"e66900e2_3f13e531","updated":"2022-08-01 23:22:17.000000000","message":"Thanks for the suggestion.  I\u0027ve separated this out into a new patch that will address both breakpoints and watchpoints; please review https://review.openocd.org/c/openocd/+/7102","commit_id":"bca1ffb3a374fc5cf8b47b423ac4f72f0955866e"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"7f00873eded83042ef0ec160bdcfd7b1eb924c9b","unresolved":true,"context_lines":[{"line_number":2957,"context_line":"\t\treturn ERROR_OK;"},{"line_number":2958,"context_line":"\t} else if (target-\u003etype-\u003egdb_query_custom) {"},{"line_number":2959,"context_line":"\t\tchar *buffer \u003d NULL;"},{"line_number":2960,"context_line":"\t\tint ret \u003d target-\u003etype-\u003egdb_query_custom(target, packet, \u0026buffer);"},{"line_number":2961,"context_line":"\t\tgdb_put_packet(connection, buffer, strlen(buffer));"},{"line_number":2962,"context_line":"\t\treturn ret;"},{"line_number":2963,"context_line":"\t}"}],"source_content_type":"text/x-csrc","patch_set":2,"id":"98eef643_6d765d98","line":2960,"updated":"2022-08-03 16:47:27.000000000","message":"please check my comment https://review.openocd.org/c/openocd/+/7082/comment/b28d8ef7_412f1c9d/","commit_id":"264f4e3101c88c1bead8922a26713b5a75773702"},{"author":{"_account_id":1001982,"name":"Ian Thompson","email":"ianst@cadence.com","username":"ianstcdns"},"change_message_id":"0929e59c1c9c9209468f60e8944fa2b33454bfb9","unresolved":false,"context_lines":[{"line_number":2957,"context_line":"\t\treturn ERROR_OK;"},{"line_number":2958,"context_line":"\t} else if (target-\u003etype-\u003egdb_query_custom) {"},{"line_number":2959,"context_line":"\t\tchar *buffer \u003d NULL;"},{"line_number":2960,"context_line":"\t\tint ret \u003d target-\u003etype-\u003egdb_query_custom(target, packet, \u0026buffer);"},{"line_number":2961,"context_line":"\t\tgdb_put_packet(connection, buffer, strlen(buffer));"},{"line_number":2962,"context_line":"\t\treturn ret;"},{"line_number":2963,"context_line":"\t}"}],"source_content_type":"text/x-csrc","patch_set":2,"id":"a9ee9dab_6dcf0a77","line":2960,"in_reply_to":"3dbeb1c6_19f07dd3","updated":"2022-08-03 17:51:23.000000000","message":"Done","commit_id":"264f4e3101c88c1bead8922a26713b5a75773702"},{"author":{"_account_id":1001982,"name":"Ian Thompson","email":"ianst@cadence.com","username":"ianstcdns"},"change_message_id":"0929e59c1c9c9209468f60e8944fa2b33454bfb9","unresolved":false,"context_lines":[{"line_number":2957,"context_line":"\t\treturn ERROR_OK;"},{"line_number":2958,"context_line":"\t} else if (target-\u003etype-\u003egdb_query_custom) {"},{"line_number":2959,"context_line":"\t\tchar *buffer \u003d NULL;"},{"line_number":2960,"context_line":"\t\tint ret \u003d target-\u003etype-\u003egdb_query_custom(target, packet, \u0026buffer);"},{"line_number":2961,"context_line":"\t\tgdb_put_packet(connection, buffer, strlen(buffer));"},{"line_number":2962,"context_line":"\t\treturn ret;"},{"line_number":2963,"context_line":"\t}"}],"source_content_type":"text/x-csrc","patch_set":2,"id":"c5e553fd_769cd7d0","line":2960,"in_reply_to":"3dbeb1c6_19f07dd3","updated":"2022-08-03 17:51:23.000000000","message":"Whoops!  It\u0027s still in my unstaged changes.  Sorry about that!","commit_id":"264f4e3101c88c1bead8922a26713b5a75773702"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"9a5258d32aa9cd1f79b132ab02dfaef032eafa14","unresolved":true,"context_lines":[{"line_number":2957,"context_line":"\t\treturn ERROR_OK;"},{"line_number":2958,"context_line":"\t} else if (target-\u003etype-\u003egdb_query_custom) {"},{"line_number":2959,"context_line":"\t\tchar *buffer \u003d NULL;"},{"line_number":2960,"context_line":"\t\tint ret \u003d target-\u003etype-\u003egdb_query_custom(target, packet, \u0026buffer);"},{"line_number":2961,"context_line":"\t\tgdb_put_packet(connection, buffer, strlen(buffer));"},{"line_number":2962,"context_line":"\t\treturn ret;"},{"line_number":2963,"context_line":"\t}"}],"source_content_type":"text/x-csrc","patch_set":2,"id":"3dbeb1c6_19f07dd3","line":2960,"in_reply_to":"98eef643_6d765d98","updated":"2022-08-03 16:51:41.000000000","message":"I rad your reply, but the comment get lost in this last version. Can you please check?","commit_id":"264f4e3101c88c1bead8922a26713b5a75773702"}],"src/target/target_type.h":[{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"262daab20e28b634a4ea0f4dbc78b00401d54817","unresolved":true,"context_lines":[{"line_number":298,"context_line":"\tint (*gdb_fileio_end)(struct target *target, int retcode, int fileio_errno, bool ctrl_c);"},{"line_number":299,"context_line":""},{"line_number":300,"context_line":"\t/* parse target-specific GDB query commands"},{"line_number":301,"context_line":"\t */"},{"line_number":302,"context_line":"\tint (*gdb_query_custom)(struct target *target, const char *packet, char **response_p);"},{"line_number":303,"context_line":""},{"line_number":304,"context_line":"\t/* do target profiling"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"b28d8ef7_412f1c9d","line":301,"updated":"2022-07-25 14:20:35.000000000","message":"In your code in gdb_server.c there are few assumptions on how this function MUST work.\nI\u0027m not excited about your choice; I would have allocated the buffer and let the caller to free() it, and I would have checked if the pointer is not assigned so I would not risk to use a NULL pointer.\nE.g.\n\tchar *buffer \u003d NULL;\n\tint ret \u003d target-\u003etype-\u003egdb_query_custom(target, packet, \u0026buffer);\n\tif (buffer) {\n\t\tgdb_put_packet(connection, buffer, strlen(buffer));\n\t\tfree(buffer);\n\t} else {\n\t\twhat here?\n\t}\n\treturn ret;\n\nAnyway, let\u0027s proceed as you have already done but, at least we need to document/comment here what the code is doing.\nPlease add something like this here in the comment:\nThe string pointer *response_p is always assigned by the called function to a pointer to a zero-terminated string, even when the function returns an error. The string\u0027s memory is not freed by the caller, so pay attention of possible memory leaks.","commit_id":"bca1ffb3a374fc5cf8b47b423ac4f72f0955866e"},{"author":{"_account_id":1001982,"name":"Ian Thompson","email":"ianst@cadence.com","username":"ianstcdns"},"change_message_id":"a2aada5cfb9200b0463e2d57ada8b152d284403f","unresolved":false,"context_lines":[{"line_number":298,"context_line":"\tint (*gdb_fileio_end)(struct target *target, int retcode, int fileio_errno, bool ctrl_c);"},{"line_number":299,"context_line":""},{"line_number":300,"context_line":"\t/* parse target-specific GDB query commands"},{"line_number":301,"context_line":"\t */"},{"line_number":302,"context_line":"\tint (*gdb_query_custom)(struct target *target, const char *packet, char **response_p);"},{"line_number":303,"context_line":""},{"line_number":304,"context_line":"\t/* do target profiling"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"60f6ab52_e17601af","line":301,"in_reply_to":"b28d8ef7_412f1c9d","updated":"2022-08-01 23:22:17.000000000","message":"Comments clarified as suggested.  The intention here was for the target hook to implement the string memory statically to minimize possible memory leaks.  But please advise if this is too restrictive on implementation options, and I can rework it as you suggest.  Resolving.","commit_id":"bca1ffb3a374fc5cf8b47b423ac4f72f0955866e"}]}
