c++ - How to find where a library call returns? -
I am analyzing an external Fortran library which is quite large. Anyway, I want to fit the values of parameters for the function of the entire library. Entry Point is a method called calligraphic parameters.
The problem is that sometimes call returns are very fast, and the prices decrease in prices, they also come from random number generators. The question is: Does GDB (or some other debugger) have a way to see where the return was withdrawn from the library system? I have a source and they have already compiled with An idea that came to my mind was to go through the source code and find all the possible returns and set breakpoints on them, but is there any other way? Run GDB, What you can do, run from the program step by step (using If the program is huge, you can find binary return point. It is a breakpoint set at the beginning of the function and then from there for example Edit 2: Try to see that it works: Put a break at the beginning of the ceremony and go inside it. Then type (in the GDB course) to run until the -g BTW, I use
g ++ and
gfortran to compile I am I can not go through the sources manually or execute the line by line, since the whole code is the line of code dirty code ~
10k .
help type or
next help < / Code> and you can see the details of the
next command that basically progresses in your program.
next ), and then from there, at the beginning of the Breakpoint function, and see that this function Where does it go?
next 500 if you do not get the function out You have come, you have taken many steps, so go ahead and take a few steps next time, for example,
next 250 If you were still in the function, how much steps can you take, You can take more steps to find out what your Own increase. So if you say another time
next 500 and you were out of the function, then you start and this time start with
next 750 .
finish function is ended. Then (this is the part that I'm not sure that it will work correctly), type
reverse-phase and exit the action, to move backwards! (How is it cool ?!)
Comments
Post a Comment