From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cagney To: Randolph Chung Cc: gdb-patches@sources.redhat.com Subject: Re: [patch/commit] Fix nested header include in infttrace.h Date: Wed, 26 May 2004 19:29:00 -0000 Message-id: <40B4F027.7060908@gnu.org> References: <20040526154101.GA7207@tausq.org> <40B4CA7D.7080302@gnu.org> <20040526165722.GB7207@tausq.org> X-SW-Source: 2004-05/msg00755.html 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 * 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 >From cagney@gnu.org Wed May 26 19:53:00 2004 From: Andrew Cagney To: Jerome Guitton Cc: gdb-patches@sources.redhat.com Subject: Re: [RFA] win32: bfd_cache_close after kill Date: Wed, 26 May 2004 19:53:00 -0000 Message-id: <40B4F5A2.9000708@gnu.org> References: <20040524115048.GA27758@act-europe.fr> <20040525102414.GA28823@act-europe.fr> X-SW-Source: 2004-05/msg00756.html Content-length: 509 + + /* Release file handles in BFD. */ + ALL_OBJFILES (obj) + { + if (obj->obfd) + bfd_cache_close (obj->obfd); + } + bfd_cache_close (exec_bfd); Hmm, unstead of waiting until kill should GDB simply do this when finished processing each objfile? Users also complain that they can't rebuild their executable while GDB is debugging. BFD might also be ok with a new bfd_cache_close_all (void) method - simplify the code needed to do the close letting us put calls in more places. Andrew