Commit cdfbf4bb authored by hjk's avatar hjk
Browse files

debugger: don't try to extract address of temporary expressions

They don't "live" in the inferior, so there is no real address.
parent c6d4ff53
......@@ -1418,8 +1418,11 @@ class Dumper:
def putPointerValue(self, value):
# Use a lower priority
self.putValue("0x%x" % value.dereference().cast(
lookupType("unsigned long")), None, -1)
if value is None:
self.putValue(" ", None, -1)
else:
self.putValue("0x%x" % value.dereference().cast(
lookupType("unsigned long")), None, -1)
def putStringValue(self, value):
if not value is None:
......
......@@ -2030,7 +2030,40 @@ void testChar()
strcat(s,"\""); // add a quote
}
struct Tx
{
Tx() { data = new char[20](); data[0] = '1'; }
char *GetStringPtr() const
{
return data;
}
char *data;
};
struct Ty
{
void doit()
{
int i = 1;
i = 2;
i = 2;
i = 2;
i = 2;
}
Tx m_buffer;
};
void testStuff()
{
Ty x;
x.doit();
char *s = x.m_buffer.GetStringPtr();
}
void testStuff3()
{
typedef unsigned char byte;
byte f = '2';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment