/proc DCMD_PROC_GETGREG -- EINVAL?

Why does DCMD_PROC_GETGREG return EINVAL out of the devctl()?
Is this function not supported yet?

Here’s a code snippet, the file descriptor passed is #6, and is
used with other DCMD’s just fine:

static void
dump_procfs_greg (int fd)
{
procfs_greg g;
int sts;
int k;

// fetch information about the registers for this pid/tid
if ((sts = devctl (fd, DCMD_PROC_GETGREG, &g, sizeof (g), &k)) != EOK) {
fprintf (stderr, “%s: couldn’t get GETGREG information, sts %d, errno %d (%s)\n”, progname, sts, errno, strerror (errno));
exit (EXIT_FAILURE);
}

printf ("\tInfo from DCMD_PROC_GETGREG\n");
printf ("\t\tcs 0x%08X eip 0x%08X\n", g.x86.cs, g.x86.eip);
printf ("\t\tss 0x%08X esp 0x%08X\n", g.x86.ss, g.x86.esp);
printf ("\t\teax 0x%08X ebx 0x%08X\n", g.x86.eax, g.x86.ebx);
printf ("\t\tecx 0x%08X edx 0x%08X\n", g.x86.ecx, g.x86.edx);
printf ("\t\tedi 0x%08X esi 0x%08X\n", g.x86.edi, g.x86.esi);
printf ("\t\tebp 0x%08X exx 0x%08X\n", g.x86.ebp, g.x86.exx);
printf ("\t\tefl 0x%08X\n", g.x86.efl);

}

Anything obviously stupid here? :slight_smile:

Cheers,
-RK


[If replying via email, you’ll need to click on the URL that’s emailed to you
afterwards to forward the email to me – spam filters and all that]
Robert Krten, PDP minicomputer collector http://www.parse.com/~pdp8/

Rob,

There is qnx’ized gdb source code on cvs.qnx.com (tools/gdb, I think).

Cheers,
-Dmitri

Robert Krten wrote:

Why does DCMD_PROC_GETGREG return EINVAL out of the devctl()?
Is this function not supported yet?

Here’s a code snippet, the file descriptor passed is #6, and is
used with other DCMD’s just fine:

static void
dump_procfs_greg (int fd)
{
procfs_greg g;
int sts;
int k;

// fetch information about the registers for this pid/tid
if ((sts = devctl (fd, DCMD_PROC_GETGREG, &g, sizeof (g), &k)) != EOK) {
fprintf (stderr, “%s: couldn’t get GETGREG information, sts %d, errno %d (%s)\n”, progname, sts, errno, strerror (errno));
exit (EXIT_FAILURE);
}

printf ("\tInfo from DCMD_PROC_GETGREG\n");
printf ("\t\tcs 0x%08X eip 0x%08X\n", g.x86.cs, g.x86.eip);
printf ("\t\tss 0x%08X esp 0x%08X\n", g.x86.ss, g.x86.esp);
printf ("\t\teax 0x%08X ebx 0x%08X\n", g.x86.eax, g.x86.ebx);
printf ("\t\tecx 0x%08X edx 0x%08X\n", g.x86.ecx, g.x86.edx);
printf ("\t\tedi 0x%08X esi 0x%08X\n", g.x86.edi, g.x86.esi);
printf ("\t\tebp 0x%08X exx 0x%08X\n", g.x86.ebp, g.x86.exx);
printf ("\t\tefl 0x%08X\n", g.x86.efl);

}

Anything obviously stupid here? > :slight_smile:

Cheers,
-RK

did you set CURTHREAD?

Robert Krten <rk@parse.com> wrote:

Why does DCMD_PROC_GETGREG return EINVAL out of the devctl()?
Is this function not supported yet?

Here’s a code snippet, the file descriptor passed is #6, and is
used with other DCMD’s just fine:

