Initial commit
This commit is contained in:
20
TBE/MinGW/doc/drmingw/samples/exchndl2.cxx
Normal file
20
TBE/MinGW/doc/drmingw/samples/exchndl2.cxx
Normal file
@@ -0,0 +1,20 @@
|
||||
/* exchndl2.cxx
|
||||
*
|
||||
* A portable way to load the EXCHNDL.DLL on startup.
|
||||
*
|
||||
* Jose Fonseca
|
||||
*/
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
class ExceptionHandler
|
||||
{
|
||||
public:
|
||||
|
||||
ExceptionHandler()
|
||||
{
|
||||
LoadLibrary("exchndl.dll");
|
||||
}
|
||||
};
|
||||
|
||||
static ExceptionHandler gExceptionHandler; // global instance of class
|
||||
44
TBE/MinGW/doc/drmingw/samples/test.c
Normal file
44
TBE/MinGW/doc/drmingw/samples/test.c
Normal file
@@ -0,0 +1,44 @@
|
||||
/* test-c.c
|
||||
*
|
||||
* A sample C program to demonstrate the symbolic capabilities
|
||||
* of Dr.MinGW.
|
||||
*
|
||||
* Jose Fonseca
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
void YetAnotherFunction(int i)
|
||||
{
|
||||
int k;
|
||||
|
||||
#if 0
|
||||
/* Other ways to cause a GPF */
|
||||
*(int *)i = 5;
|
||||
__asm ("int $3");
|
||||
(*((void (*)(void)) 0x12345678))();
|
||||
#endif
|
||||
sscanf("12345", "%i", (int *) (k=i));
|
||||
}
|
||||
|
||||
struct AStructType
|
||||
{
|
||||
int AnArray[2];
|
||||
};
|
||||
|
||||
void MyWonderfulFunction(int AnInteger, double ADouble, int AnArray[4], char * AString, enum {a,b,c} AnEnum, struct AStructType AStruct, void (*AFunction)(void))
|
||||
{
|
||||
YetAnotherFunction( 8 );
|
||||
}
|
||||
|
||||
void ASimpleFunction(void) {}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
struct AStructType AStruct = {{10, 3}};
|
||||
int AnArray[4] = {4,3,2,1};
|
||||
|
||||
MyWonderfulFunction( 4, 5.6, AnArray, "Hello" , 1, AStruct, ASimpleFunction);
|
||||
|
||||
return 0;
|
||||
}
|
||||
BIN
TBE/MinGW/doc/drmingw/samples/test.exe
Normal file
BIN
TBE/MinGW/doc/drmingw/samples/test.exe
Normal file
Binary file not shown.
36
TBE/MinGW/doc/drmingw/samples/testcpp.cxx
Normal file
36
TBE/MinGW/doc/drmingw/samples/testcpp.cxx
Normal file
@@ -0,0 +1,36 @@
|
||||
/* test-c.c
|
||||
*
|
||||
* A sample C++ program to test Dr.MinGW.
|
||||
*
|
||||
* Jose Fonseca
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
typedef char * cp;
|
||||
|
||||
void YetAnotherFunction( int i, double j, char * pszString )
|
||||
{
|
||||
int k;
|
||||
|
||||
#if 0
|
||||
/* Other ways to cause a GPF */
|
||||
*(int *)i = 5;
|
||||
__asm ("int $3");
|
||||
(*((void (*)(void)) 0x12345678))();
|
||||
#endif
|
||||
|
||||
sscanf("12345", "%i", (int *) (k=i));
|
||||
}
|
||||
|
||||
void MyWonderfulFunction( int i, float j )
|
||||
{
|
||||
YetAnotherFunction( i * 2, j, "Hello" );
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
MyWonderfulFunction( 4, float(5.6) );
|
||||
|
||||
return 0;
|
||||
}
|
||||
BIN
TBE/MinGW/doc/drmingw/samples/testcpp.exe
Normal file
BIN
TBE/MinGW/doc/drmingw/samples/testcpp.exe
Normal file
Binary file not shown.
Reference in New Issue
Block a user