singrdk/base/build/dbg.cmd

77 lines
1.8 KiB
Batchfile
Raw Permalink Normal View History

2008-03-05 09:52:00 -05:00
@echo off
setlocal
2008-11-17 18:29:00 -05:00
set scr="g"
2008-03-05 09:52:00 -05:00
2008-11-17 18:29:00 -05:00
:parse
set arg=%1
if /I "%1" == "" (
rem done
) else if /I .%arg%==./1394 (
2008-03-05 09:52:00 -05:00
set ConnectArgs=1394:channel=0
shift
2008-11-17 18:29:00 -05:00
goto parse
) else if /I .%arg%==./com1 (
2008-03-05 09:52:00 -05:00
set ConnectArgs=com:port=\\.\com1,baud=115200
shift
2008-11-17 18:29:00 -05:00
goto parse
) else if /I .%arg%==./com2 (
2008-03-05 09:52:00 -05:00
set ConnectArgs=com:port=\\.\com2,baud=115200
shift
2008-11-17 18:29:00 -05:00
goto parse
) else if /I .%arg%==./com3 (
set ConnectArgs=com:port=\\.\com3,baud=115200
shift
goto parse
) else if /I .%arg%==./pipe (
2008-03-05 09:52:00 -05:00
set ConnectArgs=com:pipe,port=\\.\pipe\kd,resets=0,reconnect
shift
2008-11-17 18:29:00 -05:00
goto parse
) else if /I .%arg%==./f (
set scr="sxe vcpp;g"
shift
goto parse
2008-03-05 09:52:00 -05:00
)
if not defined ConnectArgs (
call :Usage %0
exit /b 1
)
2008-11-17 18:29:00 -05:00
if not defined SINGULARITY_BUILD_SETTINGS (
echo The environment variable SINGULARITY_BUILD_SETTINGS is not defined,
echo this script has no way to devine paths without it! Run setenv.cmd.
exit /b 1
)
2008-03-05 09:52:00 -05:00
@rem Read object file paths generated by build process
2008-11-17 18:29:00 -05:00
call %SINGULARITY_BUILD_SETTINGS%
2008-03-05 09:52:00 -05:00
if ErrorLevel 1 (
2008-11-17 18:29:00 -05:00
echo %SINGULARITY_BUILD_SETTINGS% failed.
2008-03-05 09:52:00 -05:00
exit /b 1
)
2008-11-17 18:29:00 -05:00
set DebuggerTitle=%TITLE% %arg:~1%
taskkill /F /FI "IMAGENAME EQ windbg.exe" /FI "WINDOWTITLE EQ %DebuggerTitle%*" 2>NUL 1>&2
start windbg.exe -k %ConnectArgs% -T "%DebuggerTitle%" -WX -W %SINGULARITY_ROOT%:%SINGULARITY_DISTRO_SUFFIX% -d -c %scr% %1 %2 %3 %4 %5 %6 %7 %8 %9
2008-03-05 09:52:00 -05:00
exit /b 0
:Usage
echo.Usage:
2008-11-17 18:29:00 -05:00
echo. %~nx1 [options] ^<connectionType^>
2008-03-05 09:52:00 -05:00
echo.
echo.where ^<connectionType^> is one of:
2008-11-17 18:29:00 -05:00
echo. /1394 Fire-wire.
echo. /com1 Serial port 1.
echo. /com2 Serial port 2.
echo. /com3 Serial port 3.
echo. /pipe Named pipe to Virtual PC at \\.\pipe\kd.
echo.
echo.Options:
echo. /f Break on first chance exceptions.