@@ -152,15 +152,15 @@ void GAS::putDebugString(CodeEditor *code)
152152 if (intelIndex == -1 || attIndex > intelIndex) { // AT&T syntax
153153 if (isx86 ()) {
154154 if (code->toPlainText ().indexOf (
155- QRegExp (" \\ s+[Mm][Oo][Vv][Ll] +%?[Ee][Ss][Pp] *, *%?[Ee][Bb][Pp]" ), index + 1 ) != index + 1 ) {
155+ QRegExp (" \\ s+([Pp][Uu][Ss][Hh][Ll]? +%?[Ee][Bb][Pp] \\ s+)? [Mm][Oo][Vv][Ll] +%?[Ee][Ss][Pp] *, *%?[Ee][Bb][Pp]" ), index + 1 ) != index + 1 ) {
156156 QTextCursor cursor = code->textCursor ();
157157 cursor.movePosition (QTextCursor::Start);
158158 cursor.movePosition (QTextCursor::Right, QTextCursor::MoveAnchor, index + 1 );
159159 cursor.insertText (QString (" \n movl %esp, %ebp #for correct debugging" ));
160160 }
161161 } else {
162162 if (code->toPlainText ().indexOf (
163- QRegExp (" \\ s+[Mm][Oo][Vv][Qq] +%?[Rr][Ss][Pp] *, *%?[Rr][Bb][Pp]" ), index + 1 ) != index + 1 ) {
163+ QRegExp (" \\ s+([Pp][Uu][Ss][Hh][Qq]? +%?[Rr][Bb][Pp] \\ s+)? [Mm][Oo][Vv][Qq] +%?[Rr][Ss][Pp] *, *%?[Rr][Bb][Pp]" ), index + 1 ) != index + 1 ) {
164164 QTextCursor cursor = code->textCursor ();
165165 cursor.movePosition (QTextCursor::Start);
166166 cursor.movePosition (QTextCursor::Right, QTextCursor::MoveAnchor, index + 1 );
@@ -170,15 +170,15 @@ void GAS::putDebugString(CodeEditor *code)
170170 } else { // Intel syntax
171171 if (isx86 ()) {
172172 if (code->toPlainText ().indexOf (
173- QRegExp (" \\ s+[Mm][Oo][Vv] +%?[Ee][Bb][Pp] *, *%?[Ee][Ss][Pp]" ), index + 1 ) != index + 1 ) {
173+ QRegExp (" \\ s+([Pp][Uu][Ss][Hh][Ll]? +%?[Ee][Bb][Pp] \\ s+)? [Mm][Oo][Vv] +%?[Ee][Bb][Pp] *, *%?[Ee][Ss][Pp]" ), index + 1 ) != index + 1 ) {
174174 QTextCursor cursor = code->textCursor ();
175175 cursor.movePosition (QTextCursor::Start);
176176 cursor.movePosition (QTextCursor::Right, QTextCursor::MoveAnchor, index + 1 );
177177 cursor.insertText (QString (" \n mov %ebp, %esp #for correct debugging" ));
178178 }
179179 } else {
180180 if (code->toPlainText ().indexOf (
181- QRegExp (" \\ s+[Mm][Oo][Vv] +%?[Rr][Bb][Pp] *, *%?[Rr][Ss][Pp]" ), index + 1 ) != index + 1 ) {
181+ QRegExp (" \\ s+([Pp][Uu][Ss][Hh][Qq]? +%?[Rr][Bb][Pp] \\ s+)? [Mm][Oo][Vv] +%?[Rr][Bb][Pp] *, *%?[Rr][Ss][Pp]" ), index + 1 ) != index + 1 ) {
182182 QTextCursor cursor = code->textCursor ();
183183 cursor.movePosition (QTextCursor::Start);
184184 cursor.movePosition (QTextCursor::Right, QTextCursor::MoveAnchor, index + 1 );
0 commit comments