{"push_id":950549292,"size":4,"distinct_size":4,"ref":"refs/heads/master","head":"4d18591be953e2faeaaa280484d375fe05857770","before":"ffd9c127e6206b819a886227197ceddb4d6b00de","commits":[{"sha":"18879fef1741464e522624bcc529048400453e0d","author":{"email":"82697eede7783c80d18ae8c0d02575d32c9ac359@linaro.org","name":"Yao Qi"},"message":"[GDBserver] Check input interrupt after reading in a packet\n\nGDBserver may read some packet together with '\\003' in one go.  We've\nalready checked '\\003' first when reading packet by my patch,\n\n  Check input interrupt first when reading packet\n  https://sourceware.org/ml/gdb-patches/2016-01/msg00057.html\n\nbut if we don't check '\\003' *after* each packet, the interrupt will\nbe processed next time GDBserver reads from the buffer, so that the\ninterrupt isn't processed in time.  For example, GDB sends vCont;c and\ninterrupt (see gdb.base/interrupt-noterm.exp), we'll resume the\ninferior and wait once packet vCont;c is seen.  If we don't check the\ninterrupt character after vCont;c packet, interrupt character will stay\nin the buffer unattended until GDBserver returns from the wait, which\nmay take a while.  Note that since we've read '\\003' from file\ndescriptor, SIGIO signal handler input_interrupt doesn't help either.\n\nThis issue can be exposed by hacking the end of getpkt like\n@@ -1041,6 +1050,9 @@ getpkt (char *buf)\n        }\n     }\n\n+  if (readchar_bufcnt > 0)\n+    gdb_assert (*readchar_bufp != '\\003');\n+\n   return bp - buf;\n }\n\nand this can trigger internal error,\n(gdb) PASS: gdb.base/interrupt-noterm.exp: interrupt\nRemote connection closed^M\n(gdb) FAIL: gdb.base/interrupt-noterm.exp: inferior received SIGINT\nRemote debugging from host 10.2.206.40^M\n/home/yao/SourceCode/gnu/gdb/git/gdb/gdbserver/remote-utils.c:1054: A problem internal to GDBserver has been detected.^M\ngetpkt: Assertion `*readchar_bufp != '\\003'' failed.^M\n\nThis patch is to peek the buffer, if it is '\\003', consume it and call\n*the_target->request_interrupt.\n\ngdb/gdbserver:\n\n2016-01-26  Yao Qi  <yao.qi@linaro.org>\n\n\t* remote-utils.c (getpkt): If the buffer isn't empty, and the\n\tfirst character is '\\003', call *the_target->request_interrupt.","distinct":true,"url":"https://api.github.com/repos/kraj/binutils-gdb/commits/18879fef1741464e522624bcc529048400453e0d"},{"sha":"8b2073398477b33d425b0570236fe4e4222fe2c4","author":{"email":"82697eede7783c80d18ae8c0d02575d32c9ac359@linaro.org","name":"Yao Qi"},"message":"[GDBserver] Block and unblock SIGIO\n\nNowadays, GDBserver disables async io (by ignoring SIGIO) when process\na serial event, and enables async io (by installing signal handler) when\nresume the inferior and wait.  GDBserver may miss SIGIO (by interrupt)\nand doesn't process SIGIO in time, which is shown by\ngdb.base/interrupt-noterm.exp.  In the test, GDB sends \"continue &\" and\nthen \"interrupt\".  if '\\003' arrives at a period between GDBserver\nreceives vCont;c and enables async io, SIGIO is ignored because signal\nhandler isn't installed.  GDBserver waits for the inferior and can not\nnotice '\\003' until it returns from wait.\n\nThis patch changes the code to install SIGIO handler early, but block\nand unblock SIGIO as needed.  In this way, we don't remove SIGIO\nhandler, so SIGIO can't be ignored.  However, GDBserver needs to\nremove the signal handler when connection is closed.\n\ngdb/gdbserver:\n\n2016-01-26  Yao Qi  <yao.qi@linaro.org>\n\n\t* remote-utils.c (remote_close) [!USE_WIN32API]: Ignore SIGIO.\n\t(unblock_async_io): Rename to ...\n\t(block_unblock_async_io): ... it.  New function.\n\t(enable_async_io): Don't install SIGIO handler.  Unblock it\n\tinstead.\n\t(disable_async_io): Don't ignore SIGIO.  Block it instead.\n\t(initialize_async_io): Install SIGIO handler.  Don't call\n\tunblock_async_io.","distinct":true,"url":"https://api.github.com/repos/kraj/binutils-gdb/commits/8b2073398477b33d425b0570236fe4e4222fe2c4"},{"sha":"d80209703ec2fc85e0a4b3d4d23e7ed448987aca","author":{"email":"82697eede7783c80d18ae8c0d02575d32c9ac359@linaro.org","name":"Yao Qi"},"message":"[GDBserver] Use regcache_read_pc in install_software_single_step_breakpoints\n\nIn install_software_single_step_breakpoints, we've got the regcache\nof current_thread, so we don't have to bother get_pc to get pc,\ninstead we can get pc from regcache directly.  Note that the callers\nof install_software_single_step_breakpoints have already switched\ncurrent_thread to LWP.\n\nSince the pc is got from regcache_read_pc, in the next patch, we can\nget pc inside the implementation of *the_low_target.get_next_pcs and\nstop passing pc to *the_low_target.get_next_pcs.\n\ngdb/gdbserver:\n\n2016-01-26  Yao Qi  <yao.qi@linaro.org>\n\n\t* linux-low.c (install_software_single_step_breakpoints): Call\n\tregcache_read_pc instead of get_pc.","distinct":true,"url":"https://api.github.com/repos/kraj/binutils-gdb/commits/d80209703ec2fc85e0a4b3d4d23e7ed448987aca"},{"sha":"4d18591be953e2faeaaa280484d375fe05857770","author":{"email":"82697eede7783c80d18ae8c0d02575d32c9ac359@linaro.org","name":"Yao Qi"},"message":"Remove argument pc in get_next_pcs\n\nNowadays, get_next_pcs in linux_target_ops has two parameters PC\nand REGCACHE.  Parameter PC looks redundant because it can be go\nfrom REGCACHE.  The patch is to remove PC from the arguments for\nvarious functions.\n\ngdb:\n\n2016-01-26  Yao Qi  <yao.qi@linaro.org>\n\n\t* arch/arm-get-next-pcs.c (thumb_deal_with_atomic_sequence_raw):\n\tRemove argument pc.  Get pc by regcache_read_pc.  Callers updated.\n\t(arm_deal_with_atomic_sequence_raw): Likewise.\n\t(thumb_get_next_pcs_raw): Likewise.\n\t(arm_get_next_pcs_raw): Likewise.\n\t(arm_get_next_pcs): Remove argument pc.  Callers updated.\n\t* arch/arm-get-next-pcs.h (arm_get_next_pcs): Update declaration.\n\ngdb/gdbserver:\n\n2016-01-26  Yao Qi  <yao.qi@linaro.org>\n\n\t* linux-arm-low.c (arm_gdbserver_get_next_pcs): Remove argument pc.\n\t* linux-low.c (install_software_single_step_breakpoints): Don't\n\tcall regcache_read_pc.\n\t* linux-low.h (struct linux_target_ops) <get_next_pcs>: Remove\n\targument pc.","distinct":true,"url":"https://api.github.com/repos/kraj/binutils-gdb/commits/4d18591be953e2faeaaa280484d375fe05857770"}]}