0

When I run my code I get this error:

"source information is missing from the debug information for this module."

I use callbacks in my code in C++ concert CPLEX. When I run the code without using a callback I don't see the error message but when I use callback I do see the error message. Some of the parameters in my code are matrix 10*5. When I run the code with matrix 5*5 I don’t get any error but with matrix 10*5 I get an error.

I don’t have any information about dll and PDB file. I don’t know how to fix this error in visual studio 2015 on windows 10? I read some topics about this error on StackOverflow but I mixed up and I don’t know which one is good for my problem.

Richard Chambers
  • 16,643
  • 4
  • 81
  • 106
Mandana
  • 103
  • 9
  • Are you running your program from within Visual Studio? Can you try running it from the command prompt and showing us the output you get there? – rkersh Jul 01 '19 at 17:53

1 Answers1

1

This message about source information missing is an informational message and not really an error. What it is saying is that you are trying to single step with the debugger through a part of your program for which the debugger does not have the source code. The result is that you can step through the program viewing the assembler generated by the debugger but the debugger can not show you the actual source code of the program at the point you are currently looking.

The fix for this is to get the source code and make it available to the debugger.

However you may not need to do this.

What it sounds like is happening is the following.

You are stepping through your program with the debugger and at some point the CPLEX functionality, which is doing some kind of an asynchronous task in parallel with the part of the program you are stepping through begins to perform some kind of action that will result in your callback being triggered. The current instruction is within the CPLEX functionality and the debugger does not have access to the source code and the descriptive information in the .pdb file generated by the compiler.

This article, Specify symbol (.pdb) and source files in the Visual Studio debugger (C#, C++, Visual Basic, F#), about the Visual Studio debugger has this to say about the informational message you are seeing:

There are several ways for the debugger to break into code that does not have symbol or source files available:

  • Step into code.
  • Break into code from a breakpoint or exception.
  • Switch to a different thread.
  • Change the stack frame by double-clicking a frame in the Call Stack window.

Background on callbacks and asynch processing

Some background information on the callback concept: Wikipedia article Callback (computer programming), What is a callback function? , What is a "callback" in C and how are they implemented? .

When you are not using callbacks then there is no asynchronous task being performed, the use of CPLEX is synchronous in that you do a call into a CPLEX function, it returns with a result, and then your program continues after waiting for the result. With asynchronous, you do a call into the CPLEX functionality that starts an asynchronous task and then immediately returns without finishing with the expectation that when the task does finish, your callback will be triggered.

When CPLEX triggers the callback, because you are single stepping and the program does a sudden transfer of control to the CPLEX functionality between one step and the next in the debugger, you are suddenly single stepping through the CPLEX source code but the debugger doesn't have that source. So it issues an informational message telling you that it can't find the source and giving you other options.

Workaround debug procedures

What I do under these circumstances is to set a breakpoint in the callback so that if I then just do a Run command, the callback will be triggered and then execution will stop at that breakpoint in my source and then I can continue single stepping through the callback function source.

The problem you may run into is when the callback is on one thread and the other execution path you were following is on another thread. Then what happens is the debugger is swapping between the two threads of execution and single stepping becomes more difficult as the running thread changes from one place in your program to another. To get around this usually requires setting breakpoints or manually changing the currently executing thread with the debugger.

However if this functionality is single threaded then you should be able to just set the breakpoint in the callback and then when the callback is triggered by the CPLEX functionality, execution will jump to that point and hit the breakpoint. You can then single step through the callback functionality and when it returns back to the CPLEX functionality just press Run to let it continue.

Richard Chambers
  • 16,643
  • 4
  • 81
  • 106