Is it possible to attach to a running matlab process?

6 ビュー (過去 30 日間)
shlomi golubev
shlomi golubev 2013 年 8 月 7 日
コメント済み: Cecil Smith 2022 年 4 月 4 日
I have a matlab process which executes a function for a week or so. I would like to attach to this process to examine some variables' values. Is it possible to attach to a running matlab process in a similar way like I can attach to a running process using GDB? My matlab version is 2012b if it makes any difference
Thanks in advance

回答 (1 件)

Daniel Shub
Daniel Shub 2013 年 8 月 8 日
Assuming you are using Linux and want to attach over ssh (or something similar) you should look at the answers to this question which suggest using SCREEN (although some people suggest VNC). You should also take a look at this question which provides some warnings about long running processes.
  3 件のコメント
dpb
dpb 2013 年 8 月 10 日
編集済み: dpb 2013 年 8 月 11 日
This doesn't answer your direct question, either, but, for the future you might consider modifying the application(s) that are so long to use shared memory via memory mapping and have them update that memory periodically so a second process can access it.
I don't know enough of the unix side of things to have any suggestions for directly attaching to another existing image, sorry...
Cecil Smith
Cecil Smith 2022 年 4 月 4 日
I'm having this problem, too. I use tmux to run matlab. But now it paused at somewhere. So I'm looking for a method to start a debugger and attach debugger to this process to see what happened, not just inspect its stdout. While for C program, GDB can implement this. Is it possible for matlab?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangePerformance and Memory についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by