debugging

Rails debugging rails tasks

Hello. How is it possible to debug rake tasks? When I write debugger it does not start: NoMethodError: undefined method `run_init_script' for Debugger:Module from /usr/local/lib/ruby/gems/1.8/gems/ruby-debug-base-0.10.3/lib/ruby-debug-base.rb:239:in `debugger' from (irb):4 If I run rake my:task --debugger rake returns me to console i...

Can my app arrange a gdb breakpoint or watch?

Is there a way for my code to be instrumented to insert a break point or watch on a memory location that will be honored by gdb? (And presumably have no effect when gdb is not attached.) I know how to do such things as gdb commands within the gdb session, but for certain types of debugging it would be really handy to do it "programma...

Android - "Resources don't contain package for resource number"

My android application has several warnings of the following form when I run it in the emulator: "Resources don't contain package for resource number <Hex Address>" How can I fix these warnings? In particular, is there an easy way to find out what the hex address refers to? ...

Try & Catch — How do you use them effectively?

I've been trying to teach myself JavaScript, and one thing I was reading on is the try/catch structure. Unfortunately, the tutorial doesn't provide much explanation on how it would be useful, just how to set it up. Can anyone offer some insight? ...

Javascript debugging: stopping/breaking at every javascript invocation

I am dealing with a complex legacy javascript code base, and it's difficult to figure out where to put breakpoint (I have to find the files, put a breakpoint in firebug etc). Is there a way so that Firebug breaks on the first javascript execution that it encounters every time? In other words, every time I click on something on the pag...

Undefined symbols for C++0x lambdas?

I was just poking around into some new stuff in C++0x, when I hit a stumbling block: #include <list> #include <cstdio> using namespace std; template <typename T,typename F> void ForEach (list<T> l, F f) { for (typename list<T>::iterator it=l.begin();it!=l.end();++it) f(*it); } int main() { int arr[] = {1,2,3,4,5,6}; ...

How to use Visual Studio and IIS7 together?

Hi folks, I'm trying to use Visual Studio 2010 (but this also happens with VS2008) as my web server for all locahost development. When i go into the properties for my web application (sigh, it's a legacy web FORMS app) and check the Web tab .. then check the Use Local IIS Web Server option ... it only allows me to create a virtual dire...

Visualization/parsing a memory dump - What' the prefered starting point?

Hi all, Background: I'm developing an embedded application in C using Metaware (Eclipse based) on an ARC processor. Debug is done via a JTAG interface. Problem: The application has a global structure in memory holding the entire system state. During testing and debugging I wish to get the current state and review it (on a win machine) ...

Windbg and VirtualKd in between VMs: no reboot

Hi all, I'm running on Mac, have different Windows VMs on Vmware fusion and would like to either find a way to use VirtualKD or an equivalent to be able to remotely debug from one XP VM to another Windows VMs without having to constantly reboot the client VMs. VirtualKD requires to be installed on the machine hosting VMware. Obviously ...

View macro expanded version of source while debugging

I am attempting to debug some C code using the visual studio debugger. I seems my choices are to view the source code or view the the disassembly. But what I would really like to view is the source code with all the macro's expended. Is that also possible? ...

Find out what variable is throwing a NullPointerException programatically

I know I can find out if a variable is null in Java using these techniques: if (var==null) -> too much work try { ... } catch (NullPointerException e) { ...} -> it tells me what line is throwing the exception using the debugger -> by hand, too slow Consider this line of code: if (this.superSL.items.get(name).getSource().compareTo(VI...

Strange error message when closing WinForms App

We have an Windows Forms application which make use of some com components such as the web browser control and an API for a signature pad. When the application is closed, sometimes an error dialog is shown with the following text: "sw: myapp.exe - Error in Application" The text was like this: The instruction xyz caused an illegal acce...

How to stop debugging (or detach process) without stopping the process?

I often use VS 2008 to debug a .NET C# component of an application. Sometimes, I want to quit debugging and continue running the application. Stop Debugging kills the process I was debugging. How can I achieve my aim? This is not a web app, it's a local process that runs managed and unmanaged code. I found the "Detach All" optio...

can I see all SQL statements sent over an ODBC connection?

I'm working with a third-party application that uses ODBC to connect to, and alter, a database. During certain failure modes, the end-results are not what I expect. To understand it better, I'd like some way of inspecting all the statements sent to the database. Is there a way to do this with ODBC? I know with JDBC I could use http://ww...

How to check PHP filecode syntax in PHP?

Hi, I am in a need of running the PHP parser for PHP code inside PHP. I am on Windows, and I have tried system("C:\\Program Files (x86)\\PHP\\php.exe -l \"C:/Program Files (x86)/Apache/htdocs/a.php\"", $output); var_dump($output); without luck. The parameter -l should check for correct PHP syntax, and throw errors if some problems ex...

what happens when you stop VS debugger?

If I have a line like this ContentRepository.Update(existing); that goes into datastore repository to update some object and I have a try..catch block in this Update function like this: string file = XmlProvider.DataStorePhysicalPath + o.GetType().Name + Path.DirectorySeparatorChar + o.Slug + ".xml"; DataContractSeria...

Debugging a working program on Mathematica 5 with Mathematica 7

Hi everybody, I'm currently reading the Mathematica Guidebooks for Programming and I was trying to work out one of the very first program of the book. Basically, when I run the following program: Plot3D[{Re[Exp[1/(x + I y)]]}, {x, -0.02, 0.022}, {y, -0.04, 0.042}, PlotRange -> {-1, 8}, PlotPoints -> 120, Mesh -> False, ColorFunction...

debug boost::thread with gdb, code::blocks

I am running in a little bit of a trouble with boost threads ... I am using gdb with code::blocks and everytime I set a breakpoint in the thread code it breaks in the boost thread.hpp file, more exactly in this function (that probably launches the thread) namespace boost namespace detail class thread_data: void r...

Where did the debug commands go in Visual Studio 2008?

You're going to think I'm either lying or nuts, but neither is the case. I installed VS2008 PRO on a Windows 7 x64 machine and all the debugging commands are missing. There's no debug toolbar and no Debug.* commands under Tools\Options\keyboard. How do I get the debug functionality working? ...

How to get debugging statements for Android in Eclipse

I've read the lame documentation, and checked other answers. I'd like my Android app to print some debug statements in the logcat window of Eclispe. If I use the isLoggable method on the various types of debug levels on the Log class, I find that WARN and INFO are returning true. Log.w, and Log.i do not produce any output. Does anyon...