MCPcopy Create free account
hub / github.com/beefytech/Beef / Init

Method Init

IDEHelper/DebugTarget.cpp:150–180  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

148}
149
150DbgModule* DebugTarget::Init(const StringImpl& launchPath, const StringImpl& targetPath, intptr imageBase)
151{
152 BP_ZONE("DebugTarget::Init");
153
154 AutoDbgTime dbgTime("DebugTarget::Init Launch:" + launchPath + " Target:" + targetPath);
155
156 mTargetPath = targetPath;
157 FileStream fileStream;
158 fileStream.mFP = _wfopen(UTF8Decode(launchPath).c_str(), L"rb");
159 if (fileStream.mFP == NULL)
160 {
161 mDebugger->OutputMessage(StrFormat("Debugger failed to open binary: %s\n", launchPath.c_str()));
162 return NULL;
163 }
164
165 DbgModule* dwarf = new COFF(this);
166 mLaunchBinary = dwarf;
167 dwarf->mDisplayName = GetFileName(launchPath);
168 dwarf->mFilePath = launchPath;
169 dwarf->mImageBase = (intptr)imageBase;
170 if (!dwarf->ReadCOFF(&fileStream, DbgModuleKind_Module))
171 {
172 mDebugger->OutputMessage(StrFormat("Debugger failed to read binary: %s\n", launchPath.c_str()));
173 delete dwarf;
174 return NULL;
175 }
176 CheckTargetBinary(dwarf);
177
178 AddDbgModule(dwarf);
179 return dwarf;
180}
181
182void DebugTarget::CreateEmptyTarget()
183{

Callers

nothing calls this directly

Calls 3

ReadCOFFMethod · 0.80
c_strMethod · 0.45
OutputMessageMethod · 0.45

Tested by

no test coverage detected