Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: gdb-patches@sourceware.org
Subject: Re: gdb.objc/objcdecode.exp test error..
Date: Thu, 24 Sep 2009 17:31:00 -0000	[thread overview]
Message-ID: <20090924173052.GC2112@adacore.com> (raw)
In-Reply-To: <20090924164115.GA2112@adacore.com>

> 2009-09-23  Matt Rice  <ratmice@gmail.com>
> 
> 	* gdb.objc/ambiguous.exp: New objc tests for 8343 with shared libs.
> 	* gdb.objc/ambiguous.m: New objc file.
>       * gdb.objc/objcdecode2.m: New objc file.
>       * gdb.objc/objcdecode3.m: New objc file.

I'm going to treat this testcase independently from the rest as well...
The objc files are missing a copyright header. Can you add one, please?

> set lib_flags [list debug additional_flags=[list -g -fPIC -I${srcdir}/${subdir}] ]

The additional flags that you are adding are a little suspicious.
gdb_compile_shlib is already supposed to handle that, I think.
For use the -g is covered by the "debug" flag. -fPIC seems to be
already taken care of through the addition of the -fpic flag, which
is very similar (apparently, if I understand the GCC doc correctly,
-fPIC just tries to avoid system limitations and -fpic doesn't).
I'm also surprised that the -I[...] option is needed at all.
We have C files in gdb.base that #include .h files, and yet we don't
seem to need to explicitly provide a -I flag. See macscp.exp for one
example of that, where macscp1.c includes macscp3.h.  The problem with
providing the -I switch is that it's specific to GCC and may not work
with other compilers.

> set binfile ${objdir}/${subdir}/${testfile}
> set ambig_opts [list debug additional_flags=[list -g \
>  -DSHLIB_NAME=\"$decode3_binfile\" \
>  -L${objdir}/${subdir} \
>  -Wl,-rpath,${objdir}/${subdir} \
>  -ldl -lobjcdecode2 \
>  -I${srcdir}/${subdir}] ]

Same here. -g should not be necessary. Neither should be the -I.
Neither should be the various -L/-Wl options... Or is there something
special for SOs with ObjC code?

> set name "setup ambiguous expression"
> gdb_test "break foo" "Breakpoint \[0-9\]+ at 0x\[0-9a-f\]+: file .*" $name

When using gdb_test, it's fine to use a variable, but it is not
necessary.  The use of a variable with gdb_test_multiple is just
because it avoids duplicating the test name.

> gdb_test "run" \
> "Breakpoint \[0-9\]+, -\\\[DecodeShlib bar\\\] \\\(.*\\\) at .*" \
> "break on bar class implementation"

You should use "gdb_run_cmd" in this case. Otherwise, it would not work
in a cross environement for instance.

> # i'm not sure why this reacts differently than the above tests

Just a nit: I should be capitalized. But thank you very much for adding
a comment explaining why you've added the test.  These are really helpful.

> return 0

This is unnecessary.

-- 
Joel


  reply	other threads:[~2009-09-24 17:31 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-06  1:31 Matt Rice
2009-03-06 17:33 ` Joel Brobecker
2009-03-06 19:13   ` Pedro Alves
2009-03-07 12:07     ` Matt Rice
2009-03-08 14:16       ` Matt Rice
2009-03-09  2:10         ` Matt Rice
2009-09-11 11:43           ` Matt Rice
2009-09-24  0:53             ` Joel Brobecker
2009-09-24  8:24               ` Matt Rice
2009-09-24 18:28                 ` Tom Tromey
2009-09-24 22:07                   ` Matt Rice
2009-09-24 22:29                 ` Matt Rice
2009-09-24 22:51                   ` Matt Rice
2009-09-25  4:03               ` Matt Rice
2009-10-13  0:44               ` Tom Tromey
2009-10-14  1:59                 ` Joel Brobecker
2009-09-23 23:13         ` Joel Brobecker
2009-09-24  6:48           ` Matt Rice
2009-09-24 16:41             ` Joel Brobecker
2009-09-24 17:31               ` Joel Brobecker [this message]
2009-09-24 17:41               ` Joel Brobecker
2009-09-24 16:52             ` Joel Brobecker

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=20090924173052.GC2112@adacore.com \
    --to=brobecker@adacore.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