From: <ge...@op...> - 2025-07-25 18:29:15
|
This is an automated email from Gerrit. "Antonio Borneo <bor...@gm...>" just uploaded a new patch set to Gerrit, which you can find at https://review.openocd.org/c/openocd/+/9038 -- gerrit commit 37ff68cc3ea859ff0b65e64de4caa6423251be33 Author: Antonio Borneo <bor...@gm...> Date: Sat Jun 28 01:21:00 2025 +0200 rtos: linux: align switch and case statements The coding style requires the 'case' to be at the same indentation level of its 'switch' statement. Align the code accordingly. No changes are reported by git log -p -w --ignore-blank-lines --patience Change-Id: Ic4070571d322776b638a15a40af85cd31fdae7ce Signed-off-by: Antonio Borneo <bor...@gm...> diff --git a/src/rtos/linux.c b/src/rtos/linux.c index 785be13fd8..5f59dc883a 100644 --- a/src/rtos/linux.c +++ b/src/rtos/linux.c @@ -1282,76 +1282,77 @@ static int linux_thread_packet(struct connection *connection, char const *packet target->rtos->rtos_specific_params; switch (packet[0]) { - case 'T': /* Is thread alive?*/ - - linux_gdb_t_packet(connection, target, packet, packet_size); - break; - case 'H': /* Set current thread */ - /* ( 'c' for step and continue, 'g' for all other operations )*/ - /*LOG_INFO(" H packet received '%s'", packet);*/ - linux_gdb_h_packet(connection, target, packet, packet_size); - break; - case 'q': - - if (!strncmp(packet, "qSymbol", 7)) { - if (rtos_qsymbol(connection, packet, packet_size) == 1) { - linux_compute_virt2phys(target, - target->rtos->symbols[INIT_TASK].address); - } - } else if (!strncmp(packet, "qfThreadInfo", 12)) { - if (!linux_os->thread_list) { - retval = linux_gdb_thread_packet(target, - connection, - packet, - packet_size); - } else { - retval = linux_gdb_thread_update(target, - connection, - packet, - packet_size); - } - } else if (!strncmp(packet, "qsThreadInfo", 12)) { - gdb_put_packet(connection, "l", 1); - } else if (!strncmp(packet, "qThreadExtraInfo,", 17)) { - linux_thread_extra_info(target, connection, packet, + case 'T': /* Is thread alive?*/ + linux_gdb_t_packet(connection, target, packet, packet_size); + break; + + case 'H': /* Set current thread */ + /* ( 'c' for step and continue, 'g' for all other operations )*/ + /*LOG_INFO(" H packet received '%s'", packet);*/ + linux_gdb_h_packet(connection, target, packet, packet_size); + break; + + case 'q': + if (!strncmp(packet, "qSymbol", 7)) { + if (rtos_qsymbol(connection, packet, packet_size) == 1) { + linux_compute_virt2phys(target, + target->rtos->symbols[INIT_TASK].address); + } + } else if (!strncmp(packet, "qfThreadInfo", 12)) { + if (!linux_os->thread_list) { + retval = linux_gdb_thread_packet(target, + connection, + packet, packet_size); } else { - retval = GDB_THREAD_PACKET_NOT_CONSUMED; + retval = linux_gdb_thread_update(target, + connection, + packet, + packet_size); } - break; - - case 'Q': - /* previously response was : thread not found - * gdb_put_packet(connection, "E01", 3); */ + } else if (!strncmp(packet, "qsThreadInfo", 12)) { + gdb_put_packet(connection, "l", 1); + } else if (!strncmp(packet, "qThreadExtraInfo,", 17)) { + linux_thread_extra_info(target, connection, packet, + packet_size); + } else { retval = GDB_THREAD_PACKET_NOT_CONSUMED; - break; - case 'c': - case 's': - if (linux_os->threads_lookup == 1) { - ct = linux_os->current_threads; + } + break; - while ((ct) && (ct->core_id) != target->coreid) - ct = ct->next; + case 'Q': + /* previously response was : thread not found + * gdb_put_packet(connection, "E01", 3); */ + retval = GDB_THREAD_PACKET_NOT_CONSUMED; + break; - if ((ct) && (ct->threadid == -1)) { - ct = linux_os->current_threads; + case 'c': + case 's': + if (linux_os->threads_lookup == 1) { + ct = linux_os->current_threads; - while ((ct) && (ct->threadid == -1)) - ct = ct->next; - } + while ((ct) && (ct->core_id) != target->coreid) + ct = ct->next; - if ((ct) && (ct->threadid != - target->rtos->current_threadid) - && (target->rtos->current_threadid != -1)) - LOG_WARNING("WARNING! current GDB thread do not match " - "current thread running. " - "Switch thread in GDB to threadid %d", - (int)ct->threadid); + if ((ct) && (ct->threadid == -1)) { + ct = linux_os->current_threads; - LOG_INFO("threads_needs_update = 1"); - linux_os->threads_needs_update = 1; + while ((ct) && (ct->threadid == -1)) + ct = ct->next; } - break; + + if ((ct) && (ct->threadid != + target->rtos->current_threadid) + && (target->rtos->current_threadid != -1)) + LOG_WARNING("WARNING! current GDB thread do not match " + "current thread running. " + "Switch thread in GDB to threadid %d", + (int)ct->threadid); + + LOG_INFO("threads_needs_update = 1"); + linux_os->threads_needs_update = 1; + } + break; } return retval; -- |