This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Question about gdb on CYGWIN
- To: gdb at sourceware dot cygnus dot com
- Subject: Question about gdb on CYGWIN
- From: "E. Bradford" <bed at nc dot rr dot com>
- Date: Fri, 13 Oct 2000 16:06:57 -0400
I am a slow learner. I posted to everything but the directions in the
digest I receive.
I am running the very latest GDB as found on the very latest CYGWIN. I
can't seem to disassemble
GetTickCount(), a Microsoft routine. I want to single step at the
assembly
language level into and out of the 4 instruction GetTickCount() routine.
My program is quite simple and
included below. Its intent is to demonstrate
the granularity of GetTickCount(). I wanted to disassemble it to see how
it works. I had no trouble with
the Microsoft C++ debugger, but I can't seem to get gdb to disassemble
or
single step at the assemply language level a routine that gcc didn't
compile.
It seems to me it should disassemble and proceed even without symbols.
What am I doing wrong?
gcc granular.cpp -o granular-gcc
gdb granular-gcc.exe
> break main
> run
> step and continue trying to step into GetTickCount().
Do you have any suggestions?
Thank you.
Ed Bradford
#include <windows.h>
#include <stdio.h>
//
// Simple program to demonstrate the granularity of GetTickCount().
//
int main(int ac, char *av[])
{
unsigned u1, u2;
unsigned u2prev;
unsigned counter = 0;
int i;
for(i = 0; i < 16; i++) {
counter = 0;
u1 = GetTickCount();
do {
u2 = GetTickCount();
counter++;
} while(u2 == u1);
printf("%2d: GetTickCount: u1=%u u2=%u counter=%u\n",
i+1,u1,u2,counter);
}
printf("\n");
return 0;
}