See if I missed something from this writeup.
]]>So first thanks Gator for his help.
Then because I spend a lot (too much ??) time to do it. Here the instruction which worked for me.
So as Gator said, I first install everything normally :
- Proxspace
- Vs Code
Then install the C/C++ plug-in.
For the include you can define the vscode c config file like this:
(I just added : "${workspaceFolder}/include")
{
"configurations": [
{
"name": "Win32",
"includePath": [
"${workspaceFolder}/**",
"${workspaceFolder}/include"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"compilerPath": "C:\\cygwin64\\bin\\clang-5.0.exe",
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "clang-x64"
}
],
"version": 4
}
Once installed you'll need to install gdb (I struggled because you must not install the latest version):
pacman -S mingw-w64-x86_64-gdb 7.10-1 http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-gdb-7.10-1-any.pkg.tar.xz
And then you just need to create the launch.json (here mine).
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/client/proxmark3",
"args": ["com 9"],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": true,
"MIMode": "gdb",
"miDebuggerPath": "PATH\\TO\\WHICH\\SHOULD\\FINISH\\WITH\\msys2\\mingw64\\bin\\gdb.exe",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
]
}
don't forget to change the Makefile (client one) (as I said above)
CC = gcc -g
CXX = g++ -g
LD = g++ -g
Put your breakpoints and let the magic begins
]]>You're right doing everything in windows is overkill (for nothing ).
So compiling through Proxspace and using VS code is pretty convenient . (just a small set up for the dependencies is needed)
However do you have achieved to use the debug mode ?
I have change the MakeFile (from client)
(I have tried to put -g DDEBUG)
CC = gcc -g -DDEBUG
CXX = g++ -g -DDEBUG
LD = g++ -g -DDEBUG
However it I cannot make it stop on a break point and it doesn't really start.
You might have gone through the process ?
Loaded 'C:\Windows\System32\advapi32.dll'. Cannot find or open the PDB file.
Loaded 'C:\Windows\System32\msvcrt.dll'. Cannot find or open the PDB file.
Loaded 'C:\Windows\System32\sechost.dll'. Cannot find or open the PDB file.
Loaded 'C:\Windows\System32\rpcrt4.dll'. Cannot find or open the PDB file.
Loaded 'C:\Windows\System32\user32.dll'. Cannot find or open the PDB file.
Loaded 'C:\Windows\System32\win32u.dll'. Cannot find or open the PDB file.
Loaded 'C:\Windows\System32\gdi32.dll'. Cannot find or open the PDB file.
Loaded 'C:\Windows\System32\gdi32full.dll'. Cannot find or open the PDB file.
Loaded 'C:\Windows\System32\msvcp_win.dll'. Cannot find or open the PDB file.
Loaded 'C:\Windows\System32\ucrtbase.dll'. Cannot find or open the PDB file.
The thread 23740 has exited with code -1073741515 (0xc0000135).
The thread 25040 has exited with code -1073741515 (0xc0000135).
The program '[16712] proxmark3.exe' has exited with code -1073741515 (0xc0000135).
Thanks a lot for your help
]]>You need the mingw environment that msys2 provides in order to compile. Compiling in the Windows cmd does not work(Windows 10 has a ubuntu based bash shell that could work).
I use Visual Studio Code as IDE and have ProxSpace compile it for me.
]]>It has been a week that I'm trying to set up and IDE to compile, run (and maybe debug) the code.
I'm not really knowledgeable in C (I'm more into C# and Java).
So I tried with Eclipse and Visual Studio.
So far It doesn't compile
What I have done so far,
Installed Proxspace, make the code compile within flash the proxmarks test the code.
Did some changes, compiled and flashed again. And magic saw the changes.
The above has been done with Sublime Text. However I can't see myself working just with Sublime Text in 2019 .
I'm sure using an IDE could help tons to develop and understand the code faster.
So I have used (I'm still trying to understand it) Proxspace project. I put into my PATH, the libraries downloaded by this project and tried to compile outside of Proxspace (in cmd prompt and Eclipse)
And here I'm stuck, compilation starts but fails :
gcc -shared -o lua52.dll lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o lundump.o lvm.o lzio.o lauxlib.o lbaselib.o lbitlib.o lcorolib.o ldblib.o liolib.o lmathlib.o loslib.o lstrlib.o ltablib.o loadlib.o linit.o
strip --strip-unneeded lua52.dll
gcc -o lua.exe -s lua.o lua52.dll -lm
lua.o:lua.c:(.text+0x82): undefined reference to `__imp_lua_gettop'
...
lua.o:lua.c:(.text.startup+0x101): undefined reference to `__imp_lua_tolstring'
collect2.exe: error: ld returned 1 exit status
make[3]: *** [lua.exe] Error 1
make[3]: Leaving directory `/c/Users/Ayuda/Documents/GitHub/pm3Matt/liblua'
I suspect Qt5 (but not sure).
So I have 2 questions,
Does anyone use an IDE and could help me to configure mine ?
Does anyone is able to pin point the part of ProxSpace's code which start the download of all the dependencies ( I couldn't find it )
I mean this
Following tools will be automatically download:
gcc
Qt5
readline
git
perl
pkg-config
Thanks peeps
]]>