From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bruce Edge Subject: Re: [PATCH]: gdbsx: update README and remove space in q packet Date: Thu, 15 Jul 2010 10:34:50 -0700 Message-ID: References: <20100714193626.57259db1@mantra.us.oracle.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1664934432==" Return-path: In-Reply-To: <20100714193626.57259db1@mantra.us.oracle.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Mukesh Rathor Cc: Jeremy Fitzhardinge , "Xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org --===============1664934432== Content-Type: multipart/alternative; boundary=0015174c0ed603ebc4048b70854f --0015174c0ed603ebc4048b70854f Content-Type: text/plain; charset=ISO-8859-1 On Wed, Jul 14, 2010 at 7:36 PM, Mukesh Rathor wrote: > Newer version of gdb, version 7*, seems to have bug where it is not > parsing thread list from gdbsx properly. Getting rid of the space in > thread list works around it. It's ok with older gdb also. > > Signed-off-by: Mukesh Rathor > > diff -r d867eb643fe4 tools/debugger/gdbsx/README > --- a/tools/debugger/gdbsx/README Tue Jul 13 18:17:28 2010 +0100 > +++ b/tools/debugger/gdbsx/README Wed Jul 14 19:05:37 2010 -0700 > @@ -26,7 +26,7 @@ > bash> gdb ./vmlinux (exact matching vmlinux of guest > kernel) > (gdb) target remote dom0:9999 > > - - Additionally, to debug loadable kernel modules, please do following: > Does this 32 bit clarification imply there's no mechanism to debug modules on a 64 bit domU ? Or or there another mechanism to obtain the same info for 64 bit clients? Thanks -Bruce > + - Additionally, to debug 32bit loadable kernel modules, please do > following: > (gdb) p init_mm.pgd[3] > $1 = {pgd = 0x1b874f027} > (gdb) monitor pgd3 0x1b874f027 (Make sure value is in HEX) > diff -r d867eb643fe4 tools/debugger/gdbsx/gx/gx_main.c > --- a/tools/debugger/gdbsx/gx/gx_main.c Tue Jul 13 18:17:28 2010 +0100 > +++ b/tools/debugger/gdbsx/gx/gx_main.c Wed Jul 14 19:05:37 2010 -0700 > @@ -132,12 +132,12 @@ > static void > process_q_request(char *remote_buf) > { > - /* send a list of tids: "m 0,1,2,3l" */ > + /* send a list of tids: "m0,1,2,3l" */ > if (strcmp("qfThreadInfo", remote_buf) == 0) { > vcpuid_t vid = 0; > char *p = remote_buf; > > - sprintf(p, "m %x", vid); /* puts null char at the end */ > + sprintf(p, "m%x", vid); /* puts null char at the end */ > p = p + strlen(p); > for (vid=1; vid <= max_vcpuid; vid++) { > sprintf(p, ",%x", vid); > @@ -146,8 +146,9 @@ > sprintf(p, "l"); /* puts null char at the end */ > return; > } > + > /* qSymbol works for init_mm, and not init_mm.pgd, hence we can't use > - * it at this time. instead use "monitor" in gdb */ > + * it at this time. instead use "monitor" in gdb */ > if (strncmp("qRcmd,", remote_buf, 6) == 0) { > _do_qRcmd_req(remote_buf); > return; > @@ -155,8 +156,7 @@ > > /* TBD : qThreadExtraInfo : send extra banner info */ > > - /* nothing else supported right now */ > - remote_buf[0] = '\0'; > + remote_buf[0] = '\0'; /* nothing else supported for now > */ > > return; > } > --0015174c0ed603ebc4048b70854f Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
On Wed, Jul 14, 2010 at 7:36 PM, Mukesh Rathor <= span dir=3D"ltr"><mukesh.rat= hor@oracle.com> wrote:
Newer version of gdb, version 7*, seems to have bug where it is not
parsing thread list from gdbsx properly. Getting rid of the space in
thread list works around it. It's ok with older gdb also.

Signed-off-by: Mukesh Rathor <mukesh.rathor@oracle.com>

diff -r d867eb643fe4 tools/debugger/gdbsx/README
--- a/tools/debugger/gdbsx/README =A0 =A0 =A0 Tue Jul 13 18:17:28 2010 +010= 0
+++ b/tools/debugger/gdbsx/README =A0 =A0 =A0 Wed Jul 14 19:05:37 2010 -070= 0
@@ -26,7 +26,7 @@
=A0 =A0 =A0 bash> gdb ./vmlinux =A0 =A0 =A0 =A0 =A0 =A0 (exact matching= vmlinux of guest kernel)
=A0 =A0 =A0 (gdb) target remote dom0:9999

- =A0 - Additionally, to debug loadable kernel modules, please do following= :

Does this 32 bit clarification imply = there's no mechanism to debug modules on a 64 bit domU ?
Or o= r there another mechanism to obtain the same info for 64 bit clients?

Thanks

-Bruce
=A0
+ =A0 - Additionally, to debug 32bit loadable kernel modules, please do fol= lowing:
=A0 =A0 =A0 (gdb) p init_mm.pgd[3]
=A0 =A0 =A0 $1 =3D {pgd =3D 0x1b874f027}
=A0 =A0 =A0 (gdb) monitor pgd3 0x1b874f027 =A0(Make sure value is in HEX)<= br> diff -r d867eb643fe4 tools/debugger/gdbsx/gx/gx_main.c
--- a/tools/debugger/gdbsx/gx/gx_main.c Tue Jul 13 18:17:28 2010 +0100
+++ b/tools/debugger/gdbsx/gx/gx_main.c Wed Jul 14 19:05:37 2010 -0700
@@ -132,12 +132,12 @@
=A0static void
=A0process_q_request(char *remote_buf)
=A0{
- =A0 =A0/* send a list of tids: "m 0,1,2,3l" */
+ =A0 =A0/* send a list of tids: "m0,1,2,3l" */
=A0 =A0 if (strcmp("qfThreadInfo", remote_buf) =3D=3D 0) {
=A0 =A0 =A0 =A0 vcpuid_t vid =3D 0;
=A0 =A0 =A0 =A0 char *p =3D remote_buf;

- =A0 =A0 =A0 =A0sprintf(p, "m %x", vid); =A0 =A0 =A0 =A0/* puts = null char at the end */
+ =A0 =A0 =A0 =A0sprintf(p, "m%x", vid); =A0 =A0 =A0 =A0/* puts n= ull char at the end */
=A0 =A0 =A0 =A0 p =3D p + strlen(p);
=A0 =A0 =A0 =A0 for (vid=3D1; vid <=3D max_vcpuid; vid++) {
=A0 =A0 =A0 =A0 =A0 =A0 sprintf(p, ",%x", vid);
@@ -146,8 +146,9 @@
=A0 =A0 =A0 =A0 sprintf(p, "l"); =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= /* puts null char at the end */
=A0 =A0 =A0 =A0 return;
=A0 =A0 }
+
=A0 =A0 /* qSymbol works for init_mm, and not init_mm.pgd, hence we can= 9;t use
- =A0 =A0 =A0 =A0 * it at this time. instead use "monitor" in gdb= */
+ =A0 =A0 * it at this time. instead use "monitor" in gdb */
=A0 =A0 if (strncmp("qRcmd,", remote_buf, 6) =3D=3D 0) {
=A0 =A0 =A0 =A0 _do_qRcmd_req(remote_buf);
=A0 =A0 =A0 =A0 return;
@@ -155,8 +156,7 @@

=A0 =A0 /* TBD : qThreadExtraInfo : send extra banner info =A0*/

- =A0 =A0 =A0 =A0/* nothing else supported right now */
- =A0 =A0remote_buf[0] =3D '\0';
+ =A0 =A0remote_buf[0] =3D '\0'; =A0 =A0 =A0 =A0 =A0 =A0 =A0/* noth= ing else supported for now */

=A0 =A0 return;
=A0}

--0015174c0ed603ebc4048b70854f-- --===============1664934432== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --===============1664934432==--