remove compile messages from clojure build failure backtraces - clojure

I would just love a way to filter out the back-traces from the compilation process and see only the messages from the running of my program.
I'm currently using La Clojure for Intellij, though I also use slime/emacs.

If you're willing to drop back to the terminal to run, you can use mmcgrana's clj-backtrace to colorize and format the output of clojure's stacktraces.
A clj-like script that integrates clj-backtrace is available here.
Example:
example of clj-backtrace http://img.skitch.com/20091117-re5bqm6f5axg25mxpwcbcx53f8.png

Related

How can you trace execution of an embedded system emulted in QEMU?

I've built OpenWrt for x86 and I'm using QEMU to run it virtually.I'm trying to debug this system in real time. I need to see things like network traffic flowing etc.
I can attach gdb remotely and execute (mostly) step by step with break points. I really want trace points though. I don't want to pause execution and loose network flow. When I tried setting trace points using tstart, I see the message "Target does not support this command". I did a bit of reading of the gdb documentation and from what I can tell the gdb stub that runs to intercept normal execution in QEMU does not support trace points.
From here I started looking at other tools and ran across PANDA (https://github.com/panda-re/panda). As I understand PANDA will capture a complete system trace in a log and allow for replay. I think this tool is supposed to do what I need, but I cannot seem to replay the results. I see the logs, I just can't replay them.
Now, I'm a bit stuck on what other tools/options I might have to actually trace a running embedded system. Are there any good tools you can recommend? Or perhaps another method I've missed?
If you want to see the system calls and signals use strace.
Strace can also be used with running process and it can put the output in a log file if required.
In OpenWrt it is possible to build with ftrace. Ftrace has much of the functionality I required but not all.
To build with ftrace, the option for ftrace must be selected in the build menu. Additionally there are a variety of tracer options that must also be enabled.
The trace-cmd (ftrace) is located in menuconfig/Development
Tracing support is under menuconfig/Global build settings/Compile the kernel with tracing support and includes: Trace system calls, Trace process context switches and events, and Function tracer (Function graph tracer, Enable/disable function tracing dynamically, and Function profiler)
I'm also planning to build a custom GDB stub to do this a little bit better as I also want to see the data passed to the functions not just the function calls.

GDB scripting - execute command only if not debugging core file

I'm adding some features I find useful to my GDB startup script. A few of the startup commands apply only to "live" targets, or have components that make sense only with live targets. I'd like to be able to test for the presence (or absence) of a core file, and skip or amend these commands as appropriate.
I looked around in the Python API, but couldn't find anything that tells me whether an inferior is a core file or a live program. I'm fine with a scripting solution that works in either GDB itself or in the Python GDB scripting interface.
It doesn't look like there is a way to do that.
I'd expect an attribute on gdb.Inferior, but there isn't one.
File a feature request in GDB bugzilla.
info proc status returns "unable to handle request" for core files, whereas for a live process it returns several lines, the first of which looks like: "process 1234".
You can run that command and compare its first output line against that string using the execute_output() function from here: https://github.com/crossbowerbt/GDB-Python-Utils/blob/master/gdb_utils.py

Show progress bar when running a script

I have developed the python script for checking out a source code from repository and build it using visual studio.When i run the script,a GUI opens(developed using wxPython) which shows a button,clicking on which does the checkout and build.I would want to show a progress bar showing the process running when i click on the button and a success message after the script finishes it's work.Please help me out.
Thanks in advance.
You probably won't be able to get an accurate progress unless your build scripts are generating some progress information in the output that you can parse and represent in your GUI. Either way you will probably want to use wx.ProgressDialog or use a wx.Gauge in your main panel or something like that. Both wx.ProgressDialog and wx.Gauge can be used in a mode that shows actual values (a percentage complete) or an 'indeterminate' mode that represents that something is happening but there isn't any way to tell how far in the process it is.

How to trace Coldfusion template execution in details?

I have some 'spaghetti'-style code that is generously saused with Custom tags and Stored procedures calls. Templates include each other, custom tags nested and stored procedures are callind other stored procedures in their place.
Problem is that one template call is hanging somewhere in between. I cannot get any error out and cannot see debug output. What is best way to debug such 'hanging' request with as much detail as possible ?
Thanks!
If you are using CF 8+, you can use the Step Debugging tools in Eclipse to step through the code: http://www.adobe.com/devnet/coldfusion/articles/debugger.html
If you are using an earlier version, you can use a 3rd party product like Fusion Debug ( http://www.fusion-debug.com/fd/ ) to do the same thing.
If you are using CF8, you can also use the CF Admin Server Monitor to see where a thread is hanging as well: http://www.adobe.com/devnet/coldfusion/articles/monitoring_pt1.html
If the built-in debugger is of no use cause the request just hang the other quick way is to just start with a cfabort at the top and keep moving it down until you hit the file causing the request to hang.
CFTrace is a great tool for this. It is native and reports time information as well.
Have you looked at the standard coldfusion server log files to see what might be in there?
Have you run the server in a console window so you can see what is appearing in the console as the templates are running (or not as the case might be)?
You could Take jvm thread dumps. You can do from command line or via server monitoring if you have Enterprise 8+

C++ interpreter / console / snippet compiler

I am looking for a program where I can enter a C++ code snippet
in one window, press a button, and get output in another window.
Compilation should somehow be hidden behind the button. On a
per-snippet basis would be fine, full interactive probably asking
too much. It should run under Linux/Unix. Main use case would be
learning/testing/short debugging, etc.
Related stuff I found:
-- the Reinteract project for python (which i'm told sage has features similar to)
-- the same thread for C# here: C# Console?
-- the CINT interpreter from the CERN ROOT project
(which may be close, but maybe there are more comfortable apps around)
-- some programs called Quickly Compile or Code Snippet, which are M$.
http://codepad.org/ works nicely for this purpose. By default, it will run what you paste when you hit submit and display the result (or any errors you might have).
Dinkumware has a page for this AND you can choose the compiler
http://dinkumware.com/exam/default.aspx
Do something like this ?
test a C# snippet code by just copying it to the clipboard and then type csc.exe:
http://reboltutorial.com/blog/redirect-shell-to-rebol-console/
Cling (interactive C++ interpreter, built on the top of LLVM and Clang libraries): https://root.cern.ch/drupal/content/cling
Just configure your code editor to compile and run your code snippets.
Most code editors have the capability of 'sending' the current buffer/file to an external tool. I configure one editor key binding to compile the current buffer, and another key binding to execute whatever was last compiled (actually to run whatever has the same base filename as the current buffer with an '.exe' extension). My experience is with Windows, but the same or similar can be done on Unix/Linux.
Then it becomes one keystroke to compile and another to run what I jut compiled. This could also easily be just a single keystroke to compile & run, but I have several key bindings set to compile using various different compilers. That way I can easily test snippets using the latest MSVC, MSVC 6, MinGW GCC, Comeau and Digital Mars compilers to check for differences.
I would do it like this:
Capture the 'snippit' as text
Create a.cpp with the following:
int main() {
snippitCode();
return 0;
}
void snippitCode() {
// INSERT SNIPPIT HERE
}
Use 'exec' to launch a compiler and pipe the output to an output file.
Use 'exec' to run the application and pipe the output to an output file.
In the 'output' window, you can run 'tail -f' on the output file to continuously update when new output arrives.