invoke improvements for toptica

This commit is contained in:
Stefan Liebl 2024-08-01 10:14:54 +02:00
parent 4d2880c056
commit 2518b18fae

@ -1,6 +1,6 @@
command -nargs=1 -complete=dir DlcPro call s:ProjectSet('dlcpro-new', '<args>')
command -nargs=1 -complete=dir DlcProOld call s:ProjectSet('dlcpro', '<args>')
" command -nargs=1 -complete=dir DlcProOld call s:ProjectSet('dlcpro-old', '<args>')
command -nargs=1 -complete=dir DlcProOldOld call s:ProjectSet('dlcpro-old', '<args>')
command -nargs=1 -complete=dir DlcProShg call s:ProjectSet('shg', '<args>')
command -nargs=1 -complete=dir DlcProGui call s:ProjectSet('dlcpro-gui', '<args>')
command -nargs=1 -complete=dir DlcProGuiOld call s:ProjectSet('dlcpro-gui-old', '<args>')
@ -111,7 +111,7 @@ function! s:ProjectSet(project_type, project_base_dir)
let s:invoke_tasks = ' -c ~/tools/invoke/'.g:project_type.'/tasks'
set wildignore-=**/firmware/src/device-control/**
set wildignore+=**/shg-firmware/**
set titlestring=%<%t\ (%{expand('%:p:h')})%=project:\ %{g:project_type}\ \ \ \ compiler:\ %{Compiler_version()}
set titlestring=%<%t\ (%{expand('%:p:h')})%=project:\ %{g:project_type}\ \ \ \ compiler:\ %{g:Compiler_version()}
let g:DeviceIP = 'dlc_pro__040083'
let g:DebugRemote = v:true
if (g:project_type == 'dlcpro-new')
@ -131,7 +131,7 @@ function! s:ProjectSet(project_type, project_base_dir)
let g:ProgramRemote = '/opt/app/bin/device-control'
set wildignore-=**/firmware/src/device-control/**
set wildignore+=**/shg-firmware/**
set titlestring=%<%t\ (%{expand('%:p:h')})%=compiler:\ %{Compiler_version()}
set titlestring=%<%t\ (%{expand('%:p:h')})%=compiler:\ %{g:Compiler_version()}
let s:makegoals = ['artifacts-firmware', 'artifacts-docu', 'artifacts', 'device-control', 'user-interface', 'doxygen', 'fw-updates', 'shg-firmware', 'can-updater', 'specalyser', 'docu-ul0', 'code-generation', 'dependency-graphs', 'decof', 'decof-sdk', 'clean', 'distclean', 'help', 'jamplayer', 'dlcpro-slot']
let s:makeprg = 'make'
let g:DeviceIP = 'dlc_pro__040083'
@ -448,6 +448,11 @@ function! s:Make(args, async_mode)
if l:args == ''
let l:args = 'build' " default
endif
if '\<build\>' =~ l:args && '--project' !~ l:args
if g:project_type != 'pfd' " FIXME
let l:args .= ' --project='.g:project_type
endif
endif
" echom 'l:args2:'.l:args.':'
let &makeprg = l:makeprg
execute 'AsyncRun -mode='.a:async_mode.' -save=2 -program=make @ '.l:args
@ -698,6 +703,14 @@ let g:DlcproBasePath = "/jenkins/workspace/pro--firmware_release_1.9.0-DCESJ5C5R
function! s:DeviceDebug(attach)
if s:use_invoke
if g:DebugRemote
if 'dlcpro' =~ g:project_type
" call s:Call_and_log('pkill --full gdbserver')
" call s:Call_and_log('ssh -o RemoteCommand=none '.g:SshOpts.' root@'.g:DeviceIP.' "killall -q -9 gdbserver start-dc.sh '.fnamemodify(g:ProgramRemote, ':t').'"')
" call s:Call_and_log('ssh -o RemoteCommand=none '.g:SshOpts.' -L localhost:'.g:GdbPort.':localhost:'.g:GdbPort.' "root@'.g:DeviceIP.'" '.g:SshOpts2.' gdbserver --multi localhost:'.g:GdbPort.' &')
call s:Call_and_log('ssh -o RemoteCommand=none '.g:SshOpts.' root@'.g:DeviceIP.' "killall -q gdbserver start-dc.sh '.fnamemodify(g:ProgramRemote, ':t').'"')
sleep 2
call s:Call_and_log('ssh -o RemoteCommand=none '.g:SshOpts.' root@'.g:DeviceIP.' "killall -q -9 gdbserver start-dc.sh '.fnamemodify(g:ProgramRemote, ':t').'"')
endif
autocmd! User TermdebugStartPre
autocmd! User TermdebugStartPost
autocmd! User TermdebugStopPost
@ -708,20 +721,23 @@ function! s:DeviceDebug(attach)
if g:project_type != 'pfd' " FIXME
let gdb_server_cmd .= ' --project='.g:project_type
endif
call asyncrun#quickfix_toggle(10, 1)
execute 'AsyncRun -mode=async @ '.gdb_server_cmd
if v:true
call system(gdb_server_cmd.'&')
else
call asyncrun#quickfix_toggle(3, 1)
execute 'AsyncRun '.gdb_server_cmd
autocmd User TermdebugStopPost execute 'AsyncStop'
endif
if g:project_type != 'pfd' " FIXME
sleep 5
endif
autocmd User TermdebugStopPost execute 'AsyncStop'
if exists('s:gdb_connect_script')
" autocmd User TermdebugStartPost call term_sendkeys('',"cd .build/dlcpro-new\nsource ".s:gdb_connect_script."\n")
autocmd User TermdebugStartPost call term_sendkeys('',"source ".s:gdb_connect_script."\n")
endif
" autocmd User TermdebugStopPost call system('pkill --full gdbserver')
Termdebug
call s:SendToDebugger('set confirm off')
" Close Program window
" execute '2hide'
execute '2hide'
else
call s:StartDebugger(g:Elffile, a:attach)
call s:SendToDebugger('file '.g:Elffile)