MCPcopy Create free account
hub / github.com/Marus/cortex-debug / createBreakpoints

Method createBreakpoints

src/gdb.ts:1928–1984  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1926 pendContinue: PendingContinue): Promise<void> => {
1927 return new Promise(async (resolve) => {
1928 const createBreakpoints = async () => {
1929 try {
1930 await this.miDebugger.removeBreakpoints(this.functionBreakpoints);
1931 this.functionBreakpoints = [];
1932
1933 const all = new Array<Promise<OurSourceBreakpoint | MIError>>();
1934 args.breakpoints.forEach((brk) => {
1935 const arg: OurSourceBreakpoint = {
1936 ...brk,
1937 raw: brk.name,
1938 file: undefined,
1939 line: undefined
1940 };
1941 all.push(this.miDebugger.addBreakPoint(arg).catch((err: MIError) => err));
1942 });
1943
1944 const breakpoints = await Promise.all(all);
1945 const finalBrks: DebugProtocol.Breakpoint[] = breakpoints.map(
1946 (brkp) => {
1947 if (brkp instanceof MIError) {
1948 /* Failed breakpoints should be reported with
1949 * verified: false, so they can be greyed out
1950 * in the UI.
1951 */
1952 return {
1953 verified: false,
1954 message: brkp.message
1955 };
1956 }
1957
1958 this.functionBreakpoints.push(brkp.number);
1959
1960 return {
1961 source: {
1962 path: brkp.file,
1963 name: brkp.raw
1964 },
1965 line: brkp.line,
1966 instructionReference: brkp.address,
1967 id: brkp.number,
1968 verified: true
1969 } as DebugProtocol.Breakpoint;
1970 }
1971 );
1972
1973 response.body = {
1974 breakpoints: finalBrks
1975 };
1976 this.sendResponse(response);
1977 }
1978 catch (msg) {
1979 this.sendErrorResponse(response, 10, msg.toString());
1980 }
1981
1982 this.continueIfNoMore(pendContinue);
1983 resolve();
1984 };
1985

Callers

nothing calls this directly

Calls 7

continueIfNoMoreMethod · 0.95
toStringMethod · 0.80
addInstrBreakPointMethod · 0.80
addDataBreakPointMethod · 0.80
removeBreakpointsMethod · 0.65
addBreakPointMethod · 0.65

Tested by

no test coverage detected