[RFA] Add missing include dependency in exceptions.h

Joel Brobecker
2005-05-30T15:48:28Z

[-- Attachment #1: Type: text/plain, Size: 822 bytes --]

Hello,

See http://sources.redhat.com/ml/gdb-patches/2005-05/msg00601.html.

The TRY_CATCH macro has a dependency on "uiout", which is declared in
ui-out.h. Because this header is not included in exceptions.h, any file
that uses this macro needs to include "ui-out.h". I think we should
include "ui-out.h" in "exceptions.h" instead. This is what this patch
does.

Note that another alternative would be to add something like:

extern struct ui_out *uiout;

to exceptions.h. I personnaly think it would be ugly to sprinkle
such extern declarations everywhere...

2005-05-30 Joel Brobecker <brobecker@adacore.com>

* exceptions.h: Include ui-out.h.
(ui_out): Remove declaration.
* Makefile.in (exceptions_h): Add dependency on ui-out.h.

Tested on x86-linux.
OK to apply?

Thanks,
--
Joel

[-- Attachment #2: uiout.diff --]
[-- Type: text/plain, Size: 1055 bytes --]

Index: exceptions.h
===================================================================
RCS file: /cvs/src/src/gdb/exceptions.h,v
retrieving revision 1.14
diff -u -p -r1.14 exceptions.h
--- exceptions.h 26 Apr 2005 05:03:36 -0000 1.14
+++ exceptions.h 30 May 2005 01:47:56 -0000
@@ -24,8 +24,7 @@
#ifndef EXCEPTIONS_H
#define EXCEPTIONS_H

-struct ui_out;
-
+#include "ui-out.h"
#include <setjmp.h>

/* Reasons for calling throw_exceptions(). NOTE: all reason values
Index: Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/Makefile.in,v
retrieving revision 1.734
diff -u -p -r1.734 Makefile.in
--- Makefile.in 29 May 2005 03:13:17 -0000 1.734
+++ Makefile.in 30 May 2005 01:48:06 -0000
@@ -672,7 +672,7 @@ dwarf2loc_h = dwarf2loc.h
environ_h = environ.h
event_loop_h = event-loop.h
event_top_h = event-top.h
-exceptions_h = exceptions.h
+exceptions_h = exceptions.h $(ui_out_h)
exec_h = exec.h $(target_h)
expression_h = expression.h $(symtab_h) $(doublest_h)
fbsd_nat_h = fbsd-nat.h