Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
8cd704b5
Commit
8cd704b5
authored
Nov 19, 2010
by
hjk
Browse files
debugger: improve stepping performance in "instructionwise" mode.
Formatting of disassembler view took too much time.
parent
04003392
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/plugins/debugger/debuggeragents.cpp
View file @
8cd704b5
...
...
@@ -300,18 +300,20 @@ void DisassemblerViewAgentPrivate::configureMimeType()
{
QTC_ASSERT
(
editor
,
return
);
TextEditor
::
BaseTextDocument
*
doc
=
qobject_cast
<
TextEditor
::
BaseTextDocument
*>
(
editor
->
file
());
TextEditor
::
BaseTextDocument
*
doc
=
qobject_cast
<
TextEditor
::
BaseTextDocument
*>
(
editor
->
file
());
QTC_ASSERT
(
doc
,
return
);
doc
->
setMimeType
(
mimeType
);
TextEditor
::
PlainTextEditor
*
pe
=
qobject_cast
<
TextEditor
::
PlainTextEditor
*>
(
editor
->
widget
());
TextEditor
::
PlainTextEditor
*
pe
=
qobject_cast
<
TextEditor
::
PlainTextEditor
*>
(
editor
->
widget
());
QTC_ASSERT
(
pe
,
return
);
if
(
const
MimeType
mtype
=
ICore
::
instance
()
->
mimeDatabase
()
->
findByType
(
mimeType
))
{
MimeType
mtype
=
ICore
::
instance
()
->
mimeDatabase
()
->
findByType
(
mimeType
);
if
(
mtype
)
pe
->
configure
(
mtype
);
}
else
{
else
qWarning
(
"Assembler mimetype '%s' not found."
,
qPrintable
(
mimeType
));
}
}
QString
DisassemblerViewAgent
::
mimeType
()
const
...
...
src/plugins/debugger/gdb/gdbengine.cpp
View file @
8cd704b5
...
...
@@ -3881,7 +3881,8 @@ static QByteArray parseLine(const GdbMi &line)
//QByteArray funcName = line.findChild("func-name").data();
//QByteArray offset = line.findChild("offset").data();
QByteArray
inst
=
line
.
findChild
(
"inst"
).
data
();
ba
+=
address
+
QByteArray
(
15
-
address
.
size
(),
' '
);
ba
+=
address
;
ba
+=
QByteArray
(
15
-
address
.
size
(),
' '
);
//ba += funcName + "+" + offset + " ";
//ba += QByteArray(30 - funcName.size() - offset.size(), ' ');
ba
+=
inst
;
...
...
@@ -3910,7 +3911,7 @@ QString GdbEngine::parseDisassembler(const GdbMi &lines)
// FIXME: Performance?
foreach
(
const
GdbMi
&
child
,
lines
.
children
())
{
if
(
child
.
hasName
(
"src_and_asm_line"
))
{
//
m
ixed mode
//
M
ixed mode
.
if
(
!
fileLoaded
)
{
QString
fileName
=
QFile
::
decodeName
(
child
.
findChild
(
"file"
).
data
());
fileName
=
cleanupFullName
(
fileName
);
...
...
@@ -3926,7 +3927,7 @@ QString GdbEngine::parseDisassembler(const GdbMi &lines)
foreach
(
const
GdbMi
&
line
,
insn
.
children
())
ba
+=
parseLine
(
line
);
}
else
{
//
t
he non-mixed version
//
T
he non-mixed version
.
ba
+=
parseLine
(
child
);
}
}
...
...
@@ -4026,39 +4027,32 @@ void GdbEngine::handleFetchDisassemblerByCli(const GdbResponse &response)
if
(
lines
.
isValid
())
{
ac
.
agent
->
setContents
(
parseDisassembler
(
lines
));
}
else
{
const
Q
String
someSpace
=
_
(
" "
)
;
const
Q
ByteArray
someSpace
=
" "
;
// First line is something like
// "Dump of assembler code from 0xb7ff598f to 0xb7ff5a07:"
GdbMi
output
=
response
.
data
.
findChild
(
"consolestreamoutput"
);
Q
StringList
res
;
foreach
(
QByteArray
line
,
output
.
data
().
split
(
'\n'
))
{
line
=
line
.
trimmed
();
Q
ByteArray
res
;
foreach
(
const
QByteArray
&
line
0
,
output
.
data
().
split
(
'\n'
))
{
QByteArray
line
=
line
0
.
trimmed
();
if
(
line
.
startsWith
(
"=> "
))
line
=
line
.
mid
(
3
);
if
(
line
.
startsWith
(
"Current language:"
))
continue
;
if
(
line
.
startsWith
(
"The current source"
))
continue
;
if
(
line
.
startsWith
(
"End of assembler"
))
continue
;
if
(
line
.
startsWith
(
"0x"
))
{
int
pos1
=
line
.
indexOf
(
'<'
);
int
pos2
=
line
.
indexOf
(
'+'
,
pos1
);
int
pos3
=
line
.
indexOf
(
'>'
,
pos2
);
if
(
pos3
>=
0
)
{
QByteArray
ba
=
" <+"
+
line
.
mid
(
pos2
+
1
,
pos3
-
pos2
-
1
);
ba
=
line
.
left
(
pos1
-
1
)
+
ba
.
rightJustified
(
4
)
+
">: "
+
line
.
mid
(
pos3
+
2
);
res
.
append
(
_
(
ba
));
}
else
{
res
.
append
(
_
(
line
));
}
res
.
append
(
line
);
res
.
append
(
'\n'
);
continue
;
}
res
.
append
(
someSpace
+
_
(
line
));
res
.
append
(
someSpace
);
res
.
append
(
line
);
res
.
append
(
'\n'
);
}
// Drop "End of assembler dump." line.
res
.
takeLast
();
if
(
res
.
size
()
>
1
)
ac
.
agent
->
setContents
(
res
.
join
(
_
(
"
\n
"
)
));
ac
.
agent
->
setContents
(
_
(
res
));
else
fetchDisassemblerByAddressCli
(
ac
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment