MCPcopy Create free account
hub / github.com/dhewm/dhewm3 / MSG_WriteCallstackFunc

Method MSG_WriteCallstackFunc

neo/game/script/Script_Interpreter.cpp:1927–1966  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1925}
1926
1927void idGameEditExt::MSG_WriteCallstackFunc(idBitMsg* msg, const prstack_t* stack, const idProgram * program, int instructionPtr)
1928{
1929 const statement_t* st;
1930 const function_t* func;
1931
1932 func = stack->f;
1933
1934 // If the function is unknown then just fill in with default data.
1935 if ( !func )
1936 {
1937 msg->WriteString ( "<UNKNOWN>" );
1938 msg->WriteString ( "<UNKNOWN>" );
1939 msg->WriteInt ( 0 );
1940 return;
1941 }
1942 else
1943 {
1944 msg->WriteString ( va("%s( )", func->Name() ) );
1945 }
1946
1947 if (stack->s == -1) //this is a fake stack created by debugger, use intruction pointer for retrieval.
1948 st = &const_cast<idProgram*>( program )->GetStatement( instructionPtr );
1949 else // Use the calling statement as the filename and linenumber where the call was made from
1950 st = &const_cast<idProgram*>( program )->GetStatement ( stack->s );
1951
1952 if ( st )
1953 {
1954 idStr qpath = const_cast<idProgram*>( program )->GetFilename( st->file );
1955 if (idStr::FindChar( qpath, ':' ) != -1)
1956 qpath = fileSystem->OSPathToRelativePath( qpath.c_str() );
1957 qpath.BackSlashesToSlashes ( );
1958 msg->WriteString( qpath );
1959 msg->WriteInt( st->linenumber );
1960 }
1961 else
1962 {
1963 msg->WriteString ( "<UNKNOWN>" );
1964 msg->WriteInt ( 0 );
1965 }
1966}
1967
1968void idGameEditExt::MSG_WriteInterpreterInfo(idBitMsg* msg, const idInterpreter* interpreter, const idProgram* program, int instructionPtr)
1969{

Callers

nothing calls this directly

Calls 7

vaFunction · 0.85
WriteStringMethod · 0.45
WriteIntMethod · 0.45
NameMethod · 0.45
GetFilenameMethod · 0.45
OSPathToRelativePathMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected