gdb and binutils branch master updated. f7088df3b1c0370101edada54e26d24efb53125c

sergiodj@sourceware.org sergiodj@sourceware.org
Tue Oct 14 18:34:00 GMT 2014


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  f7088df3b1c0370101edada54e26d24efb53125c (commit)
      from  5697705ac6eafb3e3f9dd3ba253231a4d51a1fa4 (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=f7088df3b1c0370101edada54e26d24efb53125c

commit f7088df3b1c0370101edada54e26d24efb53125c
Author: Sergio Durigan Junior <sergiodj@redhat.com>
Date:   Tue Oct 14 14:31:09 2014 -0400

    Explicitly use language_c when evaluating a SDT probe argument
    
    Joel contacted me offlist with a question about a warning that one of
    his customers was seeing.  The message came from the new
    linker-debugger interface, which uses SDT probes internally.  The
    warning said:
    
        (gdb) run
        [...]
        warning: Probes-based dynamic linker interface failed.
        Reverting to original interface.
    
        Argument to arithmetic operation not a number or boolean.
    
    This should not have happened in the environment the customer was
    using (RHEL-6.x), so I found it strange.  Another thing caught my
    attention: the last message, saying "Argument to arithmetic operation
    not a number or boolean.".
    
    Joel kindly investigated the issue further, and found the answer for
    this.  To quote him:
    
    	(gdb) set lang c
    	(gdb) p 48+$ebp
    	$4 = (void *) 0xffffd0f8
    
        So far so good. But...
    
    	(gdb) set lang ada
    	(gdb) p 48+$ebp
    	Argument to arithmetic operation not a number or boolean.
    
        Ooops! Interestingly, if you revert the order of the operands...
    
    	(gdb) p $ebp+48
    	$5 = (access void) 0xffffd0f8
    
    So the problem is doing pointer arithmetics when the language is set
    to Ada.
    
    I remembered that, during the parsing and the evaluation of SDT probe
    arguments, the code sets the language as current_language, because, at
    that time, I thought it was not necessary to worry about the language
    given that the code implements its own parser.  I was wrong.  So here
    is a patch to fix that, by setting the language as C, which should
    guarantee that the maths are done in the right way (TM).
    
    It was somewhat hard to find a reproducer for this issue.  In the end,
    what I had to do was to create a testcase that used the %ebp register
    on some displacement (e.g., "-4(%ebp)"), which finally triggered the
    bug.  I am not sure why I could not trigger it when using other
    registers, but I did not want to spend too much time investigating
    this issue, which seemed like an Ada issue.  Also, because of this
    peculiar way to trigger the problem, the testcase only covers x86-like
    targets (i.e., i*86 and x86_64 with -m32).
    
    Joel kindly tested this for me, and it worked.  I also ran a full
    regression test here on my Fedora 20 x86_64, and everything is fine.
    
    I will push this patch in a few days if there are no comments.
    
    gdb/ChangeLog:
    2014-10-14  Sergio Durigan Junior  <sergiodj@redhat.com>
    
    	* stap-probe.c (stap_parse_argument): Initialize expout explicitly
    	using language_c, instead of current_language.
    
    gdb/testsuite/ChangeLog:
    2014-10-14  Sergio Durigan Junior  <sergiodj@redhat.com>
    
    	* gdb.arch/stap-eval-lang-ada.S: Likewise.
    	* gdb.arch/stap-eval-lang-ada.c: Likewise.
    	* gdb.arch/stap-eval-lang-ada.exp: New file.

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

Summary of changes:
 gdb/ChangeLog                                      |    5 +
 gdb/stap-probe.c                                   |    6 +-
 gdb/testsuite/ChangeLog                            |    6 ++
 gdb/testsuite/gdb.arch/i386-stap-eval-lang-ada.S   |   81 ++++++++++++++++++++
 gdb/testsuite/gdb.arch/i386-stap-eval-lang-ada.c   |   29 +++++++
 gdb/testsuite/gdb.arch/i386-stap-eval-lang-ada.exp |   35 +++++++++
 6 files changed, 159 insertions(+), 3 deletions(-)
 create mode 100644 gdb/testsuite/gdb.arch/i386-stap-eval-lang-ada.S
 create mode 100644 gdb/testsuite/gdb.arch/i386-stap-eval-lang-ada.c
 create mode 100644 gdb/testsuite/gdb.arch/i386-stap-eval-lang-ada.exp


hooks/post-receive
-- 
gdb and binutils



More information about the Gdb-cvs mailing list