-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathremote.patch
55 lines (52 loc) · 1.94 KB
/
remote.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
--- remote-o.c 2010-03-07 11:39:54 -0300
+++ remote.c 2010-04-29 01:13:44 -0300
@@ -536,7 +536,6 @@
/* Record the maximum possible size of the g packet - it may turn out
to be smaller. */
rsa->sizeof_g_packet = offset;
-
/* Default maximum number of characters in a packet body. Many
remote stubs have a hardwired buffer size of 400 bytes
(c.f. BUFMAX in m68k-stub.c and i386-stub.c). BUFMAX-1 is used
@@ -565,7 +564,7 @@
rs->buf_size = 2 * rsa->remote_packet_size;
rs->buf = xrealloc (rs->buf, rs->buf_size);
}
-
+ printf("g packet:%d , buflen: %d",rsa->sizeof_g_packet, rs->buf_size);
return rsa;
}
@@ -5393,8 +5392,25 @@
buf_len = strlen (rs->buf);
/* Further sanity checks, with knowledge of the architecture. */
- if (buf_len > 2 * rsa->sizeof_g_packet)
- error (_("Remote 'g' packet reply is too long: %s"), rs->buf);
+ //if (buf_len > 2 * rsa->sizeof_g_packet)
+ // error (_("Remote 'g' packet reply is too long: %s"), rs->buf);
+ // Parche implementado para solucionar el problem de reply too long
+ // by Matias Vara
+ if (buf_len > 2 * rsa->sizeof_g_packet) {
+
+ rsa->sizeof_g_packet = buf_len ;
+
+ for (i = 0; i < gdbarch_num_regs (gdbarch); i++)
+ {
+ if (rsa->regs[i].pnum == -1)
+ continue;
+
+ if (rsa->regs[i].offset >= rsa->sizeof_g_packet)
+ rsa->regs[i].in_g_packet = 0;
+ else
+ rsa->regs[i].in_g_packet = 1;
+ }
+ }
/* Save the size of the packet sent to us by the target. It is used
as a heuristic when determining the max size of packets that the
@@ -5406,6 +5422,7 @@
update our records. A 'g' reply that doesn't include a register's
value implies either that the register is not available, or that
the 'p' packet must be used. */
+ // Tenemos un serio problema aqui al entrar en real mode me cambia el tamaño de los registros
if (buf_len < 2 * rsa->sizeof_g_packet)
{
rsa->sizeof_g_packet = buf_len / 2;