This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: catch load/unload not implemented on any target (remove?)


Joel Brobecker wrote:
Hello,

I was looking at converting the catch load/unload implementation
to using the bp_catchpoint kind. But looking at the implementation,
I realized there isn't any platform where this feature is implemented.
The documentation says HP/UX, but this isn't correct either, AFAICT.

The "protocol" between the breakpoint solib layers is based on
some macros being defined:

    SOLIB_LOADED_LIBRARY_PATHNAME(pid)
    LIB_UNLOADED_LIBRARY_PATHNAME(pid)
    SOLIB_CREATE_CATCH_LOAD_HOOK(pid,tempflag,filename,cond_string)
    SOLIB_CREATE_CATCH_UNLOAD_HOOK(pid, tempflag, filename, cond_string)

These macros used to be defined in the various target-dependent solib
files. For instance, in gdb-5.3, it was defined in: coff-solib.h,
pa64solib.h, solib.h, and somsolib.h.

I think that the mechanism of using macros is definitely OBE now, and
one should use "methods" in the target_so_ops structure.

I agree.



I am conflicted as to what to do in the meantime: Leave the code as is, and update the documentation that this feature is currently implemented on no platform. Or remove the code entirely.

I am leaning towards removing the code entirely, for several reasons:
  - Documentating a feature as unimplemented seems silly;

I agree.


  - I don't think there is much in the current code that once can
    reuse in order to implement this feature properly
  - When someone is ready to implement this feature again for his platform,
    there shouldn't be much to do in terms of infrastructure work to do at
    the breakpoint module level.  So it shouldn't be very difficult to
    implement. There might be one little difficulty based on the fact
    that some architectures will implement this feature using a phyical
    breakpoint (eg: svr4) whereas others won't (eg: Windows), but that
    shouldn't be very difficult to handle by using the right bp_kind.


Well, I had to implement catch load/unload; their appearance in the list of catchpoints set some expectations which evolved into requirements.


I used the above mentioned macros.

Thanks,

Aleksandar


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]