Sections in project configuration to change
| Description | Key(s) | Details |
| Add New Item | Control-Shift-A | |
| Add reference | Alt-Shift-F10 | |
| Code files, cycle through, with popup list | Control-Tab | |
| Full Screen | Alt-Shift-Enter | |
| Goto Document Edit Panel | ESC | |
| Scroll Text up 1 line | Control-Down | |
| Alt-Shift-Enter | Full Screen Toggle |
This happens due to a problem with getting debug symbols.
To get around the problem, turn off automatic loading of symbols.
You can do this by going to Tools | Options... | Debugging | Symbols and checking the box
Search the above locations only when symbols are loaded manually.
You may be able to disable it more completely, but I like to be able to get symbols, and this allows me to still get them when I need to.
NOTE: there is some obscure env variable that can ? override this ?, it is _NT_SYMBOL_PATH, make sure it is not set either.
I guess this problem happens due to the symbol lookup and HttpSendRequest trying to do something with wininet.dll at the same time.
DebugBreak() in c++ can be replaced with:
http://msdl.microsoft.com/download/symbolshttp://www.radsoftware.com.au/articles/intellisensewebconfig.aspx
| 0xfd | No Mans Land | Buffer values around both sides of an allocated block |
| 0xdd | Freed blocks | |
| 0xcd | New blocks |
Good info was found at http://www.nobugs.org/developer/win32/debug_crt_heap.html
| Address | Offset | After HeapAlloc() | After malloc() | During free() | After HeapFree() | Comments |
| 0x00320FD8 | -40 | 0x01090009 | 0x01090009 | 0x01090009 | 0x0109005A | Win32 heap info |
| 0x00320FDC | -36 | 0x01090009 | 0x00180700 | 0x01090009 | 0x00180400 | Win32 heap info |
| 0x00320FE0 | -32 | 0xBAADF00D | 0x00320798 | 0xDDDDDDDD | 0x00320448 | Ptr to next CRT heap block (allocated earlier in time) |
| 0x00320FE4 | -28 | 0xBAADF00D | 0x00000000 | 0xDDDDDDDD | 0x00320448 | Ptr to prev CRT heap block (allocated later in time) |
| 0x00320FE8 | -24 | 0xBAADF00D | 0x00000000 | 0xDDDDDDDD | 0xFEEEFEEE | Filename of malloc() call |
| 0x00320FEC | -20 | 0xBAADF00D | 0x00000000 | 0xDDDDDDDD | 0xFEEEFEEE | Line number of malloc() call |
| 0x00320FF0 | -16 | 0xBAADF00D | 0x00000008 | 0xDDDDDDDD | 0xFEEEFEEE | Number of bytes to malloc() |
| 0x00320FF4 | -12 | 0xBAADF00D | 0x00000001 | 0xDDDDDDDD | 0xFEEEFEEE | Type (0=Freed, 1=Normal, 2=CRT use, etc) |
| 0x00320FF8 | -8 | 0xBAADF00D | 0x00000031 | 0xDDDDDDDD | 0xFEEEFEEE | Request #, increases from 0 |
| 0x00320FFC | -4 | 0xBAADF00D | 0xFDFDFDFD | 0xDDDDDDDD | 0xFEEEFEEE | No mans land |
| 0x00321000 | +0 | 0xBAADF00D | 0xCDCDCDCD | 0xDDDDDDDD | 0xFEEEFEEE | The 8 bytes you wanted |
| 0x00321004 | +4 | 0xBAADF00D | 0xCDCDCDCD | 0xDDDDDDDD | 0xFEEEFEEE | The 8 bytes you wanted |
| 0x00321008 | +8 | 0xBAADF00D | 0xFDFDFDFD | 0xDDDDDDDD | 0xFEEEFEEE | No mans land |
| 0x0032100C | +12 | 0xBAADF00D | 0xBAADF00D | 0xDDDDDDDD | 0xFEEEFEEE | Win32 heap allocations are rounded up to 16 bytes |
| 0x00321010 | +16 | 0xABABABAB | 0xABABABAB | 0xABABABAB | 0xFEEEFEEE | Win32 heap bookkeeping |
| 0x00321014 | +20 | 0xABABABAB | 0xABABABAB | 0xABABABAB | 0xFEEEFEEE | Win32 heap bookkeeping |
| 0x00321018 | +24 | 0x00000010 | 0x00000010 | 0x00000010 | 0xFEEEFEEE | Win32 heap bookkeeping |
| 0x0032101C | +28 | 0x00000000 | 0x00000000 | 0x00000000 | 0xFEEEFEEE | Win32 heap bookkeeping |
| 0x00321020 | +32 | 0x00090051 | 0x00090051 | 0x00090051 | 0xFEEEFEEE | Win32 heap bookkeeping |
| 0x00321024 | +36 | 0xFEEE0400 | 0xFEEE0400 | 0xFEEE0400 | 0xFEEEFEEE | Win32 heap bookkeeping |
| 0x00321028 | +40 | 0x00320400 | 0x00320400 | 0x00320400 | 0xFEEEFEEE | Win32 heap bookkeeping |
| 0x0032102C | +44 | 0x00320400 | 0x00320400 | 0x00320400 | 0xFEEEFEEE | Win32 heap bookkeeping |
SET VS6="C:\Program Files\Microsoft Visual Studio\Common\MSDev98\Bin\MSDEV.EXE" %VS6% test.dsw /MAKE all /OUT log.txt // Visual Studio .NET (aka: Visual Studio .NET 2003) // background building devenv.exe MySolution.sln /build DEBUG // foreground building devenv MySolution.sln /build DEBUG // alternate foreground building devenv.com MySolution.sln /build DEBUG
Unit testing in some cases copies the executable to another directory before running it. There is a way to flag other files in the project so they get copied as well if they are needed at runtime.
Here is more detailed information on this, the page is titled "More VSTS Unit Testing learnings" http://www.agileprogrammer.com/oneagilecoder/archive/2005/06/30/5281.aspx
#include "stdafx.h" to the top of each .cpp file.
An example cygwin bash script can be seen HERE#include "stdafx.h"#include "stdafx.h"Note: Run this from a !! SUBDIRECTORY !! of where the .cpp
files you want to convert are.
#!/usr/bin/bash.exe
files=`(cd ..; ls *.cpp)`
#echo $files
for ITEM in $files
do
echo $ITEM
echo "#include \"stdafx.h\"" > "$ITEM.u"
cat "../$ITEM" >> "$ITEM.u"
u2d < "$ITEM.u" > "$ITEM"
rm "$ITEM.u"
done
| Extension | Deletable | Purpose |
|---|---|---|
| .aps | yes | Binary version of a Resource file. Generated by the resource editor. |
| .idb | yes | Visual Studio minimum rebuild dependancy file |
| .ilk | yes | Visual Studio incremental linker file |
| .ncb | yes | Visual Studio intellisense database |
| .pch | yes | Visual Studio precompiled header file |
| .pdb | yes | Visual Studio "Program debug database" |
What's New in the Visual Studio 2005 Debugger http://msdn2.microsoft.com/en-us/library/01xdt7cs
I used this to find a problem in a dll that was unloaded at the time IE was calling it, during IE shutdown (I was working on an ActiveX project).
crashAddressint x = 0;
if ( x) {
void(*pf)(void) = (void(*)(void))crashAddress;
pf();
}
if ( x) {Use the toolbar control for find in file, type in a command like this: >open {filename}
and yes you must type the >
| Window'd | Console'd | |
|---|---|---|
| C/C++ : General : Preprocessor definitions | _WINDOWS | _CONSOLE |
| Link options is box at bottom | /subsystem:windows | /subsystem:console |
GlobalSection(SourceCodeControl)| Warning | Information |
|---|---|
| LNK2005 | Example: Solution: Make sure the correct libraries are being used. In the case shown, I was using Multi-Threaded(/MT) in the test program and using Multi-Threaded DLL (/MD) in the libraries it was using.Find the setting here: Solution Explorer | Properties | C/C++ | Code Generation | Runtime Library |
| LNK4098 |
Example: default 'LIBC' conflicts with use of other libs Solution: Add to the Additional Options text field options like this /NODEFAULTLIB:libc.lib look here for what to actually addFind the setting here: Solution Explorer | Properties | Linker | Command Line |
| Projects Mode | Libraries to ignore with /NODEFAULTLIB: |
|---|---|
| Single-threaded (libc.lib) | libcmt.lib, msvcrt.lib, libcd.lib, libcmtd.lib, msvcrtd.lib |
| Multithreaded (libcmt.lib) | libc.lib, msvcrt.lib, libcd.lib, libcmtd.lib, msvcrtd.lib |
| Multithreaded using DLL (msvcrt.lib) | /NODEFAULTLIB:libc.lib /NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:libcd.lib /NODEFAULTLIB:libcmtd.lib /NODEFAULTLIB:msvcrtd.lib |
| Debug Single-threaded (libcd.lib) | libc.lib, libcmt.lib, msvcrt.lib, libcmtd.lib, msvcrtd.lib |
| Debug Multithreaded (libcmtd.lib) | libc.lib, libcmt.lib, msvcrt.lib, libcd.lib, msvcrtd.lib |
| Debug Multithreaded using DLL (msvcrtd.lib) | /NODEFAULTLIB:libc.lib /NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:libcd.lib /NODEFAULTLIB:libcmtd.lib |
( )[ ]{ }#if#else#endif< >Note: The values are reread every time the debugger is restarted.
# operator new() operator new=NoStepInto # It was impossible to stop it from debugging into: # FXString& FXString::operator+=(const FXchar* s) # until I did this: .*FXString.*=NoStepInto
| What to Avoid | Value |
|---|---|
new | operator new=nostepinto |
std:: (namespace) | std\:\:.*=NoStepInto |
| MyNameSpace::MyClass | MyNameSpace\:\:MyClass\:\:*=NoStepInto |
Note: I haven't been able to figure out how/if 'scope' works sg_String:: (class) | \\scope:sg_String\\:\\:.*=NoStepInto |
Things can be turned back on as well, by using StepInto. Since higher numbered rules happen last you can disable stepping into all of a class except what you set to 'StepInto' in a higher numbered rule.
Don't go into new in Visual Studio.NET 2002. Use this .reg file:
Which creates the following (or you can do this by hand)
Or change the 7.0 to 7.1 for Visual Studio.NET 2003
[ExecutionControl]| Function=NoStepInto | Avoid stepping into this specific function |
| Classname::Method=NoStepInto | Avoid stepping into the specific method of this class |
| Classname::*=NoStepInto | Avoid stepping into any of the methods of this class |
[ExecutionControl]
CString::CString=NoStepInto
CString::~CString=NoStepInto
CString::operator==NoStepInto
Use depends.exe it get it as part of
Windows XP Service Pack 2 Support Tools
Use Debug | Exceptions to modify the exception processing behavior
| General | Output Directory | .\..\..\root\usr\lib\ntx86debug |
| General | Intermediate Directory | .\..\..\arch\ntx86debug\obj\$(ProjectName) |
| Linker | General | Output File | .\..\..\root\bin\ntx86debug\$(InputName).dll |
| Linker | Debug | Generate Program Database File | .\..\..\root\bin\ntx86debug\$(InputName).pdb |
| Linker | Advanced | Import Library | .\..\..\root\usr\lib\ntx86debug\$(InputName).lib |
| Specifier | Format | Value | Displays |
|---|---|---|---|
| d,i | signed decimal integer | 0xF000F065 | -268373915 |
| u | unsigned decimal integer | 0x0065 | 101 |
| o | unsigned octal integer | 0xF065 | 0170145 |
| x,X | Hexadecimal integer | 61541 (decimal) | 0x0000F065 |
| l,h | long or short prefix for: d, i, u, o, x, X | 00406042,hx | 0x0c22 |
| f | signed floating point | 3./2. | 1.500000 |
| e | signed scientific notation | 3./2. | 1.500000e+000 |
| g | signed floating point or signed scientific notation, whichever is shorter | 3./2. | 1.5 |
| c | Single character | 0x0065 | 101 'e' |
| s | String | 0x0012fde8 | "Hello world" |
| su | Unicode string | "Hello world" | |
| hr | HRESULT or Win32 error code. (The debugger now decodes HRESULTs automatically, so this specifier is not required in those cases. It is not possible to decode HRESULTs if you compile with /noHRESULT). | 0x00000000L | S_OK |
| wc | Window class flag. | 0x00000040 | WC_DEFAULTCHAR |
| wm | Windows message numbers | 0x0010 | WM_CLOSE |
| Symbol | Format | Displays |
|---|---|---|
| ma | 64 ASCII characters | 0x0012ffac .4...0...".0W&.......1W&.0.:W..1...."..1.JO&.1.2.."..1...0y....1 |
| m | 16 bytes in hexadecimal, followed by 16 ASCII characters | 0x0012ffac B3 34 CB 00 84 30 94 80 FF 22 8A 30 57 26 00 00 .4...0...".0W&.. |
| mb | 16 bytes in hexadecimal, followed by 16 ASCII characters | 0x0012ffac B3 34 CB 00 84 30 94 80 FF 22 8A 30 57 26 00 00 .4...0...".0W&.. |
| mw | 8 words | 0x0012ffac 34B3 00CB 3084 8094 22FF 308A 2657 0000 |
| md | 4 doublewords | 0x0012ffac 00CB34B3 80943084 308A22FF 00002657 |
| mq | 2 quadwords | 0x0012ffac 7ffdf00000000000 5f441a790012fdd4 |
| mu | 2-byte characters (Unicode) | 0x0012fc60 8478 77f4 ffff ffff 0000 0000 0000 0000 |
pMem,10 // shows it as an array of 10 elements
pMem,100m // shows it as an array of 100 elements in memory dump format
Note: The file is reread every time the debugger is restarted.
Modify the autoexp.dat file as shown HERE
| App | Default Location |
|---|---|
| Visual Studio.NET also known as VS8.0 | C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Packages\Debugger |
; These must go in the [AutoExpand] section of the file
[AutoExpand]
NameSpaceHere::ClassnameHere =DescToShow=<field.subfield>
; the above makes the value display like the followning:
; 0x12345678 DescToShow={value at field.subfield}
{ Tools | Customize | Toolbars }Visio will work from Visual Studio
tags to "Lowercase"Seems to only happen when there are connection points in the COM dll
It seems to keep the COM dll open when it builds the InteropFile
To make things work, add a custom build step to the COM dll (at midl compile time, or at the end of everything), that does this:
tlbimp ../../root/usr/lib/%ARCHM%/$(InputName).tlb /out:../../root/usr/lib/%ARCHM%/Interop.$(InputName).dll
And in the .NET project add a Reference to the Interop.{name}.dll that is created in the custom build step above.