Example #1
0
        internal static async Task <BindResult> Bind(string documentName, uint line, uint column, DebuggedProcess process, string condition, bool enabled, IEnumerable <Checksum> checksums, AD7PendingBreakpoint pbreak)
        {
            process.VerifyNotDebuggingCoreDump();

            string compilerSrcName;

            if (!process.MapCurrentSrcToCompileTimeSrc(documentName, out compilerSrcName))
            {
                compilerSrcName = Path.GetFileName(documentName);
            }
            BindResult bindResults = EvalBindResult(await process.MICommandFactory.BreakInsert(compilerSrcName, process.UseUnixSymbolPaths, line, condition, enabled, checksums, ResultClass.None), pbreak);

            // On GDB, the returned line information is from the pending breakpoint instead of the bound breakpoint.
            // Check the address mapping to make sure the line info is correct.
            if (process.MICommandFactory.Mode == MIMode.Gdb &&
                bindResults.BoundBreakpoints != null)
            {
                foreach (var boundBreakpoint in bindResults.BoundBreakpoints)
                {
                    string matchFile = compilerSrcName;
                    if (!string.IsNullOrEmpty(boundBreakpoint.CompiledFileName))
                    {
                        matchFile = boundBreakpoint.CompiledFileName;   // get the file name as it appears in the symbolic info
                    }
                    boundBreakpoint.Line = await process.LineForStartAddress(matchFile, boundBreakpoint.Addr);
                }
            }

            return(bindResults);
        }
Example #2
0
        internal static async Task <BindResult> Bind(string documentName, uint line, uint column, DebuggedProcess process, string condition, AD7PendingBreakpoint pbreak)
        {
            process.VerifyNotDebuggingCoreDump();

            string basename = System.IO.Path.GetFileName(documentName);     // get basename from Windows path

            basename = process.EscapePath(basename);
            BindResult bindResults = EvalBindResult(await process.MICommandFactory.BreakInsert(basename, line, condition, ResultClass.None), pbreak);

            // On GDB, the returned line information is from the pending breakpoint instead of the bound breakpoint.
            // Check the address mapping to make sure the line info is correct.
            if (process.MICommandFactory.Mode == MIMode.Gdb &&
                bindResults.BoundBreakpoints != null)
            {
                foreach (var boundBreakpoint in bindResults.BoundBreakpoints)
                {
                    boundBreakpoint.Line = await process.LineForStartAddress(basename, boundBreakpoint.Addr);
                }
            }

            return(bindResults);
        }
Example #3
0
        internal static async Task<BindResult> Bind(string documentName, uint line, uint column, DebuggedProcess process, string condition, AD7PendingBreakpoint pbreak)
        {
            process.VerifyNotDebuggingCoreDump();

            string basename = System.IO.Path.GetFileName(documentName);     // get basename from Windows path
            basename = process.EscapePath(basename);
            BindResult bindResults = EvalBindResult(await process.MICommandFactory.BreakInsert(basename, line, condition, ResultClass.None), pbreak);

            // On GDB, the returned line information is from the pending breakpoint instead of the bound breakpoint.
            // Check the address mapping to make sure the line info is correct.
            if (process.MICommandFactory.Mode == MIMode.Gdb &&
                bindResults.BoundBreakpoints != null)
            {
                foreach (var boundBreakpoint in bindResults.BoundBreakpoints)
                {
                    boundBreakpoint.Line = await process.LineForStartAddress(basename, boundBreakpoint.Addr);
                }
            }

            return bindResults;
        }