From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22349 invoked by alias); 11 Jan 2002 00:03:14 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 22301 invoked from network); 11 Jan 2002 00:03:08 -0000 Received: from unknown (HELO cygnus.com) (205.180.230.5) by sources.redhat.com with SMTP; 11 Jan 2002 00:03:08 -0000 Received: from redhat.com (reddwarf.sfbay.redhat.com [205.180.231.12]) by runyon.cygnus.com (8.8.7-cygnus/8.8.7) with ESMTP id QAA11819; Thu, 10 Jan 2002 16:03:01 -0800 (PST) Message-ID: <3C3E2A7F.36FF7A58@redhat.com> Date: Thu, 10 Jan 2002 16:03:00 -0000 From: Michael Snyder Organization: Red Hat, Inc. X-Mailer: Mozilla 4.76 [en] (X11; U; Linux 2.4.2-2smp i686) X-Accept-Language: en MIME-Version: 1.0 To: fnf@redhat.com CC: gdb-patches@sources.redhat.com, fnf@ninemoons.com Subject: Re: [RFA] Accept compiler internal use of memcpy/bcopy for structs References: <200201081658.g08Gwae25774@fred.ninemoons.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2002-01/txt/msg00261.txt.bz2 Fred Fish wrote: > > For cases where the compiler uses memcpy/bcopy to copy structs around, > and those calls are found in a library for which debugging line number > information is available, attempting to step into a function where a > large struct is passed by value will first stop at the memcpy/bcopy > call that the compiler calls prior to the user function. > > The comment in step-test.exp says that "opinion is bitterly divided > about whether this is the right behavior for GDB or not". Regardless > of which opinion you have, you would probably have to agree that gdb > is currently behaving as designed, in the absence of additional > code to not stop in functions used internally by the compiler. Thus > I believe the correct behavior of the test suite is to accept the > cases where gdb stops in memcpy/bcopy. > > Here is a patch to fix the testsuite. Fred, Would you please try the attached modification of your patch, and let me know if it is acceptable? > 2002-01-08 Fred Fish > > * gdb.base/step-test.exp: Accept stopping in memcpy/bcopy when we > have debugging info for those functions and the compiler uses them > internally to copy structs around. Index: step-test.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.base/step-test.exp,v retrieving revision 1.3 diff -c -3 -p -r1.3 step-test.exp *** step-test.exp 2001/03/06 08:21:51 1.3 --- step-test.exp 2002/01/10 23:58:15 *************** gdb_test \ *** 212,220 **** gdb_test "continue" \ ".*Breakpoint ${decimal},.*large_struct_by_value.*" \ "run to pass large struct" ! gdb_test "step" \ ! ".*step-test.exp: arrive here 1.*" \ ! "large struct by value" gdb_continue_to_end "step-test.exp" --- 212,235 ---- gdb_test "continue" \ ".*Breakpoint ${decimal},.*large_struct_by_value.*" \ "run to pass large struct" ! send_gdb "step\n" ! gdb_expect { ! -re ".*step-test.exp: arrive here 1.*$gdb_prompt $" { ! pass "large struct by value" ! } ! -re ".*(memcpy|bcopy).*$gdb_prompt $" { ! send_gdb "finish\n" ; gdb_expect -re "$gdb_prompt $" ! send_gdb "step\n" ! exp_continue ! } ! } ! -re ".*$gdb_prompt $" { ! fail "large struct by value" ! } ! timeout { ! fail "large struct by value (timeout)" ! } ! } gdb_continue_to_end "step-test.exp"