How do I see the expanded macro code that’s causing my compile error?

cargo rustc –profile=check — -Zunpretty=expanded, but a more concise alternative is the cargo-expand crate. It provides a Cargo subcommand cargo expand which prints the result of macro expansion. It also passes the expanded code through rustfmt which generally results in much more readable code than the default output from rustc. Install by running cargo install … Read more

How does a debugger work?

The details of how a debugger works will depend on what you are debugging, and what the OS is. For native debugging on Windows you can find some details on MSDN: Win32 Debugging API. The user tells the debugger which process to attach to, either by name or by process ID. If it is a … Read more

Enumerate or list all variables in a program of [your favorite language here] [closed]

In python, using locals which returns a dictionary containing all the local bindings, thus, avoiding eval: >>> foo1 = “Hello world” >>> foo2 = “bar” >>> foo3 = {“1″:”a”, … “2”:”b”} >>> foo4 = “1+1” >>> import pprint >>> pprint.pprint(locals()) {‘__builtins__’: <module ‘__builtin__’ (built-in)>, ‘__doc__’: None, ‘__name__’: ‘__main__’, ‘foo1’: ‘Hello world’, ‘foo2’: ‘bar’, ‘foo3’: {‘1’: … Read more

How do you debug classic ASP?

From an MSDN blog post: http://blogs.msdn.com/mikhailarkhipov/archive/2005/06/24/432308.aspx Here is how to make ASP debugging work: Enable ASP debugging on the server. (I also added DEBUG verb to the asp extension, but I am not sure if it is required). Open classic ASP in VS 2005. Set breakpoint. View page in browser or run without debugging. Debug … Read more

What are the debug memory fill patterns in Visual Studio C++ and Windows?

This link has more information: https://en.wikipedia.org/wiki/Magic_number_(programming)#Debug_values * 0xABABABAB : Used by Microsoft’s HeapAlloc() to mark “no man’s land” guard bytes after allocated heap memory * 0xABADCAFE : A startup to this value to initialize all free memory to catch errant pointers * 0xBAADF00D : Used by Microsoft’s LocalAlloc(LMEM_FIXED) to mark uninitialised allocated heap memory * … Read more