feat: Add Visual Studio 2022 VC++ project for C debugging
- Create complete VS2022 solution with 3 projects: * V2GDecoder: Main EXI decoder with debugging support * HexToBinary: Hex string to binary utility * HexDumpToBinary: Hex dump to binary utility - Copy all source files locally for Windows compilation: * Added Windows compatibility for unistd.h, fstat, S_ISREG * Fixed VLA issues in EncoderChannel.c with macro definitions * Include all required modules: codec, iso1, iso2, din, appHandshake - Build configuration: * Support Debug/Release x86/x64 configurations * Proper include directories and preprocessor definitions * Windows-specific compiler flags (_WIN32, __STDC_NO_VLA__) - Verification: * Both test4.exi and test5.exi decode/encode perfectly * 100% binary compatibility: original ↔ XML ↔ reencoded * Ready for step-by-step debugging in Visual Studio 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
97
csharp/vc2022/README.md
Normal file
97
csharp/vc2022/README.md
Normal file
@@ -0,0 +1,97 @@
|
||||
# V2G EXI Decoder - Visual Studio 2022 VC++ Project
|
||||
|
||||
## 개요
|
||||
OpenV2G EXI 디코더를 Visual Studio 2022 Professional에서 디버깅할 수 있도록 VC++ 프로젝트로 변환한 버전입니다.
|
||||
|
||||
## 프로젝트 구조
|
||||
|
||||
### 솔루션: `V2GDecoderC.sln`
|
||||
- **V2GDecoder**: 메인 EXI 디코더 애플리케이션
|
||||
- **HexToBinary**: 16진수 문자열을 바이너리로 변환하는 유틸리티
|
||||
- **HexDumpToBinary**: 16진수 덤프를 바이너리로 변환하는 유틸리티
|
||||
|
||||
### 빌드 설정
|
||||
- **플랫폼**: Win32 (x86), x64
|
||||
- **구성**: Debug, Release
|
||||
- **컴파일러**: MSVC v143 (Visual Studio 2022)
|
||||
- **언어**: Pure C (C++이 아님)
|
||||
- **출력 디렉토리**: `bin/{Platform}/{Configuration}/`
|
||||
|
||||
### 소스 파일 구성
|
||||
#### codec/ (EXI 코덱 핵심)
|
||||
- BitInputStream.c/h - 비트 스트림 입력
|
||||
- BitOutputStream.c/h - 비트 스트림 출력
|
||||
- DecoderChannel.c/h - 디코더 채널
|
||||
- EncoderChannel.c/h - 인코더 채널
|
||||
- EXIHeaderDecoder.c/h - EXI 헤더 디코더
|
||||
- 기타 EXI 관련 파일들
|
||||
|
||||
#### iso1/ (ISO 15118-1 구현)
|
||||
- iso1EXIDatatypes.c/h - ISO1 EXI 데이터 타입
|
||||
- iso1EXIDatatypesDecoder.c/h - ISO1 EXI 디코더
|
||||
- iso1EXIDatatypesEncoder.c/h - ISO1 EXI 인코더
|
||||
|
||||
#### appHandshake/ (애플리케이션 핸드셰이크)
|
||||
- appHandEXIDatatypes.c/h - 핸드셰이크 데이터 타입
|
||||
- appHandEXIDatatypesDecoder.c/h - 핸드셰이크 디코더
|
||||
- appHandEXIDatatypesEncoder.c/h - 핸드셰이크 인코더
|
||||
|
||||
## Visual Studio에서 사용하기
|
||||
|
||||
### 1. 프로젝트 열기
|
||||
```
|
||||
파일 -> 열기 -> 프로젝트/솔루션 -> V2GDecoderC.sln 선택
|
||||
```
|
||||
|
||||
### 2. 빌드하기
|
||||
- **Debug x64** 구성을 권장 (완전한 디버깅 정보 포함)
|
||||
- 빌드 -> 솔루션 빌드 (Ctrl+Shift+B)
|
||||
|
||||
### 3. 디버깅하기
|
||||
- V2GDecoder 프로젝트를 시작 프로젝트로 설정
|
||||
- F5로 디버깅 시작
|
||||
- 중단점 설정하여 단계별 디버깅 가능
|
||||
|
||||
### 4. 커맨드 라인 인수 설정
|
||||
프로젝트 속성 -> 디버깅 -> 명령 인수에서 테스트 파일 지정:
|
||||
```
|
||||
../../test4.exi
|
||||
```
|
||||
|
||||
## 장점
|
||||
|
||||
### 🔍 강력한 디버깅 기능
|
||||
- **중단점**: 모든 C 소스 라인에 중단점 설정 가능
|
||||
- **단계별 실행**: F10 (Step Over), F11 (Step Into)
|
||||
- **변수 조사**: 지역 변수, 감시 창에서 실시간 변수 값 확인
|
||||
- **호출 스택**: 함수 호출 경로 추적
|
||||
- **메모리 뷰**: 원시 메모리 내용 확인
|
||||
|
||||
### 📊 코드 분석 도구
|
||||
- **IntelliSense**: 코드 완성, 함수 시그니처 힌트
|
||||
- **정의로 이동**: F12로 함수/변수 정의 위치로 이동
|
||||
- **참조 찾기**: 함수/변수 사용 위치 검색
|
||||
- **오류 목록**: 컴파일 오류/경고 실시간 표시
|
||||
|
||||
### 🚀 .NET 포팅 지원
|
||||
- C 코드 로직을 단계별로 분석하여 C#/.NET으로 포팅 가능
|
||||
- 메모리 레이아웃, 비트 조작 등 저수준 동작 확인
|
||||
- 함수별 입출력 값 확인으로 테스트 케이스 생성
|
||||
|
||||
## 테스트 파일
|
||||
- `test4.exi` - 43바이트 CurrentDemandReq 메시지
|
||||
- `test5.exi` - 43바이트 CurrentDemandReq 메시지 (다른 값)
|
||||
|
||||
## 원본 GCC 빌드와의 호환성
|
||||
- 동일한 소스 파일 사용
|
||||
- 동일한 헤더 파일 포함 경로
|
||||
- 동일한 전처리기 정의
|
||||
- Windows에서 POSIX 호환성 유지
|
||||
|
||||
## 사용 예시
|
||||
```bash
|
||||
# Visual Studio에서 빌드 후
|
||||
bin/x64/Debug/V2GDecoder.exe ../../test4.exi
|
||||
```
|
||||
|
||||
이제 Visual Studio 2022의 강력한 디버깅 기능을 활용하여 OpenV2G EXI 디코더를 분석하고 .NET 포팅 작업을 효율적으로 수행할 수 있습니다.
|
||||
Reference in New Issue
Block a user