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 <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/9038
Tested-by: jenkins
This commit is contained in:
Antonio Borneo
2025-06-28 01:21:00 +02:00
parent d34ff22429
commit 15fb738850

View File

@@ -1282,76 +1282,77 @@ static int linux_thread_packet(struct connection *connection, char const *packet
target->rtos->rtos_specific_params; target->rtos->rtos_specific_params;
switch (packet[0]) { switch (packet[0]) {
case 'T': /* Is thread alive?*/ case 'T': /* Is thread alive?*/
linux_gdb_t_packet(connection, target, packet, packet_size);
break;
linux_gdb_t_packet(connection, target, packet, packet_size); case 'H': /* Set current thread */
break; /* ( 'c' for step and continue, 'g' for all other operations )*/
case 'H': /* Set current thread */ /*LOG_INFO(" H packet received '%s'", packet);*/
/* ( 'c' for step and continue, 'g' for all other operations )*/ linux_gdb_h_packet(connection, target, packet, packet_size);
/*LOG_INFO(" H packet received '%s'", packet);*/ break;
linux_gdb_h_packet(connection, target, packet, packet_size);
break;
case 'q':
if (!strncmp(packet, "qSymbol", 7)) { case 'q':
if (rtos_qsymbol(connection, packet, packet_size) == 1) { if (!strncmp(packet, "qSymbol", 7)) {
linux_compute_virt2phys(target, if (rtos_qsymbol(connection, packet, packet_size) == 1) {
target->rtos->symbols[INIT_TASK].address); linux_compute_virt2phys(target,
} target->rtos->symbols[INIT_TASK].address);
} else if (!strncmp(packet, "qfThreadInfo", 12)) { }
if (!linux_os->thread_list) { } else if (!strncmp(packet, "qfThreadInfo", 12)) {
retval = linux_gdb_thread_packet(target, if (!linux_os->thread_list) {
connection, retval = linux_gdb_thread_packet(target,
packet, connection,
packet_size); packet,
} 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,
packet_size); packet_size);
} else { } else {
retval = GDB_THREAD_PACKET_NOT_CONSUMED; retval = linux_gdb_thread_update(target,
connection,
packet,
packet_size);
} }
break; } else if (!strncmp(packet, "qsThreadInfo", 12)) {
gdb_put_packet(connection, "l", 1);
case 'Q': } else if (!strncmp(packet, "qThreadExtraInfo,", 17)) {
/* previously response was : thread not found linux_thread_extra_info(target, connection, packet,
* gdb_put_packet(connection, "E01", 3); */ packet_size);
} else {
retval = GDB_THREAD_PACKET_NOT_CONSUMED; retval = GDB_THREAD_PACKET_NOT_CONSUMED;
break; }
case 'c': break;
case 's':
if (linux_os->threads_lookup == 1) { case 'Q':
/* previously response was : thread not found
* gdb_put_packet(connection, "E01", 3); */
retval = GDB_THREAD_PACKET_NOT_CONSUMED;
break;
case 'c':
case 's':
if (linux_os->threads_lookup == 1) {
ct = linux_os->current_threads;
while ((ct) && (ct->core_id) != target->coreid)
ct = ct->next;
if ((ct) && (ct->threadid == -1)) {
ct = linux_os->current_threads; ct = linux_os->current_threads;
while ((ct) && (ct->core_id) != target->coreid) while ((ct) && (ct->threadid == -1))
ct = ct->next; ct = ct->next;
if ((ct) && (ct->threadid == -1)) {
ct = linux_os->current_threads;
while ((ct) && (ct->threadid == -1))
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);
LOG_INFO("threads_needs_update = 1");
linux_os->threads_needs_update = 1;
} }
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; return retval;