[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[dotgnu-pnet-commits] libjit ./ChangeLog jit/jit-dump.c
From: |
Aleksey Demakov |
Subject: |
[dotgnu-pnet-commits] libjit ./ChangeLog jit/jit-dump.c |
Date: |
Thu, 04 May 2006 06:35:45 +0000 |
CVSROOT: /sources/dotgnu-pnet
Module name: libjit
Branch:
Changes by: Aleksey Demakov <address@hidden> 06/05/04 06:35:45
Modified files:
. : ChangeLog
jit : jit-dump.c
Log message:
make dump work for any stream not just stdout and stderr
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/dotgnu-pnet/libjit/ChangeLog.diff?tr1=1.223&tr2=1.224&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/dotgnu-pnet/libjit/jit/jit-dump.c.diff?tr1=1.12&tr2=1.13&r1=text&r2=text
Patches:
Index: libjit/ChangeLog
diff -u libjit/ChangeLog:1.223 libjit/ChangeLog:1.224
--- libjit/ChangeLog:1.223 Mon May 1 11:11:32 2006
+++ libjit/ChangeLog Thu May 4 06:35:45 2006
@@ -1,3 +1,8 @@
+2006-05-04 Radek Polak <address@hidden>
+
+ * jit/jit-dump.c (dump_object_code): Now can dump to any stream
+ not just stdout and stderr.
+
2006-05-01 Aleksey Demakov <address@hidden>
* jit/jit-rules-x86.sel, jit/jit-rules-x86.ins: fix problem with
Index: libjit/jit/jit-dump.c
diff -u libjit/jit/jit-dump.c:1.12 libjit/jit/jit-dump.c:1.13
--- libjit/jit/jit-dump.c:1.12 Fri Jan 13 15:39:26 2006
+++ libjit/jit/jit-dump.c Thu May 4 06:35:45 2006
@@ -641,14 +641,14 @@
#else /* !JIT_BACKEND_INTERP */
/*
- * Dump the native object code representation of a function.
- * Can only dump to stdout or stderr at the moment.
+ * Dump the native object code representation of a function to stream.
*/
static void dump_object_code(FILE *stream, void *start, void *end)
{
char cmdline[BUFSIZ];
unsigned char *pc = (unsigned char *)start;
FILE *file;
+ int ch;
#if JIT_WIN32_PLATFORM
/*
@@ -693,9 +693,18 @@
fclose(file);
sprintf(cmdline, "as %s -o %s", s_path, o_path);
system(cmdline);
- sprintf(cmdline, "objdump --adjust-vma=%ld -d %s%s",
- (long)(jit_nint)start, o_path, (stream == stderr ? "
1>&2" : ""));
+ sprintf(cmdline, "objdump --adjust-vma=%ld -d %s > %s",
+ (long)(jit_nint)start, o_path, s_path);
system(cmdline);
+ file = fopen(s_path, "r");
+ if(file)
+ {
+ while((ch = getc(file)) != EOF)
+ {
+ putc(ch, stream);
+ }
+ fclose(file);
+ }
unlink(s_path);
unlink(o_path);
putc('\n', stream);
@@ -706,7 +715,7 @@
/*@
* @deftypefun void jit_dump_function ({FILE *} stream, jit_function_t func,
{const char *} name)
- * Dump the three-address instructions within a function to a stdio stream.
+ * Dump the three-address instructions within a function to a stream.
* The @code{name} is attached to the output as a friendly label, but
* has no other significance.
*
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [dotgnu-pnet-commits] libjit ./ChangeLog jit/jit-dump.c,
Aleksey Demakov <=