This is the mail archive of the gdb-cvs@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]

gdb and binutils branch master updated. 782d47dfbdfde099cccd06a944e843368cccda76


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gdb and binutils".

The branch, master has been updated
       via  782d47dfbdfde099cccd06a944e843368cccda76 (commit)
       via  710409a221f27f39d8b8e33c5676c97cb04cf4b8 (commit)
      from  7580e9176779460e031d82aa1cd5790db53ad27b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=782d47dfbdfde099cccd06a944e843368cccda76

commit 782d47dfbdfde099cccd06a944e843368cccda76
Author: Pedro Alves <palves@redhat.com>
Date:   Fri Dec 6 19:48:00 2013 +0000

    Fix "info frame" in the outermost frame.
    
    Doing "info frame" in the outermost frame, when that was indicated by
    the next frame saying the unwound PC is undefined/not saved, results
    in error and incomplete output:
    
     (gdb) bt
     #0  thread_function0 (arg=0x0) at threads.c:63
     #1  0x00000034cf407d14 in start_thread (arg=0x7ffff7fcb700) at pthread_create.c:309
     #2  0x000000323d4f168d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:115
    
     (gdb) frame 2
     #2  0x000000323d4f168d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:115
     115             call    *%rax
    
     (gdb) info frame
     Stack level 2, frame at 0x0:
      rip = 0x323d4f168d in clone (../sysdeps/unix/sysv/linux/x86_64/clone.S:115); saved rip Register 16 was not saved
     (gdb)
    
    Not saved register values are treated as optimized out values
    internally throughout.  stack.c:frame_info is handing unvailable
    values, but not optimized out ones.  The patch deletes the
    frame_unwind_caller_pc_if_available wrapper function and instead lets
    errors propagate to frame_info (it's only user).
    
    As frame_unwind_pc now needs to be able to handle and cache two
    different error scenarios, the prev_pc.p variable is replaced with an
    enumeration.
    
    (FWIW, I looked into making gdbarch_unwind_pc or a variant return
    struct value's instead, but it results in lots of boxing and unboxing
    for no real gain -- e.g., the mips and arm implementations need to do
    computation on the unboxed PC value.  Might as well throw an error on
    first attempt to get at invalid contents.)
    
    After the patch, we get:
    
     (gdb) info frame
     Stack level 2, frame at 0x0:
      rip = 0x323d4f168d in clone (../sysdeps/unix/sysv/linux/x86_64/clone.S:115); saved rip = <not saved>
      Outermost frame: outermost
      caller of frame at 0x7ffff7fcafc0
      source language asm.
      Arglist at 0x7ffff7fcafb8, args:
      Locals at 0x7ffff7fcafb8, Previous frame's sp is 0x7ffff7fcafc8
     (gdb)
    
    A new test is added.  It's based off dw2-reg-undefined.exp, and tweaked to
    mark the return address (rip) of "stop_frame" as undefined.
    
    Tested on x86_64 Fedora 17.
    
    gdb/
    2013-12-06  Pedro Alves  <palves@redhat.com>
    
    	* frame.c (enum cached_copy_status): New enum.
    	(struct frame_info) <prev_pc.p>: Change type to enum
    	cached_copy_status.
    	(fprint_frame): Handle not saved and unavailable prev_pc values.
    	(frame_unwind_pc_if_available): Delete and merge contents into ...
    	(frame_unwind_pc): ... here.  Handle OPTIMIZED_OUT_ERROR.  Adjust
    	to use enum cached_copy_status.
    	(frame_unwind_caller_pc_if_available): Delete.
    	(create_new_frame): Adjust.
    	* frame.h (frame_unwind_caller_pc_if_available): Delete
    	declaration.
    	* stack.c (frame_info): Use frame_unwind_caller_pc instead of
    	frame_unwind_caller_pc_if_available, and handle
    	NOT_AVAILABLE_ERROR and OPTIMIZED_OUT_ERROR errors.
    	* valprint.c (val_print_optimized_out): Use val_print_not_saved.
    	(val_print_not_saved): New function.
    	* valprint.h (val_print_not_saved): Declare.
    
    gdb/testsuite/
    2013-12-06  Pedro Alves  <palves@redhat.com>
    
    	* gdb.dwarf2/dw2-undefined-ret-addr.S: New file.
    	* gdb.dwarf2/dw2-undefined-ret-addr.c: New file.
    	* gdb.dwarf2/dw2-undefined-ret-addr.exp: New file.

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=710409a221f27f39d8b8e33c5676c97cb04cf4b8

commit 710409a221f27f39d8b8e33c5676c97cb04cf4b8
Author: Pedro Alves <palves@redhat.com>
Date:   Fri Dec 6 19:48:54 2013 +0000

    New OPTIMIZED_OUT_ERROR error code.
    
    In order to catch <optimized out> errors like we catch <unavailable>
    errors, this adds a new OPTIMIZED_OUT_ERROR error code, and throws it
    in various places.
    
    gdb/ChangeLog
    2013-12-06  Andrew Burgess  <aburgess@broadcom.com>
    	    Pedro Alves  <palves@redhat.com>
    
    	* exceptions.h (errors): Add OPTIMIZED_OUT_ERROR.
    	* dwarf2loc.c (write_pieced_value): Throw OPTIMIZED_OUT_ERROR.
    	* frame.c (frame_unwind_register): Throw OPTIMIZED_OUT_ERROR.
    	* spu-tdep.c (spu_software_single_step): Throw
    	OPTIMIZED_OUT_ERROR.
    	* valops.c (value_assign): Throw OPTIMIZED_OUT_ERROR.

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

Summary of changes:
 gdb/ChangeLog                                      |   30 ++
 gdb/dwarf2loc.c                                    |    7 +-
 gdb/exceptions.h                                   |    4 +
 gdb/frame.c                                        |  111 +++--
 gdb/frame.h                                        |    8 -
 gdb/spu-tdep.c                                     |    5 +-
 gdb/stack.c                                        |   27 +-
 gdb/testsuite/ChangeLog                            |    6 +
 gdb/testsuite/gdb.dwarf2/dw2-undefined-ret-addr.S  |  508 ++++++++++++++++++++
 gdb/testsuite/gdb.dwarf2/dw2-undefined-ret-addr.c  |   36 ++
 .../gdb.dwarf2/dw2-undefined-ret-addr.exp          |   58 +++
 gdb/valops.c                                       |    3 +-
 gdb/valprint.c                                     |    8 +-
 gdb/valprint.h                                     |    3 +
 14 files changed, 748 insertions(+), 66 deletions(-)
 create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-undefined-ret-addr.S
 create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-undefined-ret-addr.c
 create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-undefined-ret-addr.exp


hooks/post-receive
-- 
gdb and binutils


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