Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Denis PILAT <denis.pilat@st.com>
To: gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [RFA] [gdb.threads/testsuite] failure while checking backtrace into main
Date: Fri, 02 Feb 2007 15:18:00 -0000	[thread overview]
Message-ID: <45C3545A.6020902@st.com> (raw)
In-Reply-To: <20070202143631.GA24397@nevyn.them.org>

Daniel Jacobowitz wrote:
> On Fri, Feb 02, 2007 at 03:26:13PM +0100, Denis PILAT wrote:
>> We can also just remove the testing of argc and argv from the 
>> pthreads.exp file, that would be better I think.
>
> I like this better.  But, before I approve it, could you show me what
> the output looks like from your compiler - both the backtrace and the
> output of "readelf -wi" for main, argc, and argv?  I bet it's a bug
> that we don't show argc and argv at least as argc=<value optimized out>.
>
>> 2007-02-02  Denis Pilat  <denis.pilat@st.com>
>>
>> 	* gdb.threads/pthreads.exp: remove checking of unused argc and argv
>> 	since they can be removed by a compiler optiisation.
>
> This would be:
>
> 	* gdb.threads/pthreads.exp (check_backtraces): Remove checking
> 	of unused argc and argv.
>
The backtrace is:

thread apply 1 backtrace

Thread 1 (Thread -1218551680 (LWP 2236)):
#0  0x00560aec in nanosleep () from /lib/tls/libc.so.6
#1  0x0056090f in sleep () from /lib/tls/libc.so.6
#2  0x0804891f in main () at 
/project/flexdbug/user/pd10/gdb/sts-gdb-repository/vendor/gdb/gdb/testsuite/gdb.threads/pthreads.c:166 

53      if (verbose) printf("common_routine (%d)\n", arg);
(gdb) FAIL: gdb.threads/pthreads.exp: check backtrace from main thread



The readelf for a gcc4.1.1 is:

 <1><423>: Abbrev Number: 14 (DW_TAG_subprogram)
     DW_AT_sibling     : <4ad>   
     DW_AT_external    : 1   
     DW_AT_name        : main   
     DW_AT_decl_file   : 1   
     DW_AT_decl_line   : 118   
     DW_AT_type        : <f5>   
     DW_AT_low_pc      : 0x804876b   
     DW_AT_high_pc     : 0x804893d   
     DW_AT_frame_base  : 0xb0    (location list)
 <2><440>: Abbrev Number: 15 (DW_TAG_formal_parameter)
     DW_AT_name        : argc   
     DW_AT_decl_file   : 1   
     DW_AT_decl_line   : 116   
     DW_AT_type        : <f5>   
 <2><44c>: Abbrev Number: 15 (DW_TAG_formal_parameter)
     DW_AT_name        : argv   
     DW_AT_decl_file   : 1   
     DW_AT_decl_line   : 117   
     DW_AT_type        : <4ad>   

There is no location for argc and argv. It might be a gcc4.1.1 bug, I 
don't know how much it can optimize the code, argc and argv are not used.

For gcc3.3 there are DW_AT_location for both argc and argv.

-- 
Denis


  reply	other threads:[~2007-02-02 15:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-31 19:36 Denis PILAT
2007-02-02 14:28 ` Denis PILAT
2007-02-02 14:36   ` Daniel Jacobowitz
2007-02-02 15:18     ` Denis PILAT [this message]
2007-02-03  1:35       ` Daniel Jacobowitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=45C3545A.6020902@st.com \
    --to=denis.pilat@st.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox