|
The source code window refuses to open if you don't have proper symbols set or don't have the correct version of binaries and the source. So this would more likely be the case at your end...
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Thanks AnShUmAn,
Here is my source code and related Windbg output after further experiment. My questions/comments,
1. I find if I execute command .effmach x86 at the beginning, also with correct symbol path and source path, source code window is showing when break point is hit in source code;
2. My further question is when should we execute command .effmach x86? As the 1st command to debug x86 binary under x64 machine/debugger as best practices or?
3. From my output, there is only one break point, but I do not know why it breaks twice, any ideas?
More details, I donot know why breaks here,
--------------------
(10e4.1f8): WOW64 breakpoint - code 4000001f (first chance)
First chance exceptions are reported before any exception handling.
This exception may be expected and handled.
ntdll32!DbgBreakPoint:
00000000`7d61002d cc int 3
0:000:x86> k
ChildEBP RetAddr
002dfb48 7d649b01 ntdll32!DbgBreakPoint
002dfcac 7d637010 ntdll32!LdrpInitializeProcess+0x111c
002dfd0c 7d61e99d ntdll32!_LdrpInitialize+0xd0
00000000 00000000 ntdll32!KiUserApcDispatcher+0x25
--------------------
Here is the whole output.
--------------------
ntdll!DbgBreakPoint:
00000000`77ef2aa0 cc int 3
0:000> .effmach x86
Effective machine: x86 compatible (x86)
0:000:x86> bp main
0:000:x86> bl
0 e x86 00000000`00411430 0001 (0001) 0:**** TestDebug1!main
0:000:x86> g
ModLoad: 00000000`77d40000 00000000`77eb3000 NOT_AN_IMAGE
ModLoad: 00000000`7d4c0000 00000000`7d5f0000 NOT_AN_IMAGE
ModLoad: 00000000`7d600000 00000000`7d6f0000 C:\WINDOWS\SysWOW64\ntdll32.dll
ModLoad: 00000000`77d40000 00000000`77eb3000 NOT_AN_IMAGE
ModLoad: 00000000`77c20000 00000000`77d2c000 NOT_AN_IMAGE
ModLoad: 00000000`7d4c0000 00000000`7d5f0000 C:\WINDOWS\syswow64\kernel32.dll
ModLoad: 00000000`10200000 00000000`10323000 C:\WINDOWS\WinSxS\x86_Microsoft.VC90.DebugCRT_1fc8b3b9a1e18e3b_9.0.30729.1_x-ww_F863C71F\MSVCR90D.dll
(10e4.1f8): WOW64 breakpoint - code 4000001f (first chance)
First chance exceptions are reported before any exception handling.
This exception may be expected and handled.
ntdll32!DbgBreakPoint:
00000000`7d61002d cc int 3
0:000:x86> k
ChildEBP RetAddr
002dfb48 7d649b01 ntdll32!DbgBreakPoint
002dfcac 7d637010 ntdll32!LdrpInitializeProcess+0x111c
002dfd0c 7d61e99d ntdll32!_LdrpInitialize+0xd0
00000000 00000000 ntdll32!KiUserApcDispatcher+0x25
0:000:x86> g
Breakpoint 0 hit
TestDebug1!main:
00000000`00411430 55 push ebp
0:000:x86> k
ChildEBP RetAddr
002dff68 00411a38 TestDebug1!main [d:\visual studio 2008\projects\testdebug1\testdebug1\main.cpp @ 20]
002dffb8 0041187f TestDebug1!__tmainCRTStartup+0x1a8
002dffc0 7d4e7d2a TestDebug1!mainCRTStartup+0xf
002dfff0 00000000 kernel32!BaseProcessStart+0x28
#include <iostream>
using namespace std;
int foo()
{
int b = 300;
return b;
}
int goo()
{
int a = 400;
return a;
}
int main()
{
int a = 200;
int* b = &a;
foo();
a = 400;
goo();
return 0;
}
--------------------
regards,
George
|
|
|
|
|
George_George wrote: window is showing when break point is hit in source code;
2. My further question is when should we execute command .effmach x86? As the 1st command to debug x86 binary under x64 machine/debugger as best practices or?
.effmach x86 -Use x86, amd64, ia64, or ebc processor mode
This setting influences many debugger features:
-> which processor's unwinder is used for stack tracing
-> which processor's register set is active
So, if you have multiple processors you can use this command early when you start debugging.
George_George wrote: 3. From my output, there is only one break point, but I do not know why it breaks twice, any ideas?
I will try to reproduce this once I get some time off.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Thanks AnShUmAn,
_AnShUmAn_ wrote: I will try to reproduce this once I get some time off.
Looking forward to your reply. I do not know why for the same breakpoint setting for x64 binary, we only break once, and for x86 binary, we break twice.
regards,
George
|
|
|
|
|
Dear All
in a project I need to load a DLL more than once. (15 times at least)
This DLL is used to compress raw voice into mp3 format.
Is it possible to do this.
If there is any points which I should consider please let me know.
Regards
Monhi
|
|
|
|
|
Gut Mikh Tappe wrote: in a project I need to load a DLL more than once. (15 times at least)
Why?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
The DLL which I want to use is a mp3 compressor which only compresser the sound of a channel.
But I need to do the same job for 15 channels at least.
Thus it was neccessary to load it more than 15 times.
|
|
|
|
|
Well, if I need to use the same function in different threads, I don't load the corrensponding DLL many times...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi All
I am useing SHFileOperation for copy folder.It's working nice for folder.Can i use SHFileOperation for file also.I mean when i copy folder like this.
C:\\Test(Source Folder)
C:\\Test2(Deswtination folder)
This is working fine.
But when i copy file like this then it's not working.
C:\\log.txt(Source)
C:\\ (Destination)
Plz help me
|
|
|
|
|
MsmVc wrote: C:\\log.txt(Source)C:\\ (Destination)
And whats should it do (i.e. what is the expected 'working' behaviour)?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
void CTestgarbageDlg::OnButton1()
{
SHFILEOPSTRUCT shop;
shop.hwnd = this->GetSafeHwnd();
shop.wFunc = FO_COPY;
shop.pFrom = _T("c:\\AUTOEXEC.BAT\0");
shop.pTo = _T("d:\0");
shop.fFlags = FOF_FILESONLY;
int iRet = -1;
iRet = SHFileOperation(&shop);
if (iRet == 0)
{
AfxMessageBox(_T("sucess"));
}
else
{
AfxMessageBox(_T("fail"));
}
}
I've tried the code above, it works fine. Hope it helps you.
|
|
|
|
|
fantasy1215 wrote: shop.pFrom = _T("c:\\AUTOEXEC.BAT\0");
shop.pTo = _T("d:\0");
Why do you double terminate the strings?
Nevermind, it was my ignorance.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
modified on Monday, October 6, 2008 4:38 AM
|
|
|
|
|
Documentation says to end it with two null chars.
Rajesh has verified it it works with single null termination also.
Regards,
Sandip.
|
|
|
|
|
SandipG wrote: Rajesh has verified it it works with single null termination also.
Actually, I just said that it worked in *that particular* case, as it might work with certain cases, which cannot be predicted.
But that isn't the best thing to do. Because if there is a buffer overrun, then that could be disastrous. And - Those strings must be double null-terminated.
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
You're definitely a nit-picker!
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Yes, I agree..
Regards,
Sandip.
|
|
|
|
|
SandipG wrote: Documentation says to end it with two null chars.
Thank you.
SandipG wrote: Rajesh has verified it it works with single null termination also.
I know he likes the pragmatic approach.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi,
I am working in MFC and i am having a chat dilaog box in which there is an edit box. I want to send send what the user is doing on the edit box used for sending message. For this I am using the notificatio ON_EN_CHANGE();
I have declared it as follows in My Class COperChatDlg:
afx_msg void OnChangeEdit();
ON_EN_CHANGE(IDC_EDIT_OP, OnChangeEdit)
and defined it as
void COperChatDlg::OnChangeEdit()
{
static bool bSend = false;
CString strText;
GetDlgItemText(IDC_EDIT_OP,strText);
int nTextLen = strText.GetLength();
if(!bSend)
{
bSend = true;
SendOperatorTypingStatus();
}
else if(nTextLen != 0 && nTextLen % 5 == 0)
{
bSend = false;
}
}
But its giving the error in the while loop of below code during run time as soon as i start typing anything in the editbox IDC_EDIT_OP.
#endif /* _SAFECRT_IMPL */
++p;
++p;
}
/* textlen now contains length in multibyte chars */
} else {
if (text.wz == NULL) /* NULL passed, use special string */
text.wz = __wnullstring;
bufferiswide = 1;
pwch = text.wz;
while (i-- && *pwch)
++pwch;
textlen = (int)(pwch - text.wz); /* in wchar_ts */
/* textlen now contains length in wide chars */
}
#else /* _UNICODE */
please help me.
Thanks In Advance.
|
|
|
|
|
what is the error that u r getting?
|
|
|
|
|
Chandrasekharanp wrote: what is the error that u r getting?
plz dn uz sms lang. PLZ.
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
Did you try debugging to see what happens ? And please, for the hundredth time, use the "code block" tag to submit code
|
|
|
|
|
Hi I am new to the MFC applications in vc++.
In my application I want to access the contents of second dialog box from the first,I created the object for the second dialog box and tried to access the values of the controls without saying domodal() but it is giving an error.
How can i handle this problem????????
Thanks in advance....
|
|
|
|
|
And the error is.........
BTW it's a good practice to have get/set methods implemented in your class to do this.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
i dont think its possible to get the values of the second dialog if the second dialog is not created. DoModal has to be called. otherwise u need to use a modaless dialog box.
|
|
|
|
|
We have one application written in MFC (dialog based). This application performs some admin activities such as loading Driver (.SYS file). This application helps in loading such drivers if user does not have admin credentials i.e. user is a normal user with limited credentials.
But the problem now is, if I am adding some more functionalities into it (e.g. one more function added to it) and compiled it, compilation become successfull but it is crashing at run-time. Following is the code that is written into it. I am not able to understand what it does because this is code is written by someone else. Please help me to understand this and also does this code creates problem during runtime.
Thanks
SNI
jhghjghj
modified on Tuesday, October 14, 2008 12:13 AM
|
|
|
|