Path: news.mathworks.com!not-for-mail
From: "Matthew Simoneau" <matthew@mathworks.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: "Error using ==> dbstop"
Date: Mon, 29 Jun 2009 21:26:42 +0000 (UTC)
Organization: The MathWorks Inc
Lines: 1
Message-ID: <h2bbii$j2h$1@fred.mathworks.com>
References: <h1vvp9$e75$1@fred.mathworks.com> <4a659c20-07f7-421f-b010-1d7aca2078f6@j19g2000vbp.googlegroups.com> <h29n1b$51j$1@fred.mathworks.com> <h29ubm$kfs$1@fred.mathworks.com> <h2a5po$amq$1@fred.mathworks.com> <MPG.24b27338f102bf719899f2@news.mathworks.com> <h2b74l$n7f$1@fred.mathworks.com> <h2b8a5$cl5$1@fred.mathworks.com>
Reply-To: "Matthew Simoneau" <matthew@mathworks.com>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1246310802 19537 172.30.248.35 (29 Jun 2009 21:26:42 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 29 Jun 2009 21:26:42 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 25640
Xref: news.mathworks.com comp.soft-sys.matlab:551541


I see what is going on here.  Breakpoints can only go on certain lines in a file, and it's tough to figure out which ones in advance.  When instrumenting the file for publishing, PUBLISH just tries to put them where it wants and catches the occasional errors.  The reason this is changing the state of LASTERROR is because the CATCH isn't requesting the exception as a variable.  To fix this, I just need to change the two lines in matlab/codetools/private/evalmxdom.m from just "catch" to "catch theError".  Using this syntax will prevent it from changing the state of LASTERROR and your code should work fine.