On Thu, 17 Apr 2025 12:27:55 GMT, Daniel Jeliński <djelin...@openjdk.org> wrote:

> Currently if loading a core file fails, the diagnostic information provided 
> on different systems is different; on MacOS we produce an error message, 
> while on Linux we only print information if debug logging is enabled.
> 
> This PR adds some new messages on Linux to match MacOSX, and changes some of 
> the diagnostic output to error level instead of debug. Additionally, if 
> opening the core or the exe file fails, the system error message (strerror) 
> is printed.
> 
> Tier1-3 testing clean.

This is a good start for getting a reasonable error message without having to 
first enable LIBSAPROC_DEBUG. A couple of suggestions for additional 
improvements below:

You've covered the top level error message in Pgrab_core(), but there are many 
other print_debug messages that are for errors that are closer to the root 
cause of the error. For example, look in core_handle_note() and 
read_lib_info(). Also, Pgrab() needs updating, although it only has one debug 
message, but it also is missing detecting when add_thread_info() or 
read_lib_info() fails.

add_map_info() and core_handle_prstatus() are lacking a print_error message 
when they fail.

-------------

Changes requested by cjplummer (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/24722#pullrequestreview-2776146648

Reply via email to