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. */
37 static FILE *fout
= NULL
;
38 static char fname
[128];
39 static int file_cnt
= 0; /* count number of open files */
47 fdbg
= fopen ("dbg.log", "a+");
54 /* Can't easily get the message back to gdb... write to a log instead. */
56 fputs_dbg (data
, fakestream
)
64 if (fakestream
== stdout
|| fakestream
== stderr
|| fakestream
== NULL
)
68 for (file_cnt
= 0; file_cnt
< 20; file_cnt
++)
70 sprintf (fname
, "dbg%d.log", file_cnt
);
71 if ((fout
= fopen (fname
), "r") != NULL
)
76 fout
= fopen (fname
, "w");
82 fprintf (fakestream
, data
);
88 #ifdef ANSI_PROTOTYPES
89 printf_dbg (const char *format
,...)
97 #ifdef ANSI_PROTOTYPES
98 va_start (args
, format
);
103 format
= va_arg (args
, char *);
105 vsprintf (buf
, format
, args
);
This page took 0.031417 seconds and 4 git commands to generate.