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
c6193608
Commit
c6193608
authored
Nov 24, 2010
by
Friedemann Kleint
Browse files
Debugger: Fix CDB Disassembler
parent
d0b7c124
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/plugins/debugger/cdb/cdbengine.cpp
View file @
c6193608
...
...
@@ -1346,8 +1346,9 @@ void CdbEngine::fetchDisassembler(DisassemblerViewAgent *agent)
if
(
debugCDB
)
qDebug
()
<<
"fetchDisassembler"
<<
address
<<
" Agent: "
<<
agent
->
address
();
DisassemblerLines
lines
;
if
(
address
==
0
)
{
// Clear window
agent
->
setContents
(
QString
()
);
agent
->
setContents
(
lines
);
return
;
}
QString
disassembly
;
...
...
@@ -1355,11 +1356,12 @@ void CdbEngine::fetchDisassembler(DisassemblerViewAgent *agent)
const
bool
ok
=
disassemble
(
m_d
,
address
,
ContextLines
,
ContextLines
,
QTextStream
(
&
disassembly
),
&
errorMessage
);
QApplication
::
restoreOverrideCursor
();
if
(
ok
)
{
agent
->
setContents
(
disassembly
);
foreach
(
const
QString
&
line
,
disassembly
.
remove
(
QLatin1Char
(
'\r'
)).
split
(
QLatin1Char
(
'\n'
)))
lines
.
appendLine
(
DisassemblerLine
(
line
));
}
else
{
agent
->
setContents
(
QString
());
warning
(
errorMessage
);
}
agent
->
setContents
(
lines
);
}
void
CdbEngine
::
fetchMemory
(
MemoryViewAgent
*
agent
,
QObject
*
token
,
quint64
addr
,
quint64
length
)
...
...
src/plugins/debugger/cdb2/cdbengine2.cpp
View file @
c6193608
...
...
@@ -1021,7 +1021,10 @@ void CdbEngine::handleDisassembler(const CdbBuiltinCommandPtr &command)
{
QTC_ASSERT
(
qVariantCanConvert
<
Debugger
::
Internal
::
DisassemblerViewAgent
*>
(
command
->
cookie
),
return
;)
Debugger
::
Internal
::
DisassemblerViewAgent
*
agent
=
qvariant_cast
<
Debugger
::
Internal
::
DisassemblerViewAgent
*>
(
command
->
cookie
);
agent
->
setContents
(
formatCdbDisassembler
(
command
->
reply
));
DisassemblerLines
disassemblerLines
;
foreach
(
const
QByteArray
&
line
,
command
->
reply
)
disassemblerLines
.
appendLine
(
DisassemblerLine
(
QString
::
fromLatin1
(
line
)));
agent
->
setContents
(
disassemblerLines
);
}
void
CdbEngine
::
fetchMemory
(
Debugger
::
Internal
::
MemoryViewAgent
*
agent
,
QObject
*
editor
,
quint64
addr
,
quint64
length
)
...
...
src/plugins/debugger/cdb2/cdbparsehelpers.cpp
View file @
c6193608
...
...
@@ -33,7 +33,6 @@
#include "threadshandler.h"
#include "registerhandler.h"
#include "bytearrayinputstream.h"
#include "debuggeragents.h"
#include "gdb/gdbmi.h"
#ifdef Q_OS_WIN
# include "shared/dbgwinutils.h"
...
...
@@ -98,21 +97,6 @@ QByteArray cdbAddBreakpointCommand(const Debugger::Internal::BreakpointParameter
return
rc
;
}
// Remove the address separator. Format the address exactly as
// the agent does (0xhex, as taken from frame) for the location mark to trigger.
Internal
::
DisassemblerLines
formatCdbDisassembler
(
const
QList
<
QByteArray
>
&
in
)
{
Internal
::
DisassemblerLines
result
;
foreach
(
QByteArray
line
,
in
)
{
// Remove 64bit separator.
if
(
line
.
size
()
>=
9
&&
line
.
at
(
8
)
==
'`'
)
line
.
remove
(
8
,
1
);
// Ensure address is as wide as agent's address.
result
.
appendLine
(
Internal
::
DisassemblerLine
(
line
));
}
return
result
;
}
// Fix a CDB integer value: '00000000`0012a290' -> '12a290', '0n10' ->'10'
QByteArray
fixCdbIntegerValue
(
QByteArray
t
,
bool
stripLeadingZeros
,
int
*
basePtr
/* = 0 */
)
{
...
...
src/plugins/debugger/cdb2/cdbparsehelpers.h
View file @
c6193608
...
...
@@ -44,7 +44,6 @@ namespace Debugger {
namespace
Internal
{
class
BreakpointData
;
class
BreakpointParameters
;
class
DisassemblerLines
;
class
StackFrame
;
struct
ThreadData
;
class
Register
;
...
...
@@ -56,9 +55,6 @@ namespace Cdb {
// Convert breakpoint in CDB syntax.
QByteArray
cdbAddBreakpointCommand
(
const
Debugger
::
Internal
::
BreakpointParameters
&
d
,
bool
oneshot
=
false
,
int
id
=
-
1
);
// Format CDB Dissambler output.
Internal
::
DisassemblerLines
formatCdbDisassembler
(
const
QList
<
QByteArray
>
&
in
);
// Convert a CDB integer value: '00000000`0012a290' -> '12a290', '0n10' ->'10'
QByteArray
fixCdbIntegerValue
(
QByteArray
t
,
bool
stripLeadingZeros
=
false
,
int
*
basePtr
=
0
);
// Convert a CDB integer value into quint64 or int64
...
...
src/plugins/debugger/debuggeragents.cpp
View file @
c6193608
...
...
@@ -416,6 +416,10 @@ DisassemblerLine::DisassemblerLine(const QString &unparsed)
return
;
}
QString
addr
=
unparsed
.
left
(
pos
);
// MSVC 64bit: Remove 64bit separator 00000000`00a45000'.
if
(
addr
.
size
()
>=
9
&&
addr
.
at
(
8
)
==
QLatin1Char
(
'`'
))
addr
.
remove
(
8
,
1
);
if
(
addr
.
endsWith
(
':'
))
// clang
addr
.
chop
(
1
);
if
(
addr
.
startsWith
(
QLatin1String
(
"0x"
)))
...
...
src/plugins/debugger/debuggeragents.h
View file @
c6193608
...
...
@@ -90,6 +90,7 @@ class DisassemblerLines
{
public:
DisassemblerLines
()
{}
bool
coversAddress
(
quint64
address
)
const
;
void
appendLine
(
const
DisassemblerLine
&
dl
);
void
appendComment
(
const
QString
&
comment
);
...
...
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