Skip to content
Snippets Groups Projects
  • Helge Deller's avatar
    bd5ccd61
    linux-user: Add guest memory layout to exception dump · bd5ccd61
    Helge Deller authored
    
    When the emulation stops with a hard exception it's very useful for
    debugging purposes to dump the current guest memory layout (for an
    example see /proc/self/maps) beside the CPU registers.
    
    The open_self_maps() function provides such a memory dump, but since
    it's located in the syscall.c file, various changes (add #includes, make
    this function externally visible, ...) are needed to be able to call it
    from the existing EXCP_DUMP() macro.
    
    This patch takes another approach by re-defining EXCP_DUMP() to call
    target_exception_dump(), which is in syscall.c, consolidates the log
    print functions and allows to add the call to dump the memory layout.
    
    Beside a reduced code footprint, this approach keeps the changes across
    the various callers minimal, and keeps EXCP_DUMP() highlighted as
    important macro/function.
    
    Signed-off-by: default avatarHelge Deller <deller@gmx.de>
    Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
    Message-Id: <Y1bzAWbw07WBKPxw@p100>
    [lv: remove pc declaration and setting]
    Signed-off-by: default avatarLaurent Vivier <laurent@vivier.eu>
    bd5ccd61
    History
    linux-user: Add guest memory layout to exception dump
    Helge Deller authored
    
    When the emulation stops with a hard exception it's very useful for
    debugging purposes to dump the current guest memory layout (for an
    example see /proc/self/maps) beside the CPU registers.
    
    The open_self_maps() function provides such a memory dump, but since
    it's located in the syscall.c file, various changes (add #includes, make
    this function externally visible, ...) are needed to be able to call it
    from the existing EXCP_DUMP() macro.
    
    This patch takes another approach by re-defining EXCP_DUMP() to call
    target_exception_dump(), which is in syscall.c, consolidates the log
    print functions and allows to add the call to dump the memory layout.
    
    Beside a reduced code footprint, this approach keeps the changes across
    the various callers minimal, and keeps EXCP_DUMP() highlighted as
    important macro/function.
    
    Signed-off-by: default avatarHelge Deller <deller@gmx.de>
    Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
    Message-Id: <Y1bzAWbw07WBKPxw@p100>
    [lv: remove pc declaration and setting]
    Signed-off-by: default avatarLaurent Vivier <laurent@vivier.eu>