This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [patch/commit] Fix nested header include in infttrace.h
Unfortunatly this is a GCC extension. It sounds like a header file is
really?! wow...
fwiw, this works with the ANSI C hp compiler too, and hpux is the only
thing that uses infttrace.h ....
missing:
#ifndef FOO_H
#define FOO_H
#endif
wrappers? Adding them is ``obvious''.
no, it's not that... this brings in target.h "too early", so that when
a C file tries to include tm.h, we cannot override some #defines.
bleugh!
the alternative is:
+#undef PC_REQUIRES_RUN_BEFORE_USE
#define PC_REQUIRES_RUN_BEFORE_USE(pc) hppa_pc_requires_run_before_use (pc)
Try the attached.
Andrew
2004-05-26 Andrew Cagney <cagney@gnu.org>
* target.h (PC_REQUIRES_RUN_BEFORE_USE): Delete definition.
* config/pa/tm-hppa.h (DEPRECATED_PC_REQUIRES_RUN_BEFORE_USE):
Rename PC_REQUIRES_RUN_BEFORE_USE.
* breakpoint.c (breakpoint_sals_to_pc): Update. Wrap reference in
#ifdef.
Index: breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.173
diff -p -u -r1.173 breakpoint.c
--- breakpoint.c 13 May 2004 16:39:10 -0000 1.173
+++ breakpoint.c 26 May 2004 19:28:09 -0000
@@ -5025,7 +5025,8 @@ breakpoint_sals_to_pc (struct symtabs_an
Give the target a chance to bless sals.sals[i].pc before we
try to make a breakpoint for it. */
- if (PC_REQUIRES_RUN_BEFORE_USE (sals->sals[i].pc))
+#ifdef DEPRECATED_PC_REQUIRES_RUN_BEFORE_USE
+ if (DEPRECATED_PC_REQUIRES_RUN_BEFORE_USE (sals->sals[i].pc))
{
if (address == NULL)
error ("Cannot break without a running program.");
@@ -5033,6 +5034,7 @@ breakpoint_sals_to_pc (struct symtabs_an
error ("Cannot break on %s without a running program.",
address);
}
+#endif
}
}
Index: target.h
===================================================================
RCS file: /cvs/src/src/gdb/target.h,v
retrieving revision 1.59
diff -p -u -r1.59 target.h
--- target.h 25 May 2004 14:58:31 -0000 1.59
+++ target.h 26 May 2004 19:28:12 -0000
@@ -1088,15 +1088,6 @@ extern void (*deprecated_target_new_objf
(*current_target.to_stopped_data_address) ()
#endif
-/* Sometimes gdb may pick up what appears to be a valid target address
- from a minimal symbol, but the value really means, essentially,
- "This is an index into a table which is populated when the inferior
- is run. Therefore, do not attempt to use this as a PC." */
-
-#if !defined(PC_REQUIRES_RUN_BEFORE_USE)
-#define PC_REQUIRES_RUN_BEFORE_USE(pc) (0)
-#endif
-
/* This will only be defined by a target that supports catching vfork events,
such as HP-UX.
Index: config/pa/tm-hppa.h
===================================================================
RCS file: /cvs/src/src/gdb/config/pa/tm-hppa.h,v
retrieving revision 1.73
diff -p -u -r1.73 tm-hppa.h
--- config/pa/tm-hppa.h 7 May 2004 05:48:50 -0000 1.73
+++ config/pa/tm-hppa.h 26 May 2004 19:28:12 -0000
@@ -29,7 +29,7 @@
#define GDB_MULTI_ARCH 1
extern int hppa_pc_requires_run_before_use (CORE_ADDR pc);
-#define PC_REQUIRES_RUN_BEFORE_USE(pc) hppa_pc_requires_run_before_use (pc)
+#define DEPRECATED_PC_REQUIRES_RUN_BEFORE_USE(pc) hppa_pc_requires_run_before_use (pc)
/* PA specific macro to see if the current instruction is nullified. */
#ifndef INSTRUCTION_NULLIFIED