Skip to content

Commit f8fc35d

Browse files
lrgirdwogalak
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 <[email protected]>
1 parent e13b56e commit f8fc35d

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Index: gdb/gdb/arch/xtensa.h
2+
===================================================================
3+
--- gdb.orig/gdb/arch/xtensa.h
4+
+++ gdb/gdb/arch/xtensa.h
5+
@@ -20,6 +20,8 @@
6+
#ifndef ARCH_XTENSA_H
7+
#define ARCH_XTENSA_H
8+
9+
+#include <stdint.h>
10+
+
11+
/* Xtensa ELF core file register set representation ('.reg' section).
12+
Copied from target-side ELF header <xtensa/elf.h>. */
13+
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
Index: gdb-8.3.1/gdb/remote.c
2+
===================================================================
3+
--- gdb-8.3.1.orig/gdb/remote.c
4+
+++ gdb-8.3.1/gdb/remote.c
5+
@@ -8035,11 +8035,17 @@ remote_target::process_g_packet (struct
6+
buf_len = strlen (rs->buf.data ());
7+
8+
/* Further sanity checks, with knowledge of the architecture. */
9+
- if (buf_len > 2 * rsa->sizeof_g_packet)
10+
- error (_("Remote 'g' packet reply is too long (expected %ld bytes, got %d "
11+
- "bytes): %s"),
12+
- rsa->sizeof_g_packet, buf_len / 2,
13+
- rs->buf.data ());
14+
+ if(buf_len > 2 * rsa->sizeof_g_packet) {
15+
+ rsa->sizeof_g_packet = buf_len;
16+
+ for(i = 0; i < gdbarch_num_regs(gdbarch); i++){
17+
+ if(rsa->regs[i].pnum == -1)
18+
+ continue;
19+
+ if(rsa->regs[i].offset >= rsa->sizeof_g_packet)
20+
+ rsa->regs[i].in_g_packet = 0;
21+
+ else
22+
+ rsa->regs[i].in_g_packet = 1;
23+
+ }
24+
+ }
25+
26+
/* Save the size of the packet sent to us by the target. It is used
27+
as a heuristic when determining the max size of packets that the

0 commit comments

Comments
 (0)