forked from qt-creator/qt-creator
debugger: properly display function pointers with python
This commit is contained in:
@@ -1023,9 +1023,17 @@ class Dumper:
|
|||||||
|
|
||||||
|
|
||||||
elif type.code == gdb.TYPE_CODE_PTR:
|
elif type.code == gdb.TYPE_CODE_PTR:
|
||||||
isHandled = False
|
|
||||||
#warn("A POINTER: %s" % value.type)
|
#warn("A POINTER: %s" % value.type)
|
||||||
if self.useFancy:
|
isHandled = False
|
||||||
|
|
||||||
|
if str(type.strip_typedefs()).find("(") != -1:
|
||||||
|
self.putValue(str(item.value))
|
||||||
|
self.put('addr="%s",' % cleanAddress(value.address))
|
||||||
|
self.putType(item.value.type)
|
||||||
|
self.putNumChild(0)
|
||||||
|
isHandled = True
|
||||||
|
|
||||||
|
if (not isHandled) and self.useFancy:
|
||||||
if isNull(value):
|
if isNull(value):
|
||||||
self.putValue("0x0")
|
self.putValue("0x0")
|
||||||
self.putType(item.value.type)
|
self.putType(item.value.type)
|
||||||
|
|||||||
@@ -380,6 +380,7 @@ QByteArray TrkGdbAdapter::trkStepRangeMessage()
|
|||||||
if (m_snapshot.stepOver)
|
if (m_snapshot.stepOver)
|
||||||
option = 0x11; // Step over.
|
option = 0x11; // Step over.
|
||||||
if (from <= pc && pc <= to) {
|
if (from <= pc && pc <= to) {
|
||||||
|
//to = qMax(to - 4, from);
|
||||||
//to = qMax(to - 4, from);
|
//to = qMax(to - 4, from);
|
||||||
debugMessage("STEP IN " + hexxNumber(from) + " " + hexxNumber(to)
|
debugMessage("STEP IN " + hexxNumber(from) + " " + hexxNumber(to)
|
||||||
+ " INSTEAD OF " + hexxNumber(pc));
|
+ " INSTEAD OF " + hexxNumber(pc));
|
||||||
|
|||||||
@@ -231,6 +231,14 @@ void testAnonymous()
|
|||||||
a.i = 3;
|
a.i = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void testFunctionPointer()
|
||||||
|
{
|
||||||
|
typedef void (*func_t)();
|
||||||
|
func_t f1 = testAnonymous;
|
||||||
|
func_t f2 = testFunctionPointer;
|
||||||
|
func_t f3 = testFunctionPointer;
|
||||||
|
}
|
||||||
|
|
||||||
void testQByteArray()
|
void testQByteArray()
|
||||||
{
|
{
|
||||||
QByteArray ba = "Hello";
|
QByteArray ba = "Hello";
|
||||||
@@ -1434,6 +1442,7 @@ int testReference()
|
|||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
testFunctionPointer();
|
||||||
testAnonymous();
|
testAnonymous();
|
||||||
testReference();
|
testReference();
|
||||||
//testEndlessRecursion();
|
//testEndlessRecursion();
|
||||||
|
|||||||
Reference in New Issue
Block a user