Skip to content

Commit c1e3f09

Browse files
lrgirdwostephanosio
authored andcommitted
gdb: Add fixes for stdint and remote debug on xtensa.
Take both stdint and remote debug fixes from SOF. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
1 parent f7e68e1 commit c1e3f09

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

gdb/arch/xtensa.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
#ifndef GDB_ARCH_XTENSA_H
2121
#define GDB_ARCH_XTENSA_H
2222

23+
#include <stdint.h>
24+
2325
/* Xtensa ELF core file register set representation ('.reg' section).
2426
Copied from target-side ELF header <xtensa/elf.h>. */
2527

gdb/remote.c

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8970,11 +8970,17 @@ remote_target::process_g_packet (struct regcache *regcache)
89708970
buf_len = strlen (rs->buf.data ());
89718971

89728972
/* Further sanity checks, with knowledge of the architecture. */
8973-
if (buf_len > 2 * rsa->sizeof_g_packet)
8974-
error (_("Remote 'g' packet reply is too long (expected %ld bytes, got %d "
8975-
"bytes): %s"),
8976-
rsa->sizeof_g_packet, buf_len / 2,
8977-
rs->buf.data ());
8973+
if(buf_len > 2 * rsa->sizeof_g_packet) {
8974+
rsa->sizeof_g_packet = buf_len;
8975+
for(i = 0; i < gdbarch_num_regs(gdbarch); i++){
8976+
if(rsa->regs[i].pnum == -1)
8977+
continue;
8978+
if(rsa->regs[i].offset >= rsa->sizeof_g_packet)
8979+
rsa->regs[i].in_g_packet = 0;
8980+
else
8981+
rsa->regs[i].in_g_packet = 1;
8982+
}
8983+
}
89788984

89798985
/* Save the size of the packet sent to us by the target. It is used
89808986
as a heuristic when determining the max size of packets that the

0 commit comments

Comments
 (0)