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: [PATCH v2 15/22] Make exceptions use std::string and be self-managing


>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:

Pedro> I think fixing this isn't hard, so I think we should do it from the
Pedro> start -- instead of gdb_exception holding a std::string, hold a
Pedro> reference counted immutable heap-allocated C string.

I'll do this.

How about just a std::shared_ptr<std::string>?  Or would you rather
plain std::shared_ptr<char>?  I don't recall offhand if having a real
string was handy anywhere or not.

Pedro> Since you're touching most (all?) lines that refer to "message",
Pedro> did you consider adding a "what()" method, to model what
Pedro> std::exception has?

Pedro>   const char *what() const noexcept;

Pedro> Maybe that helps with newcomers' familiarity?

I didn't think of it, but I can do this.

Tom


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