Is it possible to run Google's cpplint.py from within Code::Blocks, so I can jump from one error to the next in the source code?
For those unfamiliar with cpplint.py, it's a python script that flags lines that violate the Google Style Guide. It outputs error messsages in the same format as gcc's compiler errors, so emacs for example has no trouble the error spew correctly to step from one flagged line to the next.
Related
I'm building AOSP from source and have created a small C++ program that prints some messages to logcat when started. Now I wanted to debug the program according to https://source.android.com/devices/tech/debug/gdb
In the reference you're encouraged to use lldb in favor of gdb and there is also a short section on using vs code as debugger.
However, I cannot find the mentioned script lldbclient anywhere in my source nor in Android Code Search, only gdbclient.py seems to be present.
Q1: Where can I find lldbclient script?
When running the gdbclient.py script the option --setup-forwarding vscode seems to be ignored and gdb is always started.
Q2: If there isn't a lldbclient script, what options do I have to pass to gdbclient.py to enable debugging with lldb and vs code?
What did I do so far?
gdbclient.py -r /data/mysample_bin --setup-forwarding vscode
Starts my native program with attached gdb and allows me to step through my program.
Though I do not know how to code python, I was able to track down a call sequence in the script to method generate_setup_script, which is called with parameter debugger=gdb. Therefore no lldb configuration for vs code is created. Passing --no-gdb or --lldb to the script doesn't change this behavior.
Q1: You can find lldbclient.py script in the repository https://android.googlesource.com/platform/development, branch android-s-beta-2 (or another android-s branch).
Q2: Android also provides some tutorial debugging with Vscode: https://source.android.com/devices/tech/debug/gdb#vscode.
I'm experiencing an issue with QTCreator. It doesn't parse compiler output and IssueTab is always empty, in spite of compiler output contains some. It seams that complier output is totally made to stdout and not to stderr (compile output is totally grey).
That happens if I use XCode Cmake generator. When I switch to Unix MakeFiles generator issues are shown normally, but I stacked to Xcode as project is really old and is written to support only XCode.
Search in google for some specific flags for Xcode generator hand't provided any useful response.
Thus I'm asking the Community.
A small hack: 1>&2. Now everything goes to stderr, and QtCreator tries to parse it
UPD: -quiet makes output more clean
How to make xcodebuild print compile errors and warnings to stderr?
Is there a way to tell pyCharm that it should skip framework code? The debugger should skip all lines which are not from me.
In my case it is very easy to tell which code I want to debug and which not:
Code in virtualenv lib should be skipped
Code in virtualenv src should be debugged.
If I press F7 (Step Into) it should skip all lines which are not from my code base.
[Update May 2015: introduced in PyCharm 4.5]
There are two new features now, one of which is the one you asked for, but I mention the other one as well because it is topically very close.
From the 4.5 release notes:
Step into My Code
Stay focused on your code by telling the debugger to step only through your project code, as opposed to stepping through the library sources.
[...]
Ignore Library Files
The debugger is improved with the new 'Ignore library files' option. Use it to have the debugger stop inside your code in case the exception is raised in a library module, instead of stopping inside the library code.
[Update after learning about blackboxing libraries in debugging]
In this answer it is mentioned that you can add the modules to ignore into "the dict DONT_TRACE in /helpers/pydev/pydevd.py"
And there is an open issue on the issue tracker.
[original answer]
It is not possible to skip code like that, but you can flexibly switch between walking through the code line by line and making bigger jumps in a running debug session by simply adding another breakpoint (while debugging - break points can be changed in a running debug session) at the position after the library code you want to skip and press 'Resume Program' in the Debugger. The library code is skipped and you are back in your code.
You might also want to use conditional breakpoints to make sure that the program breaks into the debugger exactly when the program is in the state that you desire: right click on a breakpoint and enter a condition that has to evaluate to True in the context of that line.
I'm working on a project, and on a machine without Xcode, I'm getting a crash. (of course it works on my machine B-/) I have a crash log, with a PC offset for the crash. I'd like to be able to see where that actually is in the code. I know that Code Warrior can disassemble the code (presumably, only debugable code) and show it interspersed with the C code, then I just have to look for that address, and I'm done.
Is there an easy way to do this in Xcode?
thanks.
There are two things in Xcode you may want to look at. The first would be to select your source code file and choose Build->Show Assembly Code. What this won't give you though is offsets.
The second assembly capability is in the debugger. Choose Run->Debugger Display->Source and Disassembly, and the debugger will show you both source and assembly code side-by-side. However, the two are not interspersed.
If neither of these Xcode facilities give you what you need, your only recourse may be the otool command line tool.
I've never found a way to generate or view source and assembly interspersed.
I have recently edited a fellow student's data collection software to my specifications. The program works fine when I run within Visual Basic 6, however ideally I would like to compile the program into an .exe file so I can run it from any PC. However, when I select the option to turn it into an exe, I get the following error while its compiling:
Compile Error: Sub or Function not defined.
I was curious why my program will run from within Visual Basic, but can't compile into an exe. Any fixes/suggestions would be greatly appreciated!
You must just be running the app in the IDE by using Start (F5) - this does not do a full compile so won't catch all compile errors. I suggest you always use Start With Full Compile (Ctrl+F5) - then it will show you where the errors are.
You can create a custom control bar button to do the Start With Full Compile - saves typing CTRL+F5 all the time.
at the begining of every file, write "option explicit". This changes vb behavior from weak typed to strong typed.
What this means is that when you put a string into an integer, then the vb will tell you right away, or at least when you press "run". In a weak typed mode, the program will run until it encounters a fault, like "Sub or Function not defined" then crash.
When you compile into an "exe", vb needs to do extra sanity checks much like "option explicit" would do. This is why you don't see the problem while normal execution. It is still there, lurking, but you probably don't execute the problematic line.
It is very important that you use this keyword in every vb source file you have, otherwise you'll see problems like this all the time.
It allows you to run the program even though it won't compile due to the Compile On Demand feature the IDE supports. As noted in other posts you can CTRL-F5 to do a full compile, or you can go into Options --> General and turn off Compile On Demand...(saves a lot of CTRL-F5s)