Browse Source

Fix compilation

Change-Id: I1efd74bb14b1e6577dae9cd9cee70907913f70bd
jim-nuttx
Jim Paris 4 years ago
parent
commit
e6740b73eb
1 changed files with 5 additions and 7 deletions
  1. +5
    -7
      src/rtos/nuttx.c

+ 5
- 7
src/rtos/nuttx.c View File

@@ -161,7 +161,7 @@ static int nuttx_thread_packet(struct connection *connection,
char cmd[GDB_BUFFER_SIZE / 2] = "";

if (!strncmp(packet, "qRcmd", 5)) {
int len = unhexify(cmd, packet + 6, sizeof(cmd));
int len = unhexify((uint8_t *)cmd, packet + 6, sizeof(cmd));
int offset;

if (len <= 0)
@@ -235,8 +235,6 @@ static int nuttx_update_threads(struct rtos *rtos)
/* free old thread info */
if (rtos->thread_details) {
for (i = 0; i < rtos->thread_count; i++) {
if (rtos->thread_details[i].display_str)
free(rtos->thread_details[i].display_str);
if (rtos->thread_details[i].thread_name_str)
free(rtos->thread_details[i].thread_name_str);
}
@@ -288,10 +286,10 @@ static int nuttx_update_threads(struct rtos *rtos)
thread = &rtos->thread_details[thread_count - 1];
thread->threadid = tcb_addr;
thread->exists = true;
thread->display_str = malloc(256);
snprintf(thread->display_str, 256, "pid:%d",
tcb.dat[pid_offset - 8] |
tcb.dat[pid_offset - 8 + 1] << 8);
// thread->display_str = malloc(256);
// snprintf(thread->display_str, 256, "pid:%d",
// tcb.dat[pid_offset - 8] |
// tcb.dat[pid_offset - 8 + 1] << 8);

if (name_offset) {
thread->thread_name_str = malloc(name_size + 1);


Loading…
Cancel
Save