Commit 6ccc20cc authored by Matthias Braun's avatar Matthias Braun
Browse files

Remove msvc support stuff

As of the switch to C99 libfirm uses too many features that are not
supported by microsoft visual c and I don't see any hope to support it
again.
Windows users can still switch to a gcc based toolchain (cygwin or msys)
or may have better luck with a proper C99 compiler (clang, icc, future
versions of msvc?)
parent 97df3ae6
This diff is collapsed.
/*
* Firm - Evaluator
*
* (C) 2005 Michael Beck beck@ipd.info.uni-karlsruhe.de
*/
#include <windows.h>
#include <stdio.h>
#include <malloc.h>
#include <tchar.h>
#include "firm.h"
#include "firmEvaluator.h"
/**
* Get the initial address. As the interface allows only 32 bit
* transmitted, new I/F must be asked for 64bit support.
*/
static void *GetInitialAddress(DWORD dwAddress, DEBUGHELPER *pHelper)
{
if (pHelper->dwVersion < 0x20000) {
/* VC 6.0 access */
return (void *)dwAddress;
} else {
/* VC 7.0+ access */
return (void *)pHelper->GetRealAddress(pHelper);
}
}
/**
* Copy from debuggee.
*/
HRESULT copy_from_debuggee(const void *address, DEBUGHELPER *pHelper, void *dst, DWORD size)
{
DWORD nGot;
if (pHelper->dwVersion < 0x20000) {
/* VC 6.0 access */
if (pHelper->ReadDebuggeeMemory(pHelper, (DWORD)address, size, dst, &nGot) != S_OK)
return E_FAIL;
if (nGot != size)
return E_FAIL;
} else {
/* VC 7.0+ access */
if (pHelper->ReadDebuggeeMemoryEx(pHelper, (DWORDLONG)address, size, dst, &nGot) != S_OK)
return E_FAIL;
if (nGot != size)
return E_FAIL;
}
return S_OK;
}
/**
* Evaluate an firm * object
*/
HRESULT WINAPI firm_Evaluate(DWORD dwAddress, DEBUGHELPER *pHelper, int nBase, BOOL bUniStrings, char *pResult, size_t max, DWORD reserved )
{
firm_kind kind;
void *address = GetInitialAddress(dwAddress, pHelper);
if (address == NULL) {
_tcsncpy(pResult, "NULL", max);
return S_OK;
}
if (copy_from_debuggee(address, pHelper, &kind, sizeof(kind)) != S_OK)
return E_FAIL;
return FormatFirmObject(pHelper, nBase, kind, address, pResult, max);
}
/**
* Evaluate an ident * object
*/
HRESULT WINAPI firm_ident_Evaluate(DWORD dwAddress, DEBUGHELPER *pHelper, int nBase, BOOL bUniStrings, char *pResult, size_t max, DWORD reserved )
{
char *data = NULL;
void *address = GetInitialAddress(dwAddress, pHelper);
if (address == NULL) {
_tcsncpy(pResult, "NULL", max);
return S_OK;
}
return format_ident(pHelper, address, pResult, max);
}
/**
* Evaluate a pset * object
*/
HRESULT WINAPI firm_pset_Evaluate(DWORD dwAddress, DEBUGHELPER *pHelper, int nBase, BOOL bUniStrings, char *pResult, size_t max, DWORD reserved )
{
char *data = NULL;
void *address = GetInitialAddress(dwAddress, pHelper);
if (address == NULL) {
_tcsncpy(pResult, "NULL", max);
return S_OK;
}
return format_pset(pHelper, nBase, address, pResult, max);
}
/**
* Evaluate a set * object
*/
HRESULT WINAPI firm_set_Evaluate(DWORD dwAddress, DEBUGHELPER *pHelper, int nBase, BOOL bUniStrings, char *pResult, size_t max, DWORD reserved )
{
char *data = NULL;
void *address = GetInitialAddress(dwAddress, pHelper);
if (address == 0) {
_tcsncpy(pResult, "NULL", max);
return S_OK;
}
return format_set(pHelper, nBase, address, pResult, max);
}
/**
* Evaluate a _arr_descr * object
*/
HRESULT WINAPI firm_arr_Evaluate(DWORD dwAddress, DEBUGHELPER *pHelper, int nBase, BOOL bUniStrings, char *pResult, size_t max, DWORD reserved )
{
char *data = NULL;
void *address = GetInitialAddress(dwAddress, pHelper);
if (address == NULL) {
_tcsncpy(pResult, "NULL", max);
return S_OK;
}
return format_arr_descr(pHelper, nBase, address, pResult, max);
}
/**
* Evaluate a pdeq * object
*/
HRESULT WINAPI firm_pdeq_Evaluate(DWORD dwAddress, DEBUGHELPER *pHelper, int nBase, BOOL bUniStrings, char *pResult, size_t max, DWORD reserved )
{
char *data = NULL;
void *address = GetInitialAddress(dwAddress, pHelper);
if (address == 0) {
_tcsncpy(pResult, "NULL", max);
return S_OK;
}
return format_pdeq(pHelper, nBase, address, pResult, max);
}
/**
* Evaluate a bitset_t * object
*/
HRESULT WINAPI firm_bitset_Evaluate(DWORD dwAddress, DEBUGHELPER *pHelper, int nBase, BOOL bUniStrings, char *pResult, size_t max, DWORD reserved )
{
char *data = NULL;
void *address = GetInitialAddress(dwAddress, pHelper);
if (address == 0) {
_tcsncpy(pResult, "NULL", max);
return S_OK;
}
return format_bitset(pHelper, nBase, address, pResult, max);
}
/**
* Evaluate a ir_op
*/
HRESULT WINAPI firm_op_Evaluate(DWORD dwAddress, DEBUGHELPER *pHelper, int nBase, BOOL bUniStrings, char *pResult, size_t max, DWORD reserved )
{
char *data = NULL;
void *address = GetInitialAddress(dwAddress, pHelper);
if (address == 0) {
_tcsncpy(pResult, "NULL", max);
return S_OK;
}
return format_op(pHelper, address, pResult, max);
}
LIBRARY firmEvaluator
EXPORTS
firm_Evaluate @1
firm_ident_Evaluate @2
firm_pset_Evaluate @3
firm_set_Evaluate @4
firm_arr_Evaluate @5
firm_pdeq_Evaluate @6
firm_bitset_Evaluate @7
firm_op_Evaluate @8
\ No newline at end of file
/*
* Firm - Evaluator
*
* (C) 2005 Michael Beck beck@ipd.info.uni-karlsruhe.de
*/
#ifndef __FIRM_EVALUATOR_H__
#define __FIRM_EVALUATOR_H__
typedef struct tagDEBUGHELPER {
DWORD dwVersion;
BOOL (WINAPI *ReadDebuggeeMemory)( struct tagDEBUGHELPER *pThis, DWORD dwAddr, DWORD nWant, VOID* pWhere, DWORD *nGot );
/* from here only when dwVersion >= 0x20000 */
DWORDLONG (WINAPI *GetRealAddress)( struct tagDEBUGHELPER *pThis );
BOOL (WINAPI *ReadDebuggeeMemoryEx)( struct tagDEBUGHELPER *pThis, DWORDLONG qwAddr, DWORD nWant, VOID* pWhere, DWORD *nGot );
int (WINAPI *GetProcessorType)( struct tagDEBUGHELPER *pThis );
} DEBUGHELPER;
typedef HRESULT (WINAPI *CUSTOMVIEWER)( void *address, DEBUGHELPER *pHelper, int nBase, BOOL bUniStrings, char *pResult, size_t max, DWORD reserved );
/**
* Copy from debuggee
*
* @param address address in debuggee's space to copy from
* @param pHelper debugger helper
* @param dst pointer in our space to copy to
* @param size number of bytes to copy
*/
HRESULT copy_from_debuggee(const void *address, DEBUGHELPER *pHelper, void *dst, DWORD size);
/**
* Format an ident
*
* @param pHelper debugger helper
* @param address ident address in debuggee's space
* @param pResult string buffer
* @param max length of the string buffer
*/
HRESULT format_ident(DEBUGHELPER *pHelper, const void *address, char *pResult, size_t max);
/**
* Format an ir_op
*
* @param pHelper debugger helper
* @param address ident address in debuggee's space
* @param pResult string buffer
* @param max length of the string buffer
*/
HRESULT format_op(DEBUGHELPER *pHelper, const void *address, char *pResult, size_t max);
/**
* Format a pset
*
* @param pHelper debugger helper
* @param nBase base for number's
* @param address pset address in debuggee's space
* @param pResult string buffer
* @param max length of the string buffer
*/
HRESULT format_pset(DEBUGHELPER *pHelper, int nBase, const void *address, char *pResult, size_t max);
/**
* Format a set
*
* @param pHelper debugger helper
* @param nBase base for number's
* @param address set address in debuggee's space
* @param pResult string buffer
* @param max length of the string buffer
*/
HRESULT format_set(DEBUGHELPER *pHelper, int nBase, const void *address, char *pResult, size_t max);
/**
* Format an array descriptor
*
* @param pHelper debugger helper
* @param nBase base for number's
* @param address array descriptor address in debuggee's space
* @param pResult string buffer
* @param max length of the string buffer
*/
HRESULT format_arr_descr(DEBUGHELPER *pHelper, int nBase, const void *address, char *pResult, size_t max);
/**
* Format a pointer double ended queue
*
* @param pHelper debugger helper
* @param nBase base for number's
* @param address pdeq address in debuggee's space
* @param pResult string buffer
* @param max length of the string buffer
*/
HRESULT format_pdeq(DEBUGHELPER *pHelper, int nBase, const void *address, char *pResult, size_t max);
/*
* Format a bitset
*
* @param pHelper debugger helper
* @param nBase base for number's
* @param address bitset address in debuggee's space
* @param pResult string buffer
* @param max length of the string buffer
*/
HRESULT format_bitset(DEBUGHELPER *pHelper, int nBase, const void *address, char *pResult, size_t max);
/**
* format a firm object
*
* @param pHelper debugger helper
* @param nBase base for number's
* @param kind Firm kind
* @param address firm object address in debuggee's space
* @param pResult string buffer
* @param max length of the string buffer
*/
HRESULT FormatFirmObject(DEBUGHELPER *pHelper, int nBase, firm_kind kind, const void *address, char *pResult, size_t max);
#endif /* __FIRM_EVALUATOR_H__ */
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// German (Germany) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DEU)
#ifdef _WIN32
LANGUAGE LANG_GERMAN, SUBLANG_GERMAN
#pragma code_page(1252)
#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,18,1,34
PRODUCTVERSION 1,18,1,34
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x21L
#else
FILEFLAGS 0x20L
#endif
FILEOS 0x40004L
FILETYPE 0x2L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "CompanyName", "Michael Beck"
VALUE "FileDescription", "firmEvaluator -- libFirm debug Extension for Developer Studio 6/7/8/9"
VALUE "FileVersion", "1, 18, 1, 34"
VALUE "InternalName", "firmEvaluator"
VALUE "LegalCopyright", "Copyright 2005-2011 Michael Beck"
VALUE "OriginalFilename", "firmEvaluator.dll"
VALUE "ProductName", "firmEvaluator -- libFirm debug Extension for Developer Studio 6/7/8/9"
VALUE "ProductVersion", "1, 18, 1, 34"
VALUE "SpecialBuild", "Licensed for IPD Goos"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
#endif // German (Germany) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by firmEvaluator.rc
//
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 101
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1000
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8,00"
Name="firmEvaluator"
ProjectGUID="{9B050404-3CC0-4A38-BD98-BAB3189C0CDC}"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Release|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="true"
SuppressStartupBanner="true"
TargetEnvironment="1"
TypeLibraryName="d:\work\firmevaluator\Release/firmEvaluator.tlb"
HeaderFileName=""
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="../../../include/libfirm;../../../include/libfirm/adt;../../../obstack;../../../ir/adt;../../../ir/ana;../../../ir/common;../../../ir/debug;../../../ir/ident;../../../ir/ir;../../../ir/opt;../../../ir/st;../../../ir/stat;../../../ir/tr;../../../ir/tv;../../../ir/arch;../../../ir/lower;../../../ir/libcore;../../../win32;../../../ir"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;FIRMEVALUATOR_EXPORTS;_CRT_SECURE_NO_WARNINGS;inline=_inline"
StringPooling="true"
RuntimeLibrary="0"
EnableFunctionLevelLinking="true"
PrecompiledHeaderFile="./Release/firmEvaluator.pch"
AssemblerListingLocation="$(IntDir)\"
ObjectFile="$(IntDir)\"
ProgramDataBaseFileName="$(IntDir)\"
WarningLevel="3"
SuppressStartupBanner="true"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1031"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="winmm.lib"
OutputFile="Release/firmEvaluator.dll"
LinkIncremental="1"
SuppressStartupBanner="true"
ModuleDefinitionFile="../firmEvaluator.def"
ProgramDatabaseFile="$(OutDir)/firmEvaluator.pdb"
ImportLibrary="$(OutDir)/firmEvaluator.lib"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
SuppressStartupBanner="true"
OutputFile="d:\work\firmevaluator\Release/firmEvaluator.bsc"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="true"
SuppressStartupBanner="true"
TargetEnvironment="1"
TypeLibraryName="d:\work\firmevaluator\Debug/firmEvaluator.tlb"
HeaderFileName=""
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../../../include/libfirm;../../../include/libfirm/adt;../../../obstack;../../../ir/adt;../../../ir/ana;../../../ir/common;../../../ir/debug;../../../ir/ident;../../../ir/ir;../../../ir/opt;../../../ir/st;../../../ir/stat;../../../ir/tr;../../../ir/tv;../../../ir/arch;../../../ir/lower;../../../ir/libcore;../../../win32;../../../ir"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;FIRMEVALUATOR_EXPORTS;_CRT_SECURE_NO_WARNINGS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
PrecompiledHeaderFile="d:\work\firmevaluator\Debug/firmEvaluator.pch"
AssemblerListingLocation="d:\work\firmevaluator\Debug/"
ObjectFile="d:\work\firmevaluator\Debug/"
ProgramDataBaseFileName="d:\work\firmevaluator\Debug/"
WarningLevel="3"
SuppressStartupBanner="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1031"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="winmm.lib"
OutputFile="Debug/firmEvaluator.dll"
LinkIncremental="2"
SuppressStartupBanner="true"
ModuleDefinitionFile="../firmEvaluator.def"
GenerateDebugInformation="true"
ProgramDatabaseFile="d:\work\firmevaluator\Debug/firmEvaluator.pdb"
ImportLibrary="d:\work\firmevaluator\Debug/firmEvaluator.lib"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"