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

Method MSG_WriteCallstackFunc

neo/d3xp/script/Script_Interpreter.cpp:1928–1967  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

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