static void
dump_procfs_greg (int fd)
{
procfs_greg g;
int sts;
int k;

// fetch information about the registers for this pid/tid
if ((sts = devctl (fd, DCMD_PROC_GETGREG, &g, sizeof (g), &k)) != EOK) {
fprintf (stderr, “%s: couldn’t get GETGREG information, sts %d, errno %d (%s)\n”, progname, sts, errno, strerror (errno));
exit (EXIT_FAILURE);
}

printf ("\tInfo from DCMD_PROC_GETGREG\n");
printf ("\t\tcs 0x%08X eip 0x%08X\n", g.x86.cs, g.x86.eip);
printf ("\t\tss 0x%08X esp 0x%08X\n", g.x86.ss, g.x86.esp);
printf ("\t\teax 0x%08X ebx 0x%08X\n", g.x86.eax, g.x86.ebx);
printf ("\t\tecx 0x%08X edx 0x%08X\n", g.x86.ecx, g.x86.edx);
printf ("\t\tedi 0x%08X esi 0x%08X\n", g.x86.edi, g.x86.esi);
printf ("\t\tebp 0x%08X exx 0x%08X\n", g.x86.ebp, g.x86.exx);
printf ("\t\tefl 0x%08X\n", g.x86.efl);

}

Anything obviously stupid here? > :slight_smile:

Cheers,
-RK


[If replying via email, you’ll need to click on the URL that’s emailed to you
afterwards to forward the email to me – spam filters and all that]
Robert Krten, PDP minicomputer collector > http://www.parse.com/~pdp8/


cburgess@qnx.com

Dmitri Poustovalov <pdmitri@bigfoot.com> wrote:

Rob,

There is qnx’ized gdb source code on cvs.qnx.com (tools/gdb, I think).

That sounds like a major pain! :slight_smile: I’ll keep that as a last resort… thanks
for the tip, though!

Cheers,
-RK

Cheers,
-Dmitri

Robert Krten wrote:
Why does DCMD_PROC_GETGREG return EINVAL out of the devctl()?
Is this function not supported yet?

Here’s a code snippet, the file descriptor passed is #6, and is
used with other DCMD’s just fine:

static void
dump_procfs_greg (int fd)
{
procfs_greg g;
int sts;
int k;

// fetch information about the registers for this pid/tid
if ((sts = devctl (fd, DCMD_PROC_GETGREG, &g, sizeof (g), &k)) != EOK) {
fprintf (stderr, “%s: couldn’t get GETGREG information, sts %d, errno %d (%s)\n”, progname, sts, errno, strerror (errno));
exit (EXIT_FAILURE);
}

printf ("\tInfo from DCMD_PROC_GETGREG\n");
printf ("\t\tcs 0x%08X eip 0x%08X\n", g.x86.cs, g.x86.eip);
printf ("\t\tss 0x%08X esp 0x%08X\n", g.x86.ss, g.x86.esp);
printf ("\t\teax 0x%08X ebx 0x%08X\n", g.x86.eax, g.x86.ebx);
printf ("\t\tecx 0x%08X edx 0x%08X\n", g.x86.ecx, g.x86.edx);
printf ("\t\tedi 0x%08X esi 0x%08X\n", g.x86.edi, g.x86.esi);
printf ("\t\tebp 0x%08X exx 0x%08X\n", g.x86.ebp, g.x86.exx);
printf ("\t\tefl 0x%08X\n", g.x86.efl);

}

Anything obviously stupid here? > :slight_smile:

Cheers,
-RK


[If replying via email, you’ll need to click on the URL that’s emailed to you
afterwards to forward the email to me – spam filters and all that]
Robert Krten, PDP minicomputer collector http://www.parse.com/~pdp8/

Colin Burgess <cburgess@qnx.com> wrote:

did you set CURTHREAD?

Nope; I used TIDSTATUS, assuming that it sets the thread…
I’ll give that whirl, thanks!

Cheers,
-RK

Robert Krten <> rk@parse.com> > wrote:
Why does DCMD_PROC_GETGREG return EINVAL out of the devctl()?
Is this function not supported yet?

Here’s a code snippet, the file descriptor passed is #6, and is
used with other DCMD’s just fine:

