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
9c66c068
Commit
9c66c068
authored
Nov 30, 2009
by
Oswald Buddenhagen
Browse files
mi parser: don't construct dummy tuples, but parse lists directly
parent
b4be611e
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/plugins/debugger/gdb/gdbengine.cpp
View file @
9c66c068
...
...
@@ -155,9 +155,8 @@ static bool parseConsoleStream(const GdbResponse &response, GdbMi *contents)
out
=
out
.
left
(
out
.
lastIndexOf
(
'"'
));
// optimization: dumper output never needs real C unquoting
out
.
replace
(
'\\'
,
""
);
out
=
"dummy={"
+
out
+
"}"
;
contents
->
fromString
(
out
);
contents
->
fromString
Multiple
(
out
);
//qDebug() << "CONTENTS" << contents->toString(true);
return
contents
->
isValid
();
}
...
...
@@ -3584,8 +3583,8 @@ void GdbEngine::handleStackFrame(const GdbResponse &response)
<<
out
.
left
(
pos
);
out
=
out
.
mid
(
pos
);
}
GdbMi
all
(
"["
+
out
+
"]"
)
;
//GdbMi all
(out);
GdbMi
all
;
all
.
fromStringMultiple
(
out
);
//qDebug() << "\n\n\nALL: " << all.toString() << "\n";
GdbMi
locals
=
all
.
findChild
(
"locals"
);
...
...
src/plugins/debugger/gdb/gdbmi.cpp
View file @
9c66c068
...
...
@@ -348,6 +348,13 @@ void GdbMi::fromString(const QByteArray &ba)
parseResultOrValue
(
from
,
to
);
}
void
GdbMi
::
fromStringMultiple
(
const
QByteArray
&
ba
)
{
const
char
*
from
=
ba
.
constBegin
();
const
char
*
to
=
ba
.
constEnd
();
parseTuple_helper
(
from
,
to
);
}
GdbMi
GdbMi
::
findChild
(
const
char
*
name
)
const
{
for
(
int
i
=
0
;
i
<
m_children
.
size
();
++
i
)
...
...
src/plugins/debugger/gdb/gdbmi.h
View file @
9c66c068
...
...
@@ -91,7 +91,6 @@ class GdbMi
{
public:
GdbMi
()
:
m_type
(
Invalid
)
{}
explicit
GdbMi
(
const
QByteArray
&
str
)
{
fromString
(
str
);
}
QByteArray
m_name
;
QByteArray
m_data
;
...
...
@@ -126,6 +125,7 @@ public:
QByteArray
toString
(
bool
multiline
=
false
,
int
indent
=
0
)
const
;
void
fromString
(
const
QByteArray
&
str
);
void
fromStringMultiple
(
const
QByteArray
&
str
);
void
setStreamOutput
(
const
QByteArray
&
name
,
const
QByteArray
&
content
);
private:
...
...
src/plugins/debugger/watchutils.cpp
View file @
9c66c068
...
...
@@ -975,11 +975,8 @@ bool QtDumperHelper::parseQuery(const GdbMi &contents, Debugger debugger)
// parse a query
bool
QtDumperHelper
::
parseQuery
(
const
char
*
data
,
Debugger
debugger
)
{
QByteArray
fullData
=
data
;
fullData
.
insert
(
0
,
'{'
);
fullData
.
append
(
data
);
fullData
.
append
(
'}'
);
GdbMi
root
(
fullData
);
GdbMi
root
;
root
.
fromStringMultiple
(
QByteArray
(
data
));
if
(
!
root
.
isValid
())
return
false
;
return
parseQuery
(
root
,
debugger
);
...
...
@@ -1475,11 +1472,8 @@ bool QtDumperHelper::parseValue(const char *data,
QList
<
WatchData
>
*
l
)
{
l
->
clear
();
QByteArray
fullData
=
data
;
fullData
.
insert
(
0
,
'{'
);
fullData
.
append
(
data
);
fullData
.
append
(
'}'
);
GdbMi
root
(
fullData
);
GdbMi
root
;
root
.
fromStringMultiple
(
QByteArray
(
data
));
if
(
!
root
.
isValid
())
return
false
;
gbdMiToWatchData
(
root
,
GdbMiRecursionContext
(),
l
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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