projects
/
mono.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #3622 from rolfbjarne/remove-stray-file
[mono.git]
/
mono
/
dis
/
dis-cil.c
diff --git
a/mono/dis/dis-cil.c
b/mono/dis/dis-cil.c
old mode 100644
(file)
new mode 100755
(executable)
index
d7bbe6b
..
bc40414
--- a/
mono/dis/dis-cil.c
+++ b/
mono/dis/dis-cil.c
@@
-17,34
+17,11
@@
#include "get.h"
#include "dump.h"
#include "dis-cil.h"
#include "get.h"
#include "dump.h"
#include "dis-cil.h"
+#include "util.h"
#include "mono/metadata/opcodes.h"
#include "mono/metadata/opcodes.h"
+#include "mono/metadata/class-internals.h"
#include "mono/utils/mono-compiler.h"
#include "mono/utils/mono-compiler.h"
-#ifndef HAVE_ISINF
-
-#ifdef HAVE_IEEEFP_H
-#include <ieeefp.h>
-int isinf (double);
-int
-isinf (double num)
-{
- fpclass_t klass;
-
- klass = fpclass (num);
- if (klass == FP_NINF)
- return -1;
-
- if (klass == FP_PINF)
- return 1;
-
- return 0;
-}
-#else
-#error "Don't know how to implement isinf for this platform."
-#endif
-
-#endif
-
#define CODE_INDENT g_assert (indent_level < 512); \
indent[indent_level*2] = ' '; \
indent[indent_level*2+1] = ' '; \
#define CODE_INDENT g_assert (indent_level < 512); \
indent[indent_level*2] = ' '; \
indent[indent_level*2+1] = ' '; \
@@
-55,7
+32,7
@@
isinf (double num)
indent[indent_level*2] = 0;
void
indent[indent_level*2] = 0;
void
-disassemble_cil (MonoImage *m, MonoMethodHeader *mh, MonoGenericCont
ext *context
)
+disassemble_cil (MonoImage *m, MonoMethodHeader *mh, MonoGenericCont
ainer *container
)
{
const unsigned char *start = mh->code;
int size = mh->code_size;
{
const unsigned char *start = mh->code;
int size = mh->code_size;
@@
-79,7
+56,7
@@
disassemble_cil (MonoImage *m, MonoMethodHeader *mh, MonoGenericContext *context
#endif
if (mh->num_clauses) {
#endif
if (mh->num_clauses) {
- trys = g_malloc0 (sizeof (gboolean) * mh->num_clauses);
+ trys =
(gboolean *)
g_malloc0 (sizeof (gboolean) * mh->num_clauses);
trys [0] = 1;
for (i=1; i < mh->num_clauses; ++i) {
#define jcl mh->clauses [j]
trys [0] = 1;
for (i=1; i < mh->num_clauses; ++i) {
#define jcl mh->clauses [j]
@@
-110,7
+87,7
@@
disassemble_cil (MonoImage *m, MonoMethodHeader *mh, MonoGenericContext *context
} else {
char * klass = mh->clauses[i].flags ? g_strdup ("") :
dis_stringify_object_with_class (m, mh->clauses[i].data.catch_class,
} else {
char * klass = mh->clauses[i].flags ? g_strdup ("") :
dis_stringify_object_with_class (m, mh->clauses[i].data.catch_class,
-
FALS
E, FALSE);
+
TRU
E, FALSE);
fprintf (output, "\t%s%s %s { // %d\n", indent,
clause_names [mh->clauses[i].flags], klass, i);
g_free (klass);
fprintf (output, "\t%s%s %s { // %d\n", indent,
clause_names [mh->clauses[i].flags], klass, i);
g_free (klass);
@@
-149,7
+126,7
@@
disassemble_cil (MonoImage *m, MonoMethodHeader *mh, MonoGenericContext *context
guint32 token = read32 (ptr);
char *s;
guint32 token = read32 (ptr);
char *s;
- s = get_field (m, token, cont
ext
);
+ s = get_field (m, token, cont
ainer
);
fprintf (output, "%s", s);
g_free (s);
ptr += 4;
fprintf (output, "%s", s);
g_free (s);
ptr += 4;
@@
-176,7
+153,7
@@
disassemble_cil (MonoImage *m, MonoMethodHeader *mh, MonoGenericContext *context
guint32 token = read32 (ptr);
char *s;
guint32 token = read32 (ptr);
char *s;
- s = get_method (m, token, cont
ext
);
+ s = get_method (m, token, cont
ainer
);
fprintf (output, "%s", s);
g_free (s);
ptr += 4;
fprintf (output, "%s", s);
g_free (s);
ptr += 4;
@@
-190,16
+167,16
@@
disassemble_cil (MonoImage *m, MonoMethodHeader *mh, MonoGenericContext *context
double r;
int inf;
readr8 (ptr, &r);
double r;
int inf;
readr8 (ptr, &r);
- inf = isinf (r);
+ inf =
dis_
isinf (r);
if (inf == -1)
fprintf (output, "(00 00 00 00 00 00 f0 ff)"); /* negative infinity */
else if (inf == 1)
fprintf (output, "(00 00 00 00 00 00 f0 7f)"); /* positive infinity */
if (inf == -1)
fprintf (output, "(00 00 00 00 00 00 f0 ff)"); /* negative infinity */
else if (inf == 1)
fprintf (output, "(00 00 00 00 00 00 f0 7f)"); /* positive infinity */
- else if (isnan (r))
+ else if (
dis_
isnan (r))
fprintf (output, "(00 00 00 00 00 00 f8 ff)"); /* NaN */
else {
char *str = stringify_double (r);
fprintf (output, "(00 00 00 00 00 00 f8 ff)"); /* NaN */
else {
char *str = stringify_double (r);
- fprintf (output, str);
+ fprintf (output,
"%s",
str);
g_free (str);
}
ptr += 8;
g_free (str);
}
ptr += 8;
@@
-218,7
+195,7
@@
disassemble_cil (MonoImage *m, MonoMethodHeader *mh, MonoGenericContext *context
const char *us_ptr = mono_metadata_user_string (m, token & 0xffffff);
int len = mono_metadata_decode_blob_size (us_ptr, (const char**)&us_ptr);
const char *us_ptr = mono_metadata_user_string (m, token & 0xffffff);
int len = mono_metadata_decode_blob_size (us_ptr, (const char**)&us_ptr);
- char *s = get_encoded_user_string_or_bytearray (us_ptr, len);
+ char *s = get_encoded_user_string_or_bytearray (
(const guchar*)
us_ptr, len);
/*
* See section 23.1.4 on the encoding of the #US heap
/*
* See section 23.1.4 on the encoding of the #US heap
@@
-252,7
+229,7
@@
disassemble_cil (MonoImage *m, MonoMethodHeader *mh, MonoGenericContext *context
guint32 token = read32 (ptr);
char *s;
guint32 token = read32 (ptr);
char *s;
- s = get_token (m, token, cont
ext
);
+ s = get_token (m, token, cont
ainer
);
fprintf (output, "%s", s);
g_free (s);
fprintf (output, "%s", s);
g_free (s);
@@
-262,7
+239,7
@@
disassemble_cil (MonoImage *m, MonoMethodHeader *mh, MonoGenericContext *context
case MonoInlineType: {
guint32 token = read32 (ptr);
case MonoInlineType: {
guint32 token = read32 (ptr);
- char *s = get_token_type (m, token, cont
ext
);
+ char *s = get_token_type (m, token, cont
ainer
);
fprintf (output, "%s", s);
g_free (s);
ptr += 4;
fprintf (output, "%s", s);
g_free (s);
ptr += 4;
@@
-299,16
+276,16
@@
disassemble_cil (MonoImage *m, MonoMethodHeader *mh, MonoGenericContext *context
readr4 (ptr, &f);
readr4 (ptr, &f);
- inf = isinf (f);
+ inf =
dis_
isinf (f);
if (inf == -1)
fprintf (output, "(00 00 80 ff)"); /* negative infinity */
else if (inf == 1)
fprintf (output, "(00 00 80 7f)"); /* positive infinity */
if (inf == -1)
fprintf (output, "(00 00 80 ff)"); /* negative infinity */
else if (inf == 1)
fprintf (output, "(00 00 80 7f)"); /* positive infinity */
- else if (isnan (f))
+ else if (
dis_
isnan (f))
fprintf (output, "(00 00 c0 ff)"); /* NaN */
else {
char *str = stringify_double ((double) f);
fprintf (output, "(00 00 c0 ff)"); /* NaN */
else {
char *str = stringify_double ((double) f);
- fprintf (output, str);
+ fprintf (output,
"%s",
str);
g_free (str);
}
ptr += 4;
g_free (str);
}
ptr += 4;