static void
dump_procfs_greg (int fd)
{
procfs_greg g;
int sts;
int k;

// fetch information about the registers for this pid/tid
if ((sts = devctl (fd, DCMD_PROC_GETGREG, &g, sizeof (g), &k)) != EOK) {
fprintf (stderr, “%s: couldn’t get GETGREG information, sts %d, errno %d (%s)\n”, progname, sts, errno, strerror (errno));
exit (EXIT_FAILURE);
}

printf ("\tInfo from DCMD_PROC_GETGREG\n");
printf ("\t\tcs 0x%08X eip 0x%08X\n", g.x86.cs, g.x86.eip);
printf ("\t\tss 0x%08X esp 0x%08X\n", g.x86.ss, g.x86.esp);
printf ("\t\teax 0x%08X ebx 0x%08X\n", g.x86.eax, g.x86.ebx);
printf ("\t\tecx 0x%08X edx 0x%08X\n", g.x86.ecx, g.x86.edx);
printf ("\t\tedi 0x%08X esi 0x%08X\n", g.x86.edi, g.x86.esi);
printf ("\t\tebp 0x%08X exx 0x%08X\n", g.x86.ebp, g.x86.exx);
printf ("\t\tefl 0x%08X\n", g.x86.efl);

}

Anything obviously stupid here? > :slight_smile:

Cheers,
-RK


[If replying via email, you’ll need to click on the URL that’s emailed to you
afterwards to forward the email to me – spam filters and all that]
Robert Krten, PDP minicomputer collector > http://www.parse.com/~pdp8/


cburgess@qnx.com


[If replying via email, you’ll need to click on the URL that’s emailed to you
afterwards to forward the email to me – spam filters and all that]
Robert Krten, PDP minicomputer collector http://www.parse.com/~pdp8/

Colin Burgess <cburgess@qnx.com> wrote:

did you set CURTHREAD?

Did now, and it works like a charm. Thanks Colin!

Cheers,
-RK

Robert Krten <> rk@parse.com> > wrote:
Why does DCMD_PROC_GETGREG return EINVAL out of the devctl()?
Is this function not supported yet?

Here’s a code snippet, the file descriptor passed is #6, and is
used with other DCMD’s just fine:

static void
dump_procfs_greg (int fd)
{
procfs_greg g;
int sts;
int k;

// fetch information about the registers for this pid/tid
if ((sts = devctl (fd, DCMD_PROC_GETGREG, &g, sizeof (g), &k)) != EOK) {
fprintf (stderr, “%s: couldn’t get GETGREG information, sts %d, errno %d (%s)\n”, progname, sts, errno, strerror (errno));
exit (EXIT_FAILURE);
}

printf ("\tInfo from DCMD_PROC_GETGREG\n");
printf ("\t\tcs 0x%08X eip 0x%08X\n", g.x86.cs, g.x86.eip);
printf ("\t\tss 0x%08X esp 0x%08X\n", g.x86.ss, g.x86.esp);
printf ("\t\teax 0x%08X ebx 0x%08X\n", g.x86.eax, g.x86.ebx);
printf ("\t\tecx 0x%08X edx 0x%08X\n", g.x86.ecx, g.x86.edx);
printf ("\t\tedi 0x%08X esi 0x%08X\n", g.x86.edi, g.x86.esi);
printf ("\t\tebp 0x%08X exx 0x%08X\n", g.x86.ebp, g.x86.exx);
printf ("\t\tefl 0x%08X\n", g.x86.efl);

}

Anything obviously stupid here? > :slight_smile:

Cheers,
-RK


[If replying via email, you’ll need to click on the URL that’s emailed to you
afterwards to forward the email to me – spam filters and all that]
Robert Krten, PDP minicomputer collector > http://www.parse.com/~pdp8/


cburgess@qnx.com


[If replying via email, you’ll need to click on the URL that’s emailed to you
afterwards to forward the email to me – spam filters and all that]
Robert Krten, PDP minicomputer collector http://www.parse.com/~pdp8/