* [patch]: 2 more needed changes for sim-fpu.c & psim
@ 2001-12-13 17:30 matthew green
2001-12-14 14:41 ` Andrew Cagney
0 siblings, 1 reply; 4+ messages in thread
From: matthew green @ 2001-12-13 17:30 UTC (permalink / raw)
To: gdb-patches
these provide the missing sim_io_error function that's required for
sim-fpu.c to actually link & be used.
OK?
.mrg.
2001-12-14 matthew green <mrg@redhat.com>
* main.c: Include "defs.h", "bfd.h", "callback.h" and "remote-sim.h".
(sim_io_error): New function.
* sim_calls.c: (sim_io_error): New function.
Index: main.c
===================================================================
RCS file: /cvs/src/src/sim/ppc/main.c,v
retrieving revision 1.1.1.1
diff -p -r1.1.1.1 main.c
*** main.c 1999/04/16 01:35:11 1.1.1.1
--- main.c 2001/12/14 01:11:24
***************
*** 30,35 ****
--- 30,40 ----
#include "device.h" /* FIXME: psim should provide the interface */
#include "events.h" /* FIXME: psim should provide the interface */
+ #include "defs.h"
+ #include "bfd.h"
+ #include "callback.h"
+ #include "remote-sim.h"
+
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
*************** sim_io_flush_stdoutput(void)
*** 220,225 ****
--- 225,248 ----
error("sim_io_flush_stdoutput: invalid switch\n");
break;
}
+ }
+
+ void
+ sim_io_error (SIM_DESC sd, const char *msg, ...)
+ {
+ va_list ap;
+ va_start(ap, msg);
+ vprintf(msg, ap);
+ printf("\n");
+ va_end(ap);
+
+ #if 0 /* FIXME: `simulation' is static to ppc/main.c */
+ /* any final clean up */
+ if (ppc_trace[trace_print_info] && simulation != NULL)
+ psim_print_info (simulation, ppc_trace[trace_print_info]);
+ #endif
+
+ exit (1);
}
Index: sim_calls.c
===================================================================
RCS file: /cvs/src/src/sim/ppc/sim_calls.c,v
retrieving revision 1.2
diff -p -r1.2 sim_calls.c
*** sim_calls.c 2000/12/08 01:52:41 1.2
--- sim_calls.c 2001/12/14 01:11:28
*************** sim_io_flush_stdoutput(void)
*** 441,446 ****
--- 441,464 ----
}
}
+ void
+ sim_io_error (SIM_DESC sd, const char *msg, ...)
+ {
+ va_list ap;
+ va_start(ap, msg);
+ vprintf(msg, ap);
+ printf("\n");
+ va_end(ap);
+
+ #if 0 /* FIXME: `simulation' is static to ppc/main.c */
+ /* any final clean up */
+ if (ppc_trace[trace_print_info] && simulation != NULL)
+ psim_print_info (simulation, ppc_trace[trace_print_info]);
+ #endif
+
+ exit (1);
+ }
+
/****/
void *
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [patch]: 2 more needed changes for sim-fpu.c & psim
2001-12-13 17:30 [patch]: 2 more needed changes for sim-fpu.c & psim matthew green
@ 2001-12-14 14:41 ` Andrew Cagney
2001-12-14 20:17 ` matthew green
0 siblings, 1 reply; 4+ messages in thread
From: Andrew Cagney @ 2001-12-14 14:41 UTC (permalink / raw)
To: matthew green; +Cc: gdb-patches
> + #include "defs.h"
> + #include "bfd.h"
> + #include "callback.h"
> + #include "remote-sim.h"
I'm puzzled by some of the includes. Well "defs.h" to be honest. I
know the PPC has a nasty hack so that it can access the GDB register
names but I'm not sure that main.c - a standalone program - should
include "defs.h".
> #ifdef HAVE_STDLIB_H
> #include <stdlib.h>
> #endif
> *************** sim_io_flush_stdoutput(void)
> *** 220,225 ****
> --- 225,248 ----
> error("sim_io_flush_stdoutput: invalid switch\n");
> break;
> }
> + }
> +
> + void
> + sim_io_error (SIM_DESC sd, const char *msg, ...)
> + {
> + va_list ap;
> + va_start(ap, msg);
> + vprintf(msg, ap);
> + printf("\n");
> + va_end(ap);
I think the error stuff should go to stderr.
From memory, for the sim_call.c, the error stuff should go to the callback.
Andrew
^ permalink raw reply [flat|nested] 4+ messages in thread
* re: [patch]: 2 more needed changes for sim-fpu.c & psim
2001-12-14 14:41 ` Andrew Cagney
@ 2001-12-14 20:17 ` matthew green
2001-12-14 21:01 ` Andrew Cagney
0 siblings, 1 reply; 4+ messages in thread
From: matthew green @ 2001-12-14 20:17 UTC (permalink / raw)
To: Andrew Cagney; +Cc: gdb-patches
I'm puzzled by some of the includes. Well "defs.h" to be honest. I
know the PPC has a nasty hack so that it can access the GDB register
names but I'm not sure that main.c - a standalone program - should
include "defs.h".
main.c doesn't need defs.h, right.
I think the error stuff should go to stderr.
hmm, i choose stdout because the "error" function a couple of pages
above does the same...
From memory, for the sim_call.c, the error stuff should go to the callback.
OK, i've done this.. how's this?
* main.c: Include "bfd.h", "callback.h" and "remote-sim.h".
(sim_io_error): New function.
* sim_calls.c: (sim_io_error): New function.
Index: sim_calls.c
===================================================================
RCS file: /cvs/src/src/sim/ppc/sim_calls.c,v
retrieving revision 1.2
diff -p -r1.2 sim_calls.c
*** sim_calls.c 2000/12/08 01:52:41 1.2
--- sim_calls.c 2001/12/15 04:14:35
*************** sim_io_flush_stdoutput(void)
*** 441,446 ****
--- 441,456 ----
}
}
+ void
+ sim_io_error (SIM_DESC sd, const char *fmt, ...)
+ {
+ va_list ap;
+ va_start(ap, fmt);
+ callbacks->evprintf_filtered (callbacks, fmt, ap);
+ va_end(ap);
+ callbacks->error (callbacks, "");
+ }
+
/****/
void *
Index: main.c
===================================================================
RCS file: /cvs/src/src/sim/ppc/main.c,v
retrieving revision 1.1.1.1
diff -p -r1.1.1.1 main.c
*** main.c 1999/04/16 01:35:11 1.1.1.1
--- main.c 2001/12/15 04:14:35
***************
*** 30,35 ****
--- 30,39 ----
#include "device.h" /* FIXME: psim should provide the interface */
#include "events.h" /* FIXME: psim should provide the interface */
+ #include "bfd.h"
+ #include "callback.h"
+ #include "remote-sim.h"
+
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
*************** sim_io_flush_stdoutput(void)
*** 220,225 ****
--- 224,245 ----
error("sim_io_flush_stdoutput: invalid switch\n");
break;
}
+ }
+
+ void
+ sim_io_error (SIM_DESC sd, const char *msg, ...)
+ {
+ va_list ap;
+ va_start(ap, msg);
+ vprintf(msg, ap);
+ printf("\n");
+ va_end(ap);
+
+ /* any final clean up */
+ if (ppc_trace[trace_print_info] && simulation != NULL)
+ psim_print_info (simulation, ppc_trace[trace_print_info]);
+
+ exit (1);
}
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [patch]: 2 more needed changes for sim-fpu.c & psim
2001-12-14 20:17 ` matthew green
@ 2001-12-14 21:01 ` Andrew Cagney
0 siblings, 0 replies; 4+ messages in thread
From: Andrew Cagney @ 2001-12-14 21:01 UTC (permalink / raw)
To: matthew green; +Cc: gdb-patches
> I'm puzzled by some of the includes. Well "defs.h" to be honest. I
> know the PPC has a nasty hack so that it can access the GDB register
> names but I'm not sure that main.c - a standalone program - should
> include "defs.h".
>
> main.c doesn't need defs.h, right.
>
> I think the error stuff should go to stderr.
>
> hmm, i choose stdout because the "error" function a couple of pages
> above does the same...
Ah, ok then.
> From memory, for the sim_call.c, the error stuff should go to the callback.
>
> OK, i've done this.. how's this?
>
>
>
> * main.c: Include "bfd.h", "callback.h" and "remote-sim.h".
> (sim_io_error): New function.
> * sim_calls.c: (sim_io_error): New function.
>
Yes fine.
Thanks!
Andrew
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2001-12-15 5:01 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-12-13 17:30 [patch]: 2 more needed changes for sim-fpu.c & psim matthew green
2001-12-14 14:41 ` Andrew Cagney
2001-12-14 20:17 ` matthew green
2001-12-14 21:01 ` Andrew Cagney
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox