Skip to content
GitLab
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
e3712f96
Commit
e3712f96
authored
Jan 05, 2010
by
hjk
Browse files
debugger: refactoring, use QByteArray instead of QString when appropriate
parent
84e2e893
Changes
22
Expand all
Hide whitespace changes
Inline
Side-by-side
src/plugins/debugger/breakhandler.cpp
View file @
e3712f96
...
...
@@ -139,7 +139,7 @@ public:
}
}
}
m_data
->
lineNumber
=
Q
String
::
number
(
lineNumber
);
m_data
->
lineNumber
=
Q
ByteArray
::
number
(
lineNumber
);
m_data
->
handler
()
->
updateMarkers
();
}
...
...
@@ -386,13 +386,13 @@ void BreakHandler::loadBreakpoints()
data
->
fileName
=
v
.
toString
();
v
=
map
.
value
(
QLatin1String
(
"linenumber"
));
if
(
v
.
isValid
())
data
->
lineNumber
=
v
.
toString
();
data
->
lineNumber
=
v
.
toString
()
.
toLatin1
()
;
v
=
map
.
value
(
QLatin1String
(
"condition"
));
if
(
v
.
isValid
())
data
->
condition
=
v
.
toString
();
data
->
condition
=
v
.
toString
()
.
toLatin1
()
;
v
=
map
.
value
(
QLatin1String
(
"ignorecount"
));
if
(
v
.
isValid
())
data
->
ignoreCount
=
v
.
to
Int
();
data
->
ignoreCount
=
v
.
to
String
().
toLatin1
();
v
=
map
.
value
(
QLatin1String
(
"funcname"
));
if
(
v
.
isValid
())
data
->
funcName
=
v
.
toString
();
...
...
@@ -561,7 +561,7 @@ bool BreakHandler::setData(const QModelIndex &mi, const QVariant &value, int rol
case
4
:
{
QString
val
=
value
.
toString
();
if
(
val
!=
data
->
condition
)
{
data
->
condition
=
val
;
data
->
condition
=
val
.
toLatin1
()
;
dataChanged
(
mi
,
mi
);
}
return
true
;
...
...
@@ -569,7 +569,7 @@ bool BreakHandler::setData(const QModelIndex &mi, const QVariant &value, int rol
case
5
:
{
QString
val
=
value
.
toString
();
if
(
val
!=
data
->
ignoreCount
)
{
data
->
ignoreCount
=
val
;
data
->
ignoreCount
=
val
.
toLatin1
()
;
dataChanged
(
mi
,
mi
);
}
return
true
;
...
...
@@ -660,7 +660,7 @@ void BreakHandler::setBreakpoint(const QString &fileName, int lineNumber)
BreakpointData
*
data
=
new
BreakpointData
(
this
);
data
->
fileName
=
fileName
;
data
->
lineNumber
=
Q
String
::
number
(
lineNumber
);
data
->
lineNumber
=
Q
ByteArray
::
number
(
lineNumber
);
data
->
pending
=
true
;
data
->
markerFileName
=
fileName
;
data
->
markerLineNumber
=
lineNumber
;
...
...
src/plugins/debugger/breakhandler.h
View file @
e3712f96
...
...
@@ -69,30 +69,30 @@ private:
BreakpointData
(
const
BreakpointData
&
);
// Our owner
BreakHandler
*
m_handler
;
// not owned.
BreakHandler
*
m_handler
;
// not owned.
public:
bool
enabled
;
// should we talk to the debugger engine?
bool
pending
;
// does the debugger engine know about us already?
bool
enabled
;
// should we talk to the debugger engine?
bool
pending
;
// does the debugger engine know about us already?
// this "user requested information". will get stored in the session
QString
fileName
;
// short name of source file
Q
String
condition
;
// condition associated with breakpoint
Q
String
ignoreCount
;
// ignore count associated with breakpoint
Q
String
lineNumber
;
// line in source file
QString
funcName
;
// name of containing function
bool
useFullPath
;
// should we use the full path when setting the bp?
QString
fileName
;
// short name of source file
Q
ByteArray
condition
;
// condition associated with breakpoint
Q
ByteArray
ignoreCount
;
// ignore count associated with breakpoint
Q
ByteArray
lineNumber
;
// line in source file
QString
funcName
;
// name of containing function
bool
useFullPath
;
// should we use the full path when setting the bp?
// this is what gdb produced in response
Q
String
bpNumber
;
// breakpoint number assigned by the debugger engine
Q
String
bpCondition
;
// condition acknowledged by the debugger engine
Q
String
bpIgnoreCount
;
// ignore count acknowledged by the debugger engine
QString
bpFileName
;
// file name acknowledged by the debugger engine
Q
String
bpLineNumber
;
// line number acknowledged by the debugger engine
QString
bpFuncName
;
// function name acknowledged by the debugger engine
QString
bpAddress
;
// address acknowledged by the debugger engine
bool
bpMultiple
;
// happens in constructors/gdb
bool
bpEnabled
;
// enable/disable command sent
Q
ByteArray
bpNumber
;
// breakpoint number assigned by the debugger engine
Q
ByteArray
bpCondition
;
// condition acknowledged by the debugger engine
Q
ByteArray
bpIgnoreCount
;
// ignore count acknowledged by the debugger engine
QString
bpFileName
;
// file name acknowledged by the debugger engine
Q
ByteArray
bpLineNumber
;
// line number acknowledged by the debugger engine
QString
bpFuncName
;
// function name acknowledged by the debugger engine
QString
bpAddress
;
// address acknowledged by the debugger engine
bool
bpMultiple
;
// happens in constructors/gdb
bool
bpEnabled
;
// enable/disable command sent
// taken from either user input or gdb responses
QString
markerFileName
;
// used to locate the marker
...
...
src/plugins/debugger/cdb/cdbassembler.cpp
View file @
e3712f96
...
...
@@ -84,7 +84,7 @@ bool getRegisters(CIDebugControl *ctl,
return
false
;
}
Register
reg
;
reg
.
name
=
QString
::
fromUtf16
(
reinterpret_cast
<
const
ushort
*>
(
wszBuf
));
reg
.
name
=
QString
::
fromUtf16
(
reinterpret_cast
<
const
ushort
*>
(
wszBuf
))
.
toLatin1
()
;
registers
->
push_back
(
reg
);
}
// get values
...
...
src/plugins/debugger/cdb/cdbbreakpoint.cpp
View file @
e3712f96
...
...
@@ -564,7 +564,7 @@ bool CDBBreakPoint::synchronizeBreakPoints(CIDebugControl* debugControl,
handler
->
takeInsertedBreakPoint
(
nbd
);
updateMarkers
=
true
;
nbd
->
pending
=
false
;
nbd
->
bpNumber
=
Q
String
::
number
(
id
);
nbd
->
bpNumber
=
Q
ByteArray
::
number
(
uint
(
id
)
)
;
nbd
->
bpAddress
=
QLatin1String
(
"0x"
)
+
QString
::
number
(
address
,
16
);
// Take over rest as is
nbd
->
bpCondition
=
nbd
->
condition
;
...
...
src/plugins/debugger/cdb/cdbdebugengine.cpp
View file @
e3712f96
...
...
@@ -985,7 +985,7 @@ void CdbDebugEngine::updateWatchData(const WatchData &incomplete)
qDebug
()
<<
Q_FUNC_INFO
<<
"
\n
"
<<
incomplete
.
toString
();
WatchHandler
*
watchHandler
=
manager
()
->
watchHandler
();
if
(
incomplete
.
iname
.
startsWith
(
QLatin1String
(
"watch."
))
)
{
if
(
incomplete
.
iname
.
startsWith
(
"watch."
))
{
WatchData
watchData
=
incomplete
;
evaluateWatcher
(
&
watchData
);
watchHandler
->
insertData
(
watchData
);
...
...
@@ -1311,7 +1311,7 @@ void CdbDebugEngine::assignValueInDebugger(const QString &expr, const QString &v
break
;
// Update view
WatchHandler
*
watchHandler
=
manager
()
->
watchHandler
();
if
(
WatchData
*
fwd
=
watchHandler
->
findItem
(
expr
))
{
if
(
WatchData
*
fwd
=
watchHandler
->
findItem
(
expr
.
toLatin1
()
))
{
fwd
->
setValue
(
newValue
);
watchHandler
->
insertData
(
*
fwd
);
watchHandler
->
updateWatchers
();
...
...
src/plugins/debugger/cdb/cdbstackframecontext.cpp
View file @
e3712f96
...
...
@@ -230,7 +230,7 @@ bool WatchHandleDumperInserter::expandPointerToDumpable(const WatchData &wd, QSt
derefedWd
.
setType
(
type
);
derefedWd
.
setAddress
(
hexAddrS
);
derefedWd
.
name
=
QString
(
QLatin1Char
(
'*'
));
derefedWd
.
iname
=
wd
.
iname
+
QLatin1String
(
".*"
)
;
derefedWd
.
iname
=
wd
.
iname
+
".*"
;
derefedWd
.
source
=
OwnerDumper
|
CdbStackFrameContext
::
ChildrenKnownBit
;
const
CdbDumperHelper
::
DumpResult
dr
=
m_dumper
->
dumpType
(
derefedWd
,
true
,
&
m_dumperResult
,
errorMessage
);
if
(
dr
!=
CdbDumperHelper
::
DumpOk
)
...
...
src/plugins/debugger/cdb/cdbsymbolgroupcontext.cpp
View file @
e3712f96
...
...
@@ -470,11 +470,11 @@ static inline QString fixValue(const QString &value, const QString &type)
WatchData
CdbSymbolGroupContext
::
watchDataAt
(
unsigned
long
index
)
const
{
WatchData
wd
;
wd
.
iname
=
symbolINameAt
(
index
);
wd
.
iname
=
symbolINameAt
(
index
)
.
toLatin1
()
;
wd
.
exp
=
wd
.
iname
;
// Determine name from iname and format shadowed variables correctly
// as "<shadowed X>, see populateINameIndexMap().
const
int
lastDelimiterPos
=
wd
.
iname
.
lastIndexOf
(
m_nameDelimiter
);
const
int
lastDelimiterPos
=
wd
.
iname
.
lastIndexOf
(
m_nameDelimiter
.
toLatin1
()
);
QString
name
=
lastDelimiterPos
==
-
1
?
wd
.
iname
:
wd
.
iname
.
mid
(
lastDelimiterPos
+
1
);
int
shadowedNumber
=
0
;
const
int
shadowedPos
=
name
.
lastIndexOf
(
QLatin1Char
(
iNameShadowDelimiter
));
...
...
@@ -486,7 +486,7 @@ WatchData CdbSymbolGroupContext::watchDataAt(unsigned long index) const
// (std::map extends std::tree<>... Remove them for display only.
const
QString
fullShadowedName
=
WatchData
::
shadowedName
(
name
,
shadowedNumber
);
wd
.
name
=
WatchData
::
shadowedName
(
removeInnerTemplateType
(
name
),
shadowedNumber
);
wd
.
addr
=
hexSymbolOffset
(
m_symbolGroup
,
index
);
wd
.
addr
=
hexSymbolOffset
(
m_symbolGroup
,
index
)
.
toLatin1
()
;
const
QString
type
=
getSymbolString
(
m_symbolGroup
,
&
IDebugSymbolGroup2
::
GetSymbolTypeNameWide
,
index
);
wd
.
setType
(
type
);
// Check for unitialized variables at level 0 only.
...
...
src/plugins/debugger/cdb/cdbsymbolgroupcontext_tpl.h
View file @
e3712f96
...
...
@@ -137,7 +137,7 @@ bool insertSymbolRecursion(WatchData wd,
return
false
;
}
else
{
const
QString
msg
=
QString
::
fromLatin1
(
"WARNING: Skipping invalid child symbol #%2 (type %3) of '%4'."
).
arg
(
QLatin1String
(
Q_FUNC_INFO
)).
arg
(
c
).
arg
(
cwd
.
type
,
wd
.
iname
);
arg
(
QLatin1String
(
Q_FUNC_INFO
)).
arg
(
c
).
arg
(
cwd
.
type
,
QString
::
fromLatin1
(
wd
.
iname
)
)
;
qWarning
(
"%s
\n
"
,
qPrintable
(
msg
));
}
}
...
...
src/plugins/debugger/gdb/attachgdbadapter.cpp
View file @
e3712f96
...
...
@@ -70,7 +70,7 @@ void AttachGdbAdapter::startInferior()
{
QTC_ASSERT
(
state
()
==
InferiorStarting
,
qDebug
()
<<
state
());
const
qint64
pid
=
startParameters
().
attachPID
;
m_engine
->
postCommand
(
_
(
"attach
%1"
).
arg
(
pid
),
CB
(
handleAttach
));
m_engine
->
postCommand
(
"attach
"
+
QByteArray
::
number
(
pid
),
CB
(
handleAttach
));
// Task 254674 does not want to remove them
//qq->breakHandler()->removeAllBreakpoints();
}
...
...
src/plugins/debugger/gdb/coregdbadapter.cpp
View file @
e3712f96
...
...
@@ -97,8 +97,9 @@ void CoreGdbAdapter::loadExeAndSyms()
{
// Do that first, otherwise no symbols are loaded.
QFileInfo
fi
(
m_executable
);
m_engine
->
postCommand
(
_
(
"-file-exec-and-symbols
\"
%1
\"
"
)
.
arg
(
fi
.
absoluteFilePath
()),
CB
(
handleFileExecAndSymbols
));
QByteArray
path
=
fi
.
absoluteFilePath
().
toLocal8Bit
();
m_engine
->
postCommand
(
"-file-exec-and-symbols
\"
"
+
path
+
'"'
,
CB
(
handleFileExecAndSymbols
));
}
void
CoreGdbAdapter
::
handleFileExecAndSymbols
(
const
GdbResponse
&
response
)
...
...
@@ -118,8 +119,8 @@ void CoreGdbAdapter::loadCoreFile()
{
// Quoting core name below fails in gdb 6.8-debian.
QFileInfo
fi
(
startParameters
().
coreFile
);
Q
String
coreName
=
fi
.
absoluteFilePath
();
m_engine
->
postCommand
(
_
(
"target core "
)
+
coreName
,
CB
(
handleTargetCore
));
Q
ByteArray
coreName
=
fi
.
absoluteFilePath
()
.
toLocal8Bit
()
;
m_engine
->
postCommand
(
"target core "
+
coreName
,
CB
(
handleTargetCore
));
}
void
CoreGdbAdapter
::
handleTargetCore
(
const
GdbResponse
&
response
)
...
...
@@ -144,7 +145,7 @@ void CoreGdbAdapter::handleTargetCore(const GdbResponse &response)
if
(
QFile
::
exists
(
m_executable
))
{
// Finish extra round ...
showStatusMessage
(
tr
(
"Attached to core temporarily."
));
m_engine
->
postCommand
(
_
(
"detach"
)
)
;
m_engine
->
postCommand
(
"detach"
);
// ... and retry.
loadExeAndSyms
();
return
;
...
...
src/plugins/debugger/gdb/gdbengine.cpp
View file @
e3712f96
This diff is collapsed.
Click to expand it.
src/plugins/debugger/gdb/gdbengine.h
View file @
e3712f96
...
...
@@ -201,7 +201,7 @@ private: ////////// Gdb Command Management //////////
GdbCommandCallback
callback
;
AdapterCallback
adapterCallback
;
const
char
*
callbackName
;
Q
String
command
;
Q
ByteArray
command
;
QVariant
cookie
;
QTime
postTime
;
};
...
...
@@ -211,20 +211,20 @@ private: ////////// Gdb Command Management //////////
// send and decrements on receipt, effectively preventing
// watch model updates before everything is finished.
void
flushCommand
(
const
GdbCommand
&
cmd
);
void
postCommand
(
const
Q
String
&
command
,
void
postCommand
(
const
Q
ByteArray
&
command
,
GdbCommandFlags
flags
,
GdbCommandCallback
callback
=
0
,
const
char
*
callbackName
=
0
,
const
QVariant
&
cookie
=
QVariant
());
void
postCommand
(
const
Q
String
&
command
,
void
postCommand
(
const
Q
ByteArray
&
command
,
GdbCommandCallback
callback
=
0
,
const
char
*
callbackName
=
0
,
const
QVariant
&
cookie
=
QVariant
());
void
postCommand
(
const
Q
String
&
command
,
void
postCommand
(
const
Q
ByteArray
&
command
,
AdapterCallback
callback
,
const
char
*
callbackName
,
const
QVariant
&
cookie
=
QVariant
());
void
postCommand
(
const
Q
String
&
command
,
void
postCommand
(
const
Q
ByteArray
&
command
,
GdbCommandFlags
flags
,
AdapterCallback
callback
,
const
char
*
callbackName
,
...
...
@@ -458,7 +458,7 @@ private: ////////// View & Data Stuff //////////
void
setWatchDataType
(
WatchData
&
data
,
const
GdbMi
&
mi
);
void
setWatchDataDisplayedType
(
WatchData
&
data
,
const
GdbMi
&
mi
);
QSet
<
Q
String
>
m_processedNames
;
QSet
<
Q
ByteArray
>
m_processedNames
;
QMap
<
QString
,
QString
>
m_varToType
;
private:
////////// Dumper Management //////////
...
...
src/plugins/debugger/gdb/plaingdbadapter.cpp
View file @
e3712f96
...
...
@@ -99,11 +99,13 @@ void PlainGdbAdapter::startAdapter()
void
PlainGdbAdapter
::
startInferior
()
{
QTC_ASSERT
(
state
()
==
InferiorStarting
,
qDebug
()
<<
state
());
if
(
!
startParameters
().
processArgs
.
isEmpty
())
m_engine
->
postCommand
(
_
(
"-exec-arguments "
)
+
startParameters
().
processArgs
.
join
(
_
(
" "
)));
if
(
!
startParameters
().
processArgs
.
isEmpty
())
{
QString
args
=
startParameters
().
processArgs
.
join
(
_
(
" "
));
m_engine
->
postCommand
(
"-exec-arguments "
+
args
.
toLocal8Bit
());
}
QFileInfo
fi
(
startParameters
().
executable
);
m_engine
->
postCommand
(
_
(
"-file-exec-and-symbols
\"
%1
\"
"
).
arg
(
fi
.
absoluteFilePath
()),
QByteArray
path
=
fi
.
absoluteFilePath
().
toLocal8Bit
();
m_engine
->
postCommand
(
"-file-exec-and-symbols
\"
"
+
path
+
'"'
,
CB
(
handleFileExecAndSymbols
));
}
...
...
@@ -116,7 +118,7 @@ void PlainGdbAdapter::handleFileExecAndSymbols(const GdbResponse &response)
// Note that successfully preloading the debugging helpers will
// automatically load pthreads, so this will be unnecessary.
if
(
m_engine
->
m_gdbVersion
<
70000
)
m_engine
->
postCommand
(
_
(
"info target"
)
,
CB
(
handleInfoTarget
));
m_engine
->
postCommand
(
"info target"
,
CB
(
handleInfoTarget
));
#endif
emit
inferiorPrepared
();
}
else
{
...
...
@@ -138,7 +140,7 @@ void PlainGdbAdapter::handleInfoTarget(const GdbResponse &response)
if
(
needle
.
indexIn
(
msg
)
!=
-
1
)
{
m_engine
->
m_entryPoint
=
"0x"
+
needle
.
cap
(
1
).
toLatin1
().
rightJustified
(
sizeof
(
void
*
)
*
2
,
'0'
);
m_engine
->
postCommand
(
_
(
"tbreak *0x"
)
+
needle
.
cap
(
1
));
m_engine
->
postCommand
(
"tbreak *0x"
+
needle
.
cap
(
1
)
.
toAscii
()
);
// Do nothing here - inferiorPrepared handles the sequencing.
}
else
{
emit
inferiorStartFailed
(
_
(
"Parsing start address failed"
));
...
...
@@ -152,7 +154,7 @@ void PlainGdbAdapter::handleInfoTarget(const GdbResponse &response)
void
PlainGdbAdapter
::
startInferiorPhase2
()
{
setState
(
InferiorRunningRequested
);
m_engine
->
postCommand
(
_
(
"-exec-run"
)
,
GdbEngine
::
RunRequest
,
CB
(
handleExecRun
));
m_engine
->
postCommand
(
"-exec-run"
,
GdbEngine
::
RunRequest
,
CB
(
handleExecRun
));
}
void
PlainGdbAdapter
::
handleExecRun
(
const
GdbResponse
&
response
)
...
...
src/plugins/debugger/gdb/remotegdbadapter.cpp
View file @
e3712f96
...
...
@@ -155,21 +155,24 @@ void RemoteGdbAdapter::startInferior()
{
QTC_ASSERT
(
state
()
==
InferiorStarting
,
qDebug
()
<<
state
());
m_engine
->
postCommand
(
_
(
"set architecture %1"
)
.
arg
(
startParameters
().
remoteArchitecture
));
m_engine
->
postCommand
(
_
(
"set sysroot %1"
).
arg
(
startParameters
().
sysRoot
));
m_engine
->
postCommand
(
_
(
"set solib-search-path %1"
).
arg
(
QFileInfo
(
startParameters
().
dumperLibrary
).
path
()));
if
(
!
startParameters
().
processArgs
.
isEmpty
())
m_engine
->
postCommand
(
_
(
"-exec-arguments "
)
+
startParameters
().
processArgs
.
join
(
_
(
" "
)));
m_engine
->
postCommand
(
"set architecture "
+
startParameters
().
remoteArchitecture
.
toLatin1
());
m_engine
->
postCommand
(
"set sysroot "
+
startParameters
().
sysRoot
.
toLocal8Bit
());
m_engine
->
postCommand
(
"set solib-search-path "
+
QFileInfo
(
startParameters
().
dumperLibrary
).
path
().
toLocal8Bit
());
if
(
!
startParameters
().
processArgs
.
isEmpty
())
{
QString
args
=
startParameters
().
processArgs
.
join
(
_
(
" "
));
m_engine
->
postCommand
(
"-exec-arguments "
+
args
.
toLocal8Bit
());
}
m_engine
->
postCommand
(
_
(
"set target-async on"
)
,
CB
(
handleSetTargetAsync
));
m_engine
->
postCommand
(
"set target-async on"
,
CB
(
handleSetTargetAsync
));
QString
x
=
startParameters
().
executable
;
QFileInfo
fi
(
startParameters
().
executable
);
QString
fileName
=
fi
.
absoluteFilePath
();
m_engine
->
postCommand
(
_
(
"-file-exec-and-symbols
\"
%1
\"
"
).
arg
(
fileName
),
m_engine
->
postCommand
(
"-file-exec-and-symbols
\"
"
+
fileName
.
toLocal8Bit
()
+
'"'
,
CB
(
handleFileExecAndSymbols
));
}
...
...
@@ -191,7 +194,7 @@ void RemoteGdbAdapter::handleFileExecAndSymbols(const GdbResponse &response)
// (2) starts the remote application
// (3) stops the remote application (early, e.g. in the dynamic linker)
QString
channel
=
startParameters
().
remoteChannel
;
m_engine
->
postCommand
(
_
(
"target remote
%1"
).
arg
(
channel
),
m_engine
->
postCommand
(
"target remote
"
+
channel
.
toLatin1
(
),
CB
(
handleTargetRemote
));
}
else
{
QString
msg
=
tr
(
"Starting remote executable failed:
\n
"
);
...
...
@@ -224,7 +227,7 @@ void RemoteGdbAdapter::startInferiorPhase2()
void
RemoteGdbAdapter
::
interruptInferior
()
{
m_engine
->
postCommand
(
_
(
"-exec-interrupt"
)
)
;
m_engine
->
postCommand
(
"-exec-interrupt"
);
}
void
RemoteGdbAdapter
::
shutdown
()
...
...
src/plugins/debugger/gdb/termgdbadapter.cpp
View file @
e3712f96
...
...
@@ -129,7 +129,8 @@ void TermGdbAdapter::startInferior()
QTC_ASSERT
(
state
()
==
InferiorStarting
,
qDebug
()
<<
state
());
const
qint64
attachedPID
=
m_stubProc
.
applicationPID
();
m_engine
->
handleInferiorPidChanged
(
attachedPID
);
m_engine
->
postCommand
(
_
(
"attach %1"
).
arg
(
attachedPID
),
CB
(
handleStubAttached
));
m_engine
->
postCommand
(
"attach "
+
QByteArray
::
number
(
attachedPID
),
CB
(
handleStubAttached
));
}
void
TermGdbAdapter
::
handleStubAttached
(
const
GdbResponse
&
response
)
...
...
@@ -140,7 +141,7 @@ void TermGdbAdapter::handleStubAttached(const GdbResponse &response)
debugMessage
(
_
(
"INFERIOR ATTACHED"
));
emit
inferiorPrepared
();
#ifdef Q_OS_LINUX
m_engine
->
postCommand
(
_
(
"-stack-list-frames 0 0"
)
,
CB
(
handleEntryPoint
));
m_engine
->
postCommand
(
"-stack-list-frames 0 0"
,
CB
(
handleEntryPoint
));
#endif
}
else
if
(
response
.
resultClass
==
GdbResultError
)
{
QString
msg
=
QString
::
fromLocal8Bit
(
response
.
data
.
findChild
(
"msg"
).
data
());
...
...
src/plugins/debugger/gdb/trkgdbadapter.cpp
View file @
e3712f96
...
...
@@ -1685,15 +1685,15 @@ void TrkGdbAdapter::handleCreateProcess(const TrkResult &result)
logMessage
(
startMsg
);
const
Q
String
fileNam
e
=
m_symbolFile
;
if
(
m_
symbolFile
.
isEmpty
())
{
const
Q
ByteArray
symbolFil
e
=
m_symbolFile
.
toLocal8Bit
()
;
if
(
symbolFile
.
isEmpty
())
{
logMessage
(
_
(
"WARNING: No symbol file available."
));
}
else
{
m_engine
->
postCommand
(
_
(
"add-symbol-file
\"
%1
\"
%2"
).
arg
(
m_
symbolFile
)
.
arg
(
m_session
.
codeseg
));
m_engine
->
postCommand
(
_
(
"symbol-file
\"
%1
\"
"
).
arg
(
m_
symbolFile
)
);
m_engine
->
postCommand
(
"add-symbol-file
\"
"
+
symbolFile
+
"
\"
"
+
QByteArray
::
number
(
m_session
.
codeseg
));
m_engine
->
postCommand
(
"symbol-file
\"
"
+
symbolFile
+
"
\"
"
);
}
m_engine
->
postCommand
(
_
(
"target remote "
)
+
gdbServerName
(),
m_engine
->
postCommand
(
"target remote "
+
gdbServerName
()
.
toLatin1
()
,
CB
(
handleTargetRemote
));
}
...
...
src/plugins/debugger/registerhandler.h
View file @
e3712f96
...
...
@@ -46,10 +46,10 @@ class Register
{
public:
Register
()
:
changed
(
true
)
{}
Register
(
Q
String
const
&
name_
)
:
name
(
name_
),
changed
(
true
)
{}
Register
(
Q
ByteArray
const
&
name_
)
:
name
(
name_
),
changed
(
true
)
{}
public:
Q
String
name
;
Q
ByteArray
name
;
QString
value
;
bool
changed
;
};
...
...
src/plugins/debugger/script/scriptengine.cpp
View file @
e3712f96
...
...
@@ -390,7 +390,7 @@ void ScriptEngine::attemptBreakpointSynchronization()
updateNeeded
=
true
;
}
if
(
data
->
bpNumber
.
isEmpty
())
{
data
->
bpNumber
=
Q
String
::
number
(
index
+
1
);
data
->
bpNumber
=
Q
ByteArray
::
number
(
index
+
1
);
updateNeeded
=
true
;
}
if
(
!
data
->
fileName
.
isEmpty
()
&&
data
->
markerFileName
.
isEmpty
())
{
...
...
@@ -560,7 +560,7 @@ void ScriptEngine::maybeBreakNow(bool byFunction)
// we just run into a breakpoint
//SDEBUG("RESOLVING BREAKPOINT AT " << fileName << lineNumber);
BreakpointData
*
data
=
handler
->
at
(
index
);
data
->
bpLineNumber
=
Q
String
::
number
(
lineNumber
);
data
->
bpLineNumber
=
Q
ByteArray
::
number
(
lineNumber
);
data
->
bpFileName
=
fileName
;
data
->
bpFuncName
=
functionName
;
data
->
markerLineNumber
=
lineNumber
;
...
...
@@ -703,8 +703,8 @@ void ScriptEngine::updateSubItem(const WatchData &data0)
while
(
it
.
hasNext
())
{
it
.
next
();
WatchData
data1
;
data1
.
iname
=
data
.
iname
+
"."
+
it
.
name
();
data1
.
exp
=
it
.
name
();
data1
.
iname
=
data
.
iname
+
"."
+
it
.
name
()
.
toLatin1
()
;
data1
.
exp
=
it
.
name
()
.
toLatin1
()
;
data1
.
name
=
it
.
name
();
data1
.
scriptValue
=
it
.
value
();
if
(
manager
()
->
watchHandler
()
->
isExpandedIName
(
data1
.
iname
))
...
...
src/plugins/debugger/watchhandler.cpp
View file @
e3712f96
...
...
@@ -224,7 +224,7 @@ void WatchData::setType(const QString &str, bool guessChildrenFromType)
void
WatchData
::
setAddress
(
const
QString
&
str
)
{
addr
=
str
;
addr
=
str
.
toLatin1
()
;
}
QString
WatchData
::
toString
()
const
...
...
@@ -349,15 +349,15 @@ WatchModel::WatchModel(WatchHandler *handler, WatchType type)
switch
(
m_type
)
{
case
LocalsWatch
:
m_root
->
iname
=
QLatin1String
(
"local"
)
;
m_root
->
iname
=
"local"
;
m_root
->
name
=
WatchHandler
::
tr
(
"Locals"
);
break
;
case
WatchersWatch
:
m_root
->
iname
=
QLatin1String
(
"watch"
)
;
m_root
->
iname
=
"watch"
;
m_root
->
name
=
WatchHandler
::
tr
(
"Watchers"
);
break
;
case
TooltipsWatch
:
m_root
->
iname
=
QLatin1String
(
"tooltip"
)
;
m_root
->
iname
=
"tooltip"
;
m_root
->
name
=
WatchHandler
::
tr
(
"Tooltip"
);
break
;
}
...
...
@@ -461,11 +461,11 @@ void WatchModel::destroyItem(WatchItem *item)
delete
item
;
}
static
Q
String
parentName
(
const
Q
String
&
iname
)
static
Q
ByteArray
parentName
(
const
Q
ByteArray
&
iname
)
{
int
pos
=
iname
.
lastIndexOf
(
QLatin1Char
(
'.'
)
)
;
int
pos
=
iname
.
lastIndexOf
(
'.'
);
if
(
pos
==
-
1
)
return
Q
String
();
return
Q
ByteArray
();
return
iname
.
left
(
pos
);
}
...
...
@@ -931,9 +931,9 @@ QVariant WatchModel::headerData(int section, Qt::Orientation orientation, int ro
return
QVariant
();
}
struct
IName
:
public
Q
String
struct
IName
:
public
Q
ByteArray
{
IName
(
const
Q
String
&
iname
)
:
Q
String
(
iname
)
{}
IName
(
const
Q
ByteArray
&
iname
)
:
Q
ByteArray
(
iname
)
{}
};
bool
iNameLess
(
const
QString
&
iname1
,
const
QString
&
iname2
)
...
...
@@ -1028,7 +1028,7 @@ void WatchModel::insertBulkData(const QList<WatchData> &list)
//foreach (const WatchItem &data, list)
// qDebug() << "BULK: " << ++bulk << data.toString();
QTC_ASSERT
(
!
list
.
isEmpty
(),
return
);
Q
String
parentIName
=
parentName
(
list
.
at
(
0
).
iname
);
Q
ByteArray
parentIName
=
parentName
(
list
.
at
(
0
).
iname
);
WatchItem
*
parent
=
findItem
(
parentIName
,
m_root
);
if
(
!
parent
)
{
WatchData
parent
;
...
...
@@ -1117,7 +1117,7 @@ void WatchModel::insertBulkData(const QList<WatchData> &list)
dump
();
}
WatchItem
*
WatchModel
::
findItem
(
const
Q
String
&
iname
,
WatchItem
*
root
)
const
WatchItem
*
WatchModel
::
findItem
(
const
Q
ByteArray
&
iname
,
WatchItem
*
root
)
const
{
if
(
root
->
iname
==
iname
)
return
root
;
...
...
@@ -1248,7 +1248,7 @@ void WatchHandler::insertBulkData(const QList<WatchData> &list)
if
(
list
.
isEmpty
())
return
;
QMap
<
Q
String
,
QList
<
WatchData
>
>
hash
;
QMap
<
Q
ByteArray
,
QList
<
WatchData
>
>
hash
;
foreach
(
const
WatchData
&
data
,
list
)
{
// we insert everything, including incomplete stuff
...
...
@@ -1259,7 +1259,7 @@ void WatchHandler::insertBulkData(const QList<WatchData> &list)
qWarning
(
"%s:%d: Attempt to bulk-insert invalid watch item: %s"
,
__FILE__
,
__LINE__
,
qPrintable
(
data
.
toString
()));
}
}
foreach
(
const
Q
String
&
parentIName
,
hash
.
keys
())
{
foreach
(
const
Q
ByteArray
&
parentIName
,
hash
.
keys
())
{
WatchModel
*
model
=
modelForIName
(
parentIName
);
QTC_ASSERT
(
model
,
return
);
model
->
insertBulkData
(
hash
[
parentIName
]);
...
...
@@ -1271,7 +1271,7 @@ void WatchHandler::insertBulkData(const QList<WatchData> &list)
}
}
void
WatchHandler
::
removeData
(
const
Q
String
&
iname
)
void
WatchHandler
::
removeData
(
const
Q
ByteArray
&
iname
)
{
WatchModel
*
model
=
modelForIName
(
iname
);
if
(
!
model
)
...
...
@@ -1287,21 +1287,21 @@ void WatchHandler::watchExpression()
watchExpression
(
action
->
data
().
toString
());
}
Q
String
WatchHandler
::
watcherName
(
const
Q
String
&
exp
)
Q
ByteArray
WatchHandler
::
watcherName
(
const
Q
ByteArray
&
exp
)
{
return
QLatin1String
(
"watch."
)
+
Q
String
::
number
(
m_watcherNames
[
exp
]);
return
"watch."
+
Q
ByteArray
::
number
(
m_watcherNames
[
exp
]);
}
void
WatchHandler
::
watchExpression
(
const
QString
&
exp
)
{
// FIXME: 'exp' can contain illegal characters
m_watcherNames
[
exp
]
=
watcherCounter
++
;
WatchData
data
;
data
.
exp
=
exp
;
data
.
exp
=
exp
.
toLatin1
()
;
data
.
name
=
exp
;
m_watcherNames
[
data
.
exp
]
=
watcherCounter
++
;
if
(
exp
.
isEmpty
()
||
exp
==
watcherEditPlaceHolder
())
data
.
setAllUnneeded
();
data
.
iname
=
watcherName
(
exp
);
data
.
iname
=
watcherName
(
data
.
exp
);
IDebuggerEngine
*
engine
=
m_manager
->
currentEngine
();
if
(
engine
&&
engine
->
isSynchroneous
())
m_manager
->
updateWatchData
(
data
);
...
...
@@ -1392,8 +1392,9 @@ void WatchHandler::removeWatchExpression()
removeWatchExpression
(
action
->
data
().
toString
());
}
void
WatchHandler
::
removeWatchExpression
(
const
QString
&
exp
)
void
WatchHandler
::
removeWatchExpression
(
const
QString
&
exp
0
)