)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"fd2630a5354409505986335ad3dac32e01c8b466","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"2cc1d715_470e3ad2","updated":"2022-11-15 21:53:06.000000000","message":"let\u0027s keep it on hold till 0.12","commit_id":"2bfbd864b66d54b5698b774c0a274ec0e886221e"}],"tools/disassemble_inc.sh":[{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"7fd7e672489e8e66953cea6c5b95a389901c7e4b","unresolved":true,"context_lines":[{"line_number":38,"context_line":"echo \"Disassemble $1:\""},{"line_number":39,"context_line":"echo \"${CROSS_COMPILE}objdump ${OBJDUMP_FLAGS} -b binary -D ${tmpfile}\""},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"echo -en \"$(sed -nz \u0027s,.*/,,;s/[,\\n]*0x/\\\\x/g;s/,//;p\u0027 $1)\" \u003e ${tmpfile}"},{"line_number":42,"context_line":"${CROSS_COMPILE}objdump ${OBJDUMP_FLAGS} -b binary -D ${tmpfile}"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"rm ${tmpfile}"}],"source_content_type":"text/x-sh","patch_set":1,"id":"9de4a324_9f9f828b","line":41,"updated":"2022-11-13 19:45:11.000000000","message":"This line really deserves an explaining comment!\n\nBTW it doesn\u0027t work on Ubuntu 22.04 LTS.\n $ ll /bin/sh\n lrwxrwxrwx 1 root root 4 lis  5 15:46 /bin/sh -\u003e dash*\n\nand dash does not support \\x\n\nWhat about generating temp.c\n unsigned char code[] \u003d {\n content of .inc\n }\n\nand compiling it\n gcc -c temp.c\n objcopy -j .data temp.o -O binary temp.bin\n\nMaybe a objcopy --rename-section or variable __attribute__((section(\".text\"))) could be used instead of generating temp.bin - but objdump doesn\u0027t work as expected, I don\u0027t know why.","commit_id":"b73da708c6309f53b84793b7efd75b058f0eca4c"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"bbfa6f0fbb4ccd029b7d7a3a99f2c6cf61048a88","unresolved":true,"context_lines":[{"line_number":38,"context_line":"echo \"Disassemble $1:\""},{"line_number":39,"context_line":"echo \"${CROSS_COMPILE}objdump ${OBJDUMP_FLAGS} -b binary -D ${tmpfile}\""},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"echo -en \"$(sed -nz \u0027s,.*/,,;s/[,\\n]*0x/\\\\x/g;s/,//;p\u0027 $1)\" \u003e ${tmpfile}"},{"line_number":42,"context_line":"${CROSS_COMPILE}objdump ${OBJDUMP_FLAGS} -b binary -D ${tmpfile}"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"rm ${tmpfile}"}],"source_content_type":"text/x-sh","patch_set":1,"id":"9df68695_37ecbf00","line":41,"in_reply_to":"042e96c3_63014b32","updated":"2022-11-15 17:21:50.000000000","message":"\u003e The helpers .S are ok, but there are few .c and changing compiler version he got a binary not working.\n\u003e He need to compare the .inc upstream with what he get from re-compiling.\n\u003e \n\u003e Actually I don\u0027t see any other use case for this script.\n\nThen probably any version is good enough. Perl version works good on my Ubuntu.","commit_id":"b73da708c6309f53b84793b7efd75b058f0eca4c"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"f40310fe32a2b1f520493ef6fc1567f1afd4af38","unresolved":true,"context_lines":[{"line_number":38,"context_line":"echo \"Disassemble $1:\""},{"line_number":39,"context_line":"echo \"${CROSS_COMPILE}objdump ${OBJDUMP_FLAGS} -b binary -D ${tmpfile}\""},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"echo -en \"$(sed -nz \u0027s,.*/,,;s/[,\\n]*0x/\\\\x/g;s/,//;p\u0027 $1)\" \u003e ${tmpfile}"},{"line_number":42,"context_line":"${CROSS_COMPILE}objdump ${OBJDUMP_FLAGS} -b binary -D ${tmpfile}"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"rm ${tmpfile}"}],"source_content_type":"text/x-sh","patch_set":1,"id":"042e96c3_63014b32","line":41,"in_reply_to":"6a0f9735_7433dc3d","updated":"2022-11-14 08:28:28.000000000","message":"\u003e But /bin/echo could be linked to busybox ...\n\nAgree, can be problematic\n\n\u003e BTW Why do we need the script?\n\nI\u0027m supporting a user that is rebuilding the .inc\nThe helpers .S are ok, but there are few .c and changing compiler version he got a binary not working.\nHe need to compare the .inc upstream with what he get from re-compiling.\n\nActually I don\u0027t see any other use case for this script.","commit_id":"b73da708c6309f53b84793b7efd75b058f0eca4c"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"0c51c6fd1d685ae863221d0b283b2dc0b8eea9d9","unresolved":true,"context_lines":[{"line_number":38,"context_line":"echo \"Disassemble $1:\""},{"line_number":39,"context_line":"echo \"${CROSS_COMPILE}objdump ${OBJDUMP_FLAGS} -b binary -D ${tmpfile}\""},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"echo -en \"$(sed -nz \u0027s,.*/,,;s/[,\\n]*0x/\\\\x/g;s/,//;p\u0027 $1)\" \u003e ${tmpfile}"},{"line_number":42,"context_line":"${CROSS_COMPILE}objdump ${OBJDUMP_FLAGS} -b binary -D ${tmpfile}"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"rm ${tmpfile}"}],"source_content_type":"text/x-sh","patch_set":1,"id":"6a0f9735_7433dc3d","line":41,"in_reply_to":"6a73bab8_f731652f","updated":"2022-11-14 07:51:03.000000000","message":"\u003e dash implements its own \"echo\" that doesn\u0027t support flag \"-e\".\n\u003e It\u0027s enough to change, in this line only, \"echo\" with \"/bin/echo\" to get it working.\n\nI know.\nBut /bin/echo could be linked to busybox or whatever on a small system.\nThat\u0027s why I proposed using gcc. It doesn\u0027t add another dependency compared to OpenOCD build, the way is same as .inc is processed in the real build\nand the command doesn\u0027t look as a dirty hack. The only inconvenience is that we need more temporary files.\n\n\u003e  perl -e \u0027while (\u003c\u003e){while ($_\u003d~/(0x..)/g){print chr(hex($1));}}\u0027 $1 \u003e ${tmpfile}\n\n\u003e For developers we already require perl for running checkpatch; it should not be an issue.\n\nHmm, probably ok. Didn\u0027t test.\n\nBTW Why do we need the script? I hope that we have source for all .inc, don\u0027t we?\nAnd if somebody works on a loader, he can objdump .elf instead of .inc to see symbols. I personally prefer using gdb for the loader code debugging...","commit_id":"b73da708c6309f53b84793b7efd75b058f0eca4c"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"8340760dc798d9cd1debe3cdccd15bf211209f20","unresolved":true,"context_lines":[{"line_number":38,"context_line":"echo \"Disassemble $1:\""},{"line_number":39,"context_line":"echo \"${CROSS_COMPILE}objdump ${OBJDUMP_FLAGS} -b binary -D ${tmpfile}\""},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"echo -en \"$(sed -nz \u0027s,.*/,,;s/[,\\n]*0x/\\\\x/g;s/,//;p\u0027 $1)\" \u003e ${tmpfile}"},{"line_number":42,"context_line":"${CROSS_COMPILE}objdump ${OBJDUMP_FLAGS} -b binary -D ${tmpfile}"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"rm ${tmpfile}"}],"source_content_type":"text/x-sh","patch_set":1,"id":"6a73bab8_f731652f","line":41,"in_reply_to":"9de4a324_9f9f828b","updated":"2022-11-13 23:20:39.000000000","message":"Thanks for testing it!\ndash implements its own \"echo\" that doesn\u0027t support flag \"-e\".\nIt\u0027s enough to change, in this line only, \"echo\" with \"/bin/echo\" to get it working.\n\nRegarding the readability, yes, \u0027sed\u0027 is not so friendly ... alternatives:\n\u0027awk\u0027 is another mess, as configure.ac searches for gawk, mawk, nawk, awk, all with different language implementation. And handling hex values is not portable.\n\u0027perl\u0027 looks easier. I end up with this as full replacement of this line, dropping also the \"echo\":\n\n perl -e \u0027while (\u003c\u003e){while ($_\u003d~/(0x..)/g){print chr(hex($1));}}\u0027 $1 \u003e ${tmpfile}\n\nthat can even be rewritten multi-line commented as:\n perl -e \u0027\n     # loop on every line\n     while (\u003c\u003e) {\n         # loop on every match \"0x..\"\n         while ($_ \u003d~ /(0x..)/g) {\n             print chr(hex($1));\n         }\n     }\n \u0027 $1 \u003e ${tmpfile}\n\nWould it work for you?\nFor developers we already require perl for running checkpatch; it should not be an issue.","commit_id":"b73da708c6309f53b84793b7efd75b058f0eca4c"}]}
