From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15912 invoked by alias); 15 Dec 2001 04:17:31 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 15326 invoked from network); 15 Dec 2001 04:16:12 -0000 Received: from unknown (HELO crocodile-dances.eterna.com.au) (203.15.111.99) by sources.redhat.com with SMTP; 15 Dec 2001 04:16:12 -0000 Received: by crocodile-dances.eterna.com.au (Postfix, from userid 127) id 3CDCA17EEB; Sat, 15 Dec 2001 15:15:59 +1100 (EST) Received: from cygnus.com (localhost [127.0.0.1]) by crocodile-dances.eterna.com.au (Postfix) with ESMTP id 19E7B5B83D; Sat, 15 Dec 2001 15:15:59 +1100 (EST) To: Andrew Cagney Cc: gdb-patches@sources.redhat.com subject: re: [patch]: 2 more needed changes for sim-fpu.c & psim in-reply-to: your message of "Fri, 14 Dec 2001 11:44:13 -0800." <3C1A568D.3020300@cygnus.com> organisation: Red Hat, Asia-Pacific. Date: Fri, 14 Dec 2001 20:17:00 -0000 Message-ID: <7.1008389753@cygnus.com> From: matthew green X-SW-Source: 2001-12/txt/msg00394.txt.bz2 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 #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); }