Commit 3333ea8d authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

winedump: Added support for dumping long long constants.

parent 076dcc84
...@@ -57,14 +57,20 @@ static const char* p_string(const struct p_string* s) ...@@ -57,14 +57,20 @@ static const char* p_string(const struct p_string* s)
return tmp; return tmp;
} }
static int numeric_leaf(int* value, const unsigned short int* leaf) union full_value
{
int i;
long long unsigned llu;
};
static int full_numeric_leaf(union full_value* fv, const unsigned short int* leaf)
{ {
unsigned short int type = *leaf++; unsigned short int type = *leaf++;
int length = 2; int length = 2;
if (type < LF_NUMERIC) if (type < LF_NUMERIC)
{ {
*value = type; fv->i = type;
} }
else else
{ {
...@@ -72,105 +78,117 @@ static int numeric_leaf(int* value, const unsigned short int* leaf) ...@@ -72,105 +78,117 @@ static int numeric_leaf(int* value, const unsigned short int* leaf)
{ {
case LF_CHAR: case LF_CHAR:
length += 1; length += 1;
*value = *(const char*)leaf; fv->i = *(const char*)leaf;
break; break;
case LF_SHORT: case LF_SHORT:
length += 2; length += 2;
*value = *(const short*)leaf; fv->i = *(const short*)leaf;
break; break;
case LF_USHORT: case LF_USHORT:
length += 2; length += 2;
*value = *(const unsigned short*)leaf; fv->i = *(const unsigned short*)leaf;
break; break;
case LF_LONG: case LF_LONG:
length += 4; length += 4;
*value = *(const int*)leaf; fv->i = *(const int*)leaf;
break; break;
case LF_ULONG: case LF_ULONG:
length += 4; length += 4;
*value = *(const unsigned int*)leaf; fv->i = *(const unsigned int*)leaf;
break; break;
case LF_QUADWORD: case LF_QUADWORD:
length += 8;
fv->llu = *(const long long int*)leaf;
break;
case LF_UQUADWORD: case LF_UQUADWORD:
length += 8; length += 8;
printf(">>> unsupported leaf value\n"); fv->llu = *(const long long unsigned int*)leaf;
*value = 0; /* FIXME */
break; break;
case LF_REAL32: case LF_REAL32:
length += 4; length += 4;
printf(">>> unsupported leaf value\n"); printf(">>> unsupported leaf value %04x\n", type);
*value = 0; /* FIXME */ fv->i = 0; /* FIXME */
break; break;
case LF_REAL48: case LF_REAL48:
length += 6; length += 6;
*value = 0; /* FIXME */ fv->i = 0; /* FIXME */
printf(">>> unsupported leaf value\n"); printf(">>> unsupported leaf value %04x\n", type);
break; break;
case LF_REAL64: case LF_REAL64:
length += 8; length += 8;
*value = 0; /* FIXME */ fv->i = 0; /* FIXME */
printf(">>> unsupported leaf value\n"); printf(">>> unsupported leaf value %04x\n", type);
break; break;
case LF_REAL80: case LF_REAL80:
length += 10; length += 10;
*value = 0; /* FIXME */ fv->i = 0; /* FIXME */
printf(">>> unsupported leaf value\n"); printf(">>> unsupported leaf value %04x\n", type);
break; break;
case LF_REAL128: case LF_REAL128:
length += 16; length += 16;
*value = 0; /* FIXME */ fv->i = 0; /* FIXME */
printf(">>> unsupported leaf value\n"); printf(">>> unsupported leaf value %04x\n", type);
break; break;
case LF_COMPLEX32: case LF_COMPLEX32:
length += 4; length += 4;
*value = 0; /* FIXME */ fv->i = 0; /* FIXME */
printf(">>> unsupported leaf value\n"); printf(">>> unsupported leaf value %04x\n", type);
break; break;
case LF_COMPLEX64: case LF_COMPLEX64:
length += 8; length += 8;
*value = 0; /* FIXME */ fv->i = 0; /* FIXME */
printf(">>> unsupported leaf value\n"); printf(">>> unsupported leaf value %04x\n", type);
break; break;
case LF_COMPLEX80: case LF_COMPLEX80:
length += 10; length += 10;
*value = 0; /* FIXME */ fv->i = 0; /* FIXME */
printf(">>> unsupported leaf value\n"); printf(">>> unsupported leaf value %04x\n", type);
break; break;
case LF_COMPLEX128: case LF_COMPLEX128:
length += 16; length += 16;
*value = 0; /* FIXME */ fv->i = 0; /* FIXME */
printf(">>> unsupported leaf value\n"); printf(">>> unsupported leaf value %04x\n", type);
break; break;
case LF_VARSTRING: case LF_VARSTRING:
length += 2 + *leaf; length += 2 + *leaf;
*value = 0; /* FIXME */ fv->i = 0; /* FIXME */
printf(">>> unsupported leaf value\n"); printf(">>> unsupported leaf value %04x\n", type);
break; break;
default: default:
printf(">>> Unsupported numeric leaf-id %04x\n", type); printf(">>> Unsupported numeric leaf-id %04x\n", type);
*value = 0; fv->i = 0;
break; break;
} }
} }
return length; return length;
} }
static int numeric_leaf(int* value, const unsigned short int* leaf)
{
union full_value fv;
int len = len = full_numeric_leaf(&fv, leaf);
*value = fv.i;
return len;
}
static const char* get_attr(unsigned attr) static const char* get_attr(unsigned attr)
{ {
static char tmp[256]; static char tmp[256];
...@@ -1149,23 +1167,25 @@ int codeview_dump_symbols(const void* root, unsigned long size) ...@@ -1149,23 +1167,25 @@ int codeview_dump_symbols(const void* root, unsigned long size)
case S_CONSTANT_V2: case S_CONSTANT_V2:
{ {
int val, vlen; int vlen;
union full_value fv;
vlen = numeric_leaf(&val, &sym->constant_v2.cvalue); vlen = full_numeric_leaf(&fv, &sym->constant_v2.cvalue);
printf("\tS-Constant V2 '%s' = %u type:%x\n", printf("\tS-Constant V2 '%s' = 0x%x%08x type:%x\n",
p_string(PSTRING(&sym->constant_v2.cvalue, vlen)), p_string(PSTRING(&sym->constant_v2.cvalue, vlen)),
val, sym->constant_v2.type); (unsigned)(fv.llu >> 32), (unsigned)fv.llu, sym->constant_v2.type);
} }
break; break;
case S_CONSTANT_V3: case S_CONSTANT_V3:
{ {
int val, vlen; int vlen;
union full_value fv;
vlen = numeric_leaf(&val, &sym->constant_v3.cvalue); vlen = full_numeric_leaf(&fv, &sym->constant_v3.cvalue);
printf("\tS-Constant V3 '%s' = %u type:%x\n", printf("\tS-Constant V3 '%s' = 0x%x%08x type:%x\n",
(const char*)&sym->constant_v3.cvalue + vlen, (const char*)&sym->constant_v3.cvalue + vlen,
val, sym->constant_v3.type); (unsigned)(fv.llu >> 32), (unsigned)fv.llu, sym->constant_v3.type);
} }
break; break;
......
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