GDB debugger problem

C

console kid

Hi,
I got a problem when I debugging set of statements like this.
Code:
TextOut(hDc,24*cxChar,cyChar*(rect.bottom/cyChar-1),
				szBuffer,
				wsprintf(szBuffer,szFormat,message==WM_DRAWITEM?
TEXT("WM_DRAWITEM"):TEXT("WM_COMMAND"),
HIWORD(wParam),LOWORD(wParam),LOWORD(lParam),LOWORD(lParam)));

The problem is how could I inspect the values that return from the
wsprintf ,which is passed
to the function TextOut as 4th argument.

I mean it executes the whole line as a one.I don't want this, how
could I break this
without storing it into a integer variable i and pass the i into the
TextOut,like this.
Code:
			i=wsprintf(szBuffer,szFormat,message==WM_DRAWITEM?
TEXT("WM_DRAWITEM"):TEXT("WM_COMMAND"),
HIWORD(wParam),LOWORD(wParam),LOWORD(lParam),LOWORD(lParam));
			TextOut(hDc,24*cxChar,cyChar*(rect.bottom/cyChar-1),
				szBuffer,
				i);
how can I do this without breaking that previous above line into two
like above?

--Thanks in Advance--
 
J

Jorgen Grahn

Hi,
I got a problem when I debugging set of statements like this.
Code:
TextOut(hDc,24*cxChar,cyChar*(rect.bottom/cyChar-1),
				szBuffer,
				wsprintf(szBuffer,szFormat,message==WM_DRAWITEM?
TEXT("WM_DRAWITEM"):TEXT("WM_COMMAND"),
HIWORD(wParam),LOWORD(wParam),LOWORD(lParam),LOWORD(lParam)));

The problem is how could I inspect the values that return from the
wsprintf ,which is passed
to the function TextOut as 4th argument.

I mean it executes the whole line as a one.I don't want this, how
could I break this
without storing it into a integer variable i and pass the i into the
TextOut,like this.
Code:
			i=wsprintf(szBuffer,szFormat,message==WM_DRAWITEM?
TEXT("WM_DRAWITEM"):TEXT("WM_COMMAND"),
HIWORD(wParam),LOWORD(wParam),LOWORD(lParam),LOWORD(lParam));
			TextOut(hDc,24*cxChar,cyChar*(rect.bottom/cyChar-1),
				szBuffer,
				i);
how can I do this without breaking that previous above line into two
like above?

Perhaps you can't. But there are other reasons for you to simplify
that code -- I find it almost unreadable, with the broken indentation
no other whitespace at all, and Hungarian names.

/Jorgen

PS. People will also remind you that gdb is offtopic here.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top