2 /* Debug macros for developemnt.
4 Free Software Foundation, Inc.
6 This file is part of GDB.
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
31 #ifdef ANSI_PROTOTYPES
43 static FILE *fout
= NULL
;
44 static char fname
[128];
45 static int file_cnt
= 0; /* count number of open files */
48 puts_dbg (const char *data
)
52 fdbg
= fopen ("dbg.log", "a+");
59 /* Can't easily get the message back to gdb... write to a log instead. */
61 fputs_dbg (const char *data
, FILE * fakestream
)
67 if (fakestream
== stdout
|| fakestream
== stderr
|| fakestream
== NULL
)
71 for (file_cnt
= 0; file_cnt
< 20; file_cnt
++)
73 sprintf (fname
, "dbg%d.log", file_cnt
);
74 if ((fout
= fopen (fname
), "r") != NULL
)
79 fout
= fopen (fname
, "w");
85 fprintf (fakestream
, data
);
91 printf_dbg (const char *format
,...)
95 va_start (args
, format
);
96 vsprintf (buf
, format
, args
);
This page took 0.032398 seconds and 5 git commands to generate.