From: Bidski <bi...@bi...> - 2010-11-27 08:07:21
|
I believe I might have seen something similar, but I only recall seeing it at the end of a function. Execution reaches the end of the function, then it jumps back up to the top to where the local declarations are, then back to the end, then back to the start of the function, then once again to the end of the function then it moves on to the next line of code that is supposed to be executed. I never really saw this as being a problem or anything though. Is that the same sort of thing that you see (do you see it at the end of a function too)? Regards Bidski -----Original Message----- From: Jupiter Sent: Saturday, November 27, 2010 11:26 AM To: min...@li... Subject: [Mingw-users] Question / Problem with g++ 4.5.0-1 and gdb 7.2-1 Hello, I searched the list archives but found nothing relevant to my problem: I am using the MinGW packages mentioned in the subject line: g++ 4.5.0-1 and gdb 7.2-1, downloaded and installed by the automatic installer. As IDE I am using Code::Blocks, OS is Windows XP SP3. My problem: I have a small program in C++. When I try to debug it with gdb, it works, in the cmd window and in Code:Blocks. But there is a peculiar problem - sometimes the line numbers for the source code, shown in gdb, become confused. It can happen, that it debugs from source lines 110, 111, 112, 113, 114 - then suddenly it jumps back to line 110, the 111, and so on. But functional the lines are not executed. Nearly every time, several lines later it jumps down and is in sync again. There are no loops, btw. Its a normal sequence of code. Not always the same code, but the problem is repeatable. At certain points in my code the lines come out of sync with the source, but the execution seems ok to me - I would have functional problems if the lines were executed as shown. Here is an example: (In a cmd window with gdb only the same thing happens, so its not Code::Blocks) Lines of code reported by gdb in Code::Blocks At D:\work\OW Static Tool\src\OWStaticTool.cpp:99 At D:\work\OW Static Tool\src\OWStaticTool.cpp:104 At D:\work\OW Static Tool\src\OWStaticTool.cpp:105 At D:\work\OW Static Tool\src\OWStaticTool.cpp:106 At D:\work\OW Static Tool\src\OWStaticTool.cpp:107 At D:\work\OW Static Tool\src\OWStaticTool.cpp:105 (???) At D:\work\OW Static Tool\src\OWStaticTool.cpp:104 (???) At D:\work\OW Static Tool\src\OWStaticTool.cpp:113 (in sync again) At D:\work\OW Static Tool\src\OWStaticTool.cpp:98 (???) At D:\work\OW Static Tool\src\OWStaticTool.cpp:113 (in sync and end of main) Here is the code segment, with line numbers: (I just tried something, code makes not much sense, but works well) Stepped with 'Step Over': 98 std::string statics_file = "\\statics0.mul"; 99 statics_file = uopath + statics_file; 100 void *mem_ptr; 101 size_t len; 102 try 103 { 104 file_mapping m_file(statics_file.c_str(), read_only); 105 mapped_region region(m_file, read_only); 106 mem_ptr = region.get_address(); 107 len = region.get_size(); 108 } 109 catch (...) 110 { 111 return 1; 112 } 113 std::cout << "Groesse ist " << len << " bytes." << std::endl; 114 } <- this is the end of main(). Anybody seen this? Thanks CodeDwarf ------------------------------------------------------------------------------ Increase Visibility of Your 3D Game App & Earn a Chance To Win $500! Tap into the largest installed PC base & get more eyes on your game by optimizing for Intel(R) Graphics Technology. Get started today with the Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. http://p.sf.net/sfu/intelisp-dev2dev _______________________________________________ MinGW-users mailing list Min...@li... This list observes the Etiquette found at http://www.mingw.org/Mailing_Lists. We ask that you be polite and do the same. Disregard for the list etiquette may cause your account to be moderated. _______________________________________________ You may change your MinGW Account Options or unsubscribe at: https://lists.sourceforge.net/lists/listinfo/mingw-users Also: mailto:min...@li...?subject=unsubscribe |