debugging

how to change single char in string array?

走远了吗. 提交于 2020-07-03 11:56:43
问题 Having this: #include <stdio.h> #include <stdlib.h> #include <ctype.h> char *up(char *); int main() { char initstr[20]; printf("enter string\n"); fgets(initstr, 20, stdin); char *str = up(initstr); printf("%s\n", str); } char *up(char *in) { char *ret; for (ret = in; *in != '\n'; *(ret++) = toupper(*(in++)) ); return ret; } Run it as: $./a.out enter string abc #only new line from `printf("%s\n",str);` From debugger Hardware watchpoint 3: in Old value = 0x7fffffffdc20 "abc\n" New value =

how to change single char in string array?

狂风中的少年 提交于 2020-07-03 11:56:11
问题 Having this: #include <stdio.h> #include <stdlib.h> #include <ctype.h> char *up(char *); int main() { char initstr[20]; printf("enter string\n"); fgets(initstr, 20, stdin); char *str = up(initstr); printf("%s\n", str); } char *up(char *in) { char *ret; for (ret = in; *in != '\n'; *(ret++) = toupper(*(in++)) ); return ret; } Run it as: $./a.out enter string abc #only new line from `printf("%s\n",str);` From debugger Hardware watchpoint 3: in Old value = 0x7fffffffdc20 "abc\n" New value =

How to solve “Could not find the task 'gcc build active file.” error in VSCode?

丶灬走出姿态 提交于 2020-07-03 08:19:09
问题 I've just setup VSCode to work from home with my remote SSH that runs Gentoo x64 . Everything works fine apart from the GCC debugger which we usually use. It throws me the error in the title. Here's my launch.json : { "version": "0.2.0", "configurations": [ { "name": "gcc - Build and debug active file", "type": "cppdbg", "request": "launch", "program": "${fileDirname}/${fileBasenameNoExtension}", "args": [], "stopAtEntry": false, "cwd": "${workspaceFolder}", "environment": [],

How to solve “Could not find the task 'gcc build active file.” error in VSCode?

久未见 提交于 2020-07-03 08:18:04
问题 I've just setup VSCode to work from home with my remote SSH that runs Gentoo x64 . Everything works fine apart from the GCC debugger which we usually use. It throws me the error in the title. Here's my launch.json : { "version": "0.2.0", "configurations": [ { "name": "gcc - Build and debug active file", "type": "cppdbg", "request": "launch", "program": "${fileDirname}/${fileBasenameNoExtension}", "args": [], "stopAtEntry": false, "cwd": "${workspaceFolder}", "environment": [],

Visual Studio debugger - source search directory

一个人想着一个人 提交于 2020-07-03 06:51:10
问题 I have a crash dump (minidump, mdmp format) for an executable (native x86 code) compiled on a different computer. I have the pdb + exe corresponding to the crash dump, they are located next to the crashdump, and debugger recognizes them correctly. The pdb references sources on a path which is not available on my computers (say E:\Project ). When I first opened the crash dump, the debugger has asked me for the source location. I pointed it to E:\B\Project on my computer, however once the

Visual Studio debugger - source search directory

徘徊边缘 提交于 2020-07-03 06:50:48
问题 I have a crash dump (minidump, mdmp format) for an executable (native x86 code) compiled on a different computer. I have the pdb + exe corresponding to the crash dump, they are located next to the crashdump, and debugger recognizes them correctly. The pdb references sources on a path which is not available on my computers (say E:\Project ). When I first opened the crash dump, the debugger has asked me for the source location. I pointed it to E:\B\Project on my computer, however once the

How is the octave debugger used?

泪湿孤枕 提交于 2020-07-02 15:47:33
问题 So I'm trying to use the octave debugger to detect where division by zero happens. For that it seems logical to use "debug_on_warning ()". However I'm just not understanding how to use this function call. I mean should I place it in the script somewhere? but then how would the debugger start? an example would be great! 回答1: Take a look at the Debugging section of the Octave manual. For your case, you should place debug_on_warning (1) at the top of your script so it stops when the warning

How is the octave debugger used?

余生颓废 提交于 2020-07-02 15:46:08
问题 So I'm trying to use the octave debugger to detect where division by zero happens. For that it seems logical to use "debug_on_warning ()". However I'm just not understanding how to use this function call. I mean should I place it in the script somewhere? but then how would the debugger start? an example would be great! 回答1: Take a look at the Debugging section of the Octave manual. For your case, you should place debug_on_warning (1) at the top of your script so it stops when the warning

As a newbie I can't find the bug in the program

别来无恙 提交于 2020-06-29 06:42:24
问题 I was training a code wars kata and the kata was: In a factory a printer prints labels for boxes. For one kind of boxes the printer has to use colors which, for the sake of simplicity, are named with letters from a to m. The colors used by the printer are recorded in a control string. For example a "good" control string would be aaabbbbhaijjjm meaning that the printer used three times color a, four times color b, one time color h then one time color a... Sometimes there are problems: lack of

Is there a way to find where the code creates the dynamically popup on browsers?

无人久伴 提交于 2020-06-29 04:26:13
问题 When I open a website that's not developed by me, it created a pop up of a DIV element. How can I find which code create that popup? I tried to set the breakpoint, but it only show the popup in the first time. Please note the key here are It's a website that's not developed by me The Popup is a DiV The popup only show the first time. If I refresh the page, it's gone. I'm not asking you to debug the site for me, I want to learn the ways to debug it by myself. What I'm after is programmatically