I know that red addresses means, that code do not recognize as a function in IDA, because that code never get called. But I have found a piece of code that is marked red, but when debugging, I saw that this code gets called. But I still can't get that graph view of that piece of code and it still marked red. Can someone please explain what's happening here..?
To make IDA recognize the code as a procedure, press P at the start of it.
Ida "automatically presses the P key" if it sees a direct call to that address. However, if the source code was C++ or another language with classes, the function might never be called directly, only indirectly through the vtable (table of method start addresses) of the class. In this case, you'll have to mark the procedure manually.