Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Michael Snyder <msnyder@cygnus.com>
To: Fernando Nasser <fnasser@cygnus.com>
Cc: Keith Seitz <keiths@cygnus.com>, gdb-patches@sources.redhat.com
Subject: Re: [RFA] Assuming malloc exists in callfwmall.exp
Date: Wed, 14 Feb 2001 12:52:00 -0000	[thread overview]
Message-ID: <3A8AEFEA.A2E2A61E@cygnus.com> (raw)
In-Reply-To: <3A8ABA01.C25B0FD2@cygnus.com>

Fernando Nasser wrote:
> 
> Sounds reasonable.  Check it in (assuming you have already added yourself to the write after approval list).

Hold on -- aren't you defeating the purpose of this test?
The test was added by HP precisely because these calls
fail when malloc isn't included in the target program.
The test is a duplicate of callfuncs.exp, except that it
doesn't link malloc.


> 
> Fernando
> 
> Keith Seitz wrote:
> >
> > (let me try to get the right mailing list this time :-)
> >
> > Hi,
> >
> > The problem: When doing an inferior function call with a
> > struct/array/string argument (aka 'print foo({2,1})' or 'print
> > foo("bar")', gdb requires "malloc" in the executable... This leads to
> > some trivial testsuite failures.
> >
> > 2001-02-13  Keith Seitz  <kseitz@nwlink.com>
> >
> >         * gdb.base/callfwmall.exp: Check for the existence of
> >         malloc.
> >         (do_function_calls): Do not do an inferior function
> >         call which requires malloc if malloc doesn't exist.
> >
> > Patch:
> > Index: testsuite/gdb.base/callfwmall.exp
> > ===================================================================
> > RCS file: /cvs/src/src/gdb/testsuite/gdb.base/callfwmall.exp,v
> > retrieving revision 1.1.1.3
> > diff -p -r1.1.1.3 callfwmall.exp
> > *** testsuite/gdb.base/callfwmall.exp   1999/09/09 00:00:21     1.1.1.3
> > --- testsuite/gdb.base/callfwmall.exp   2001/02/14 01:11:52
> > *************** proc set_lang_c {} {
> > *** 99,105 ****
> >   proc do_function_calls {} {
> >       global prototypes
> >       global gcc_compiled
> > !     global gdb_prompt
> >
> >       # We need to up this because this can be really slow on some boards.
> >       set timeout 60;
> > --- 99,105 ----
> >   proc do_function_calls {} {
> >       global prototypes
> >       global gcc_compiled
> > !     global gdb_prompt have_malloc_p
> >
> >       # We need to up this because this can be really slow on some boards.
> >       set timeout 60;
> > *************** proc do_function_calls {} {
> > *** 169,183 ****
> >
> >       gdb_test "p t_string_values(string_val2,string_val1)" " = 0"
> >       gdb_test "p t_string_values(string_val1,string_val2)" " = 1"
> > !     gdb_test "p t_string_values(\"string 1\",\"string 2\")" " = 1"
> > !     gdb_test "p t_string_values(\"string 1\",string_val2)" " = 1"
> > !     gdb_test "p t_string_values(string_val1,\"string 2\")" " = 1"
> >
> >       gdb_test "p t_char_array_values(char_array_val2,char_array_val1)" " = 0"
> >       gdb_test "p t_char_array_values(char_array_val1,char_array_val2)" " = 1"
> > !     gdb_test "p t_char_array_values(\"carray 1\",\"carray 2\")" " = 1"
> > !     gdb_test "p t_char_array_values(\"carray 1\",char_array_val2)" " = 1"
> > !     gdb_test "p t_char_array_values(char_array_val1,\"carray 2\")" " = 1"
> >
> >       gdb_test "p doubleit(4)" " = 8"
> >       gdb_test "p add(4,5)" " = 9"
> > --- 169,187 ----
> >
> >       gdb_test "p t_string_values(string_val2,string_val1)" " = 0"
> >       gdb_test "p t_string_values(string_val1,string_val2)" " = 1"
> > !     if {$have_malloc_p} {
> > !       gdb_test "p t_string_values(\"string 1\",\"string 2\")" " = 1"
> > !       gdb_test "p t_string_values(\"string 1\",string_val2)" " = 1"
> > !       gdb_test "p t_string_values(string_val1,\"string 2\")" " = 1"
> > !     }
> >
> >       gdb_test "p t_char_array_values(char_array_val2,char_array_val1)" " = 0"
> >       gdb_test "p t_char_array_values(char_array_val1,char_array_val2)" " = 1"
> > !     if {$have_malloc_p} {
> > !       gdb_test "p t_char_array_values(\"carray 1\",\"carray 2\")" " = 1"
> > !       gdb_test "p t_char_array_values(\"carray 1\",char_array_val2)" " = 1"
> > !       gdb_test "p t_char_array_values(char_array_val1,\"carray 2\")" " = 1"
> > !     }
> >
> >       gdb_test "p doubleit(4)" " = 8"
> >       gdb_test "p add(4,5)" " = 9"
> > *************** proc do_function_calls {} {
> > *** 222,231 ****
> >       gdb_test "p t_enum_value2(enum_val2)" " = 1"
> >       gdb_test "p t_enum_value2(enum_val1)" " = 0"
> >
> > !     gdb_test "p sum_args(1,{2})" " = 2"
> > !     gdb_test "p sum_args(2,{2,3})" " = 5"
> > !     gdb_test "p sum_args(3,{2,3,4})" " = 9"
> > !     gdb_test "p sum_args(4,{2,3,4,5})" " = 14"
> >       gdb_test "p sum10 (1, 2, 3, 4, 5, 6, 7, 8, 9, 10)" " = 55"
> >
> >       gdb_test "p t_structs_c(struct_val1)" "= 120 'x'" \
> > --- 226,237 ----
> >       gdb_test "p t_enum_value2(enum_val2)" " = 1"
> >       gdb_test "p t_enum_value2(enum_val1)" " = 0"
> >
> > !     if {$have_malloc_p} {
> > !       gdb_test "p sum_args(1,{2})" " = 2"
> > !       gdb_test "p sum_args(2,{2,3})" " = 5"
> > !       gdb_test "p sum_args(3,{2,3,4})" " = 9"
> > !       gdb_test "p sum_args(4,{2,3,4,5})" " = 14"
> > !     }
> >       gdb_test "p sum10 (1, 2, 3, 4, 5, 6, 7, 8, 9, 10)" " = 55"
> >
> >       gdb_test "p t_structs_c(struct_val1)" "= 120 'x'" \
> > *************** gdb_load ${binfile}
> > *** 255,260 ****
> > --- 261,273 ----
> >   gdb_test "set print sevenbit-strings" ""
> >   gdb_test "set print address off" ""
> >   gdb_test "set width 0" ""
> > +
> > + # Note whether malloc exists
> > + set have_malloc_p 1
> > + send_gdb "p malloc\n"
> > + gdb_expect {
> > +   "No symbol \"malloc\""  { set have_malloc_p 0 }
> > + }
> >
> >   if { $hp_aCC_compiler } {
> >       # Do not set language explicitly to 'C'.  This will cause aCC
> 
> --
> Fernando Nasser
> Red Hat - Toronto                       E-Mail:  fnasser@redhat.com
> 2323 Yonge Street, Suite #300
> Toronto, Ontario   M4P 2C9


  reply	other threads:[~2001-02-14 12:52 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <Pine.SOL.3.91.1010214082014.13194C-100000@ryobi.cygnus.com>
2001-02-14  9:02 ` Fernando Nasser
2001-02-14 12:52   ` Michael Snyder [this message]
2001-02-14 13:10     ` Kevin Buettner
2001-02-14 13:28       ` Elena Zannoni
2001-02-14 13:41         ` Kevin Buettner
2001-02-14 14:00           ` Elena Zannoni
2001-02-14 20:13           ` Andrew Cagney
2001-02-15  1:14             ` Fernando Nasser
2001-02-15 10:34               ` Andrew Cagney
2001-02-14 14:33         ` Michael Snyder
2001-02-14 14:49           ` Elena Zannoni
2001-02-14 14:34       ` Michael Snyder
2001-02-14 13:12     ` Keith Seitz
2001-02-14 13:20     ` Fernando Nasser
2001-02-14 13:37       ` Stan Shebs
2001-02-14 13:46         ` Fernando Nasser
2001-02-14 14:35         ` Michael Snyder
2001-02-14  9:06 Michael Elizabeth Chastain
2001-02-14  9:07 ` Keith Seitz
2001-02-14  9:11 ` Fernando Nasser
2001-02-14 13:41 Michael Elizabeth Chastain
2001-02-14 14:17 Michael Elizabeth Chastain
2001-02-14 14:37 ` Kevin Buettner
2001-02-14 15:12 Michael Elizabeth Chastain
2001-02-14 16:29 Michael Elizabeth Chastain
2001-02-14 18:17 ` Andrew Cagney
2001-02-14 18:35 Michael Elizabeth Chastain
2001-02-14 19:27 Michael Elizabeth Chastain
2001-02-15  1:06 ` Fernando Nasser
2001-02-15  1:22   ` Fernando Nasser
2001-02-15  6:54     ` Kevin Buettner
2001-02-15  7:06 Michael Elizabeth Chastain
2001-02-15  7:32 ` Fernando Nasser
2001-02-15  7:09 Michael Elizabeth Chastain
2001-02-15  7:54 Michael Elizabeth Chastain
2001-02-15  8:09 ` Fernando Nasser
2001-02-15  8:30 Michael Elizabeth Chastain
2001-02-15  8:45 ` Fernando Nasser
2001-02-15  9:00 Michael Elizabeth Chastain
2001-02-15 11:53 ` Fernando Nasser
2001-02-15 11:56 ` Jim Blandy
2001-02-15 12:08 Michael Elizabeth Chastain
2001-02-15 12:41 ` Fernando Nasser
2001-02-15 12:16 Michael Elizabeth Chastain
2001-02-15 23:36 ` Eli Zaretskii
2001-02-15 12:30 Michael Elizabeth Chastain
2001-02-15 12:48 ` Fernando Nasser
2001-02-15 12:56 Michael Elizabeth Chastain
2001-02-16  8:51 ` Jim Blandy
2001-02-15 12:58 Michael Elizabeth Chastain
2001-02-15 19:05 Michael Elizabeth Chastain
2001-02-16  8:36 ` Jim Blandy
2001-02-16  8:41 Michael Elizabeth Chastain
2001-02-16  8:55 Michael Elizabeth Chastain
2001-02-16  9:48 Michael Elizabeth Chastain

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=3A8AEFEA.A2E2A61E@cygnus.com \
    --to=msnyder@cygnus.com \
    --cc=fnasser@cygnus.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=keiths@cygnus.com \
    /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