Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Matt Rice <ratmice@gmail.com>
To: gdb-patches@sourceware.org
Cc: Joel Brobecker <brobecker@adacore.com>
Subject: Re: gdb.objc/objcdecode.exp test error..
Date: Sat, 07 Mar 2009 12:07:00 -0000	[thread overview]
Message-ID: <8ba6bed40903070407q3e91f0ffs6fc67b2b9c329081@mail.gmail.com> (raw)
In-Reply-To: <200903061913.43419.pedro@codesourcery.com>

[-- Attachment #1: Type: text/plain, Size: 4084 bytes --]

Joel Wrote:
>but it would be better if you had a proper copyright assignment
>at least for GDB (I suggest to assign any past and future changes
>to any GNU software and be done with it, but I understand if you prefer
>to choose a more limited list of projects).

Thanks, I wasn't aware I could assign to all gnu projects,
I've started the paperwork, i'll let you know when its gone through.

>In the meantime, this looks reasonable to me. I can check it in
>for you if you'd like.

it doesn't matter much to me, we might as well just wait and get the
new tests in.

On Fri, Mar 6, 2009 at 11:13 AM, Pedro Alves <pedro@codesourcery.com> wrote:
> Joel Wrote:
>> Matt Rice wrote:
>> > i should probably come up with another test for multiple-symbols all,
>> > so neither failure gets forgotten, but i'll have to learn more about
>> > dejagnu before i'm able to do that.
>
>> That would be very nice if you could add these extra tests.
>> It makes sense to test the behaviour in the "ask" case, but we really
>> ought to try to test the default case as well.
>
> Indeed.  This test internal-errors for me currently, but the patch masks
> it.  I don't see any internal error mentioned in the PRs which
> are linked from the kfails?  It looks like a different bug.
>
>  http://sourceware.org/bugzilla/show_bug.cgi?id=8341
>  http://sourceware.org/bugzilla/show_bug.cgi?id=8343
>
> (gdb) PASS: gdb.objc/objcdecode.exp: break on multiply defined method
> run
> Starting program: /home/pedro/gdb/baseline/build/gdb/testsuite/gdb.objc/objcdecode
> ../../src/gdb/breakpoint.c:7451: internal-error: breakpoint_re_set_one: Assertion `sals.nelts == 1' failed.
> A problem internal to GDB has been detected,
> further debugging may prove unreliable.
>

yes this is a different albeit somewhat related bug, (same cause,
different effect),
it doesn't get this far when using 'ask'.

I went ahead and tried to do some new tests, when trying to clean those up
to use gdb_continue_to_breakpoint, I discovered that it works
correctly after we've hit main,
so i added some tests for that since it appears to be touching
different code paths.

below is some more information, on further reducing the test,
I wasn't sure if or how I should incorporate into the test, as i'm not
sure about the reliability of hard coding breakpoint numbers nor a way
to delete a breakpoint by function name,

it probably doesn't matter its already pretty much reduced.

let me know if you guys have any issues with the tests or ideas on
doing things cleaner,
still pretty new to dejagnu and its mostly just modifications of the
original 'ask' test.

Use the "delete" command to delete unwanted breakpoints.
(gdb) info b
Num     Type           Disp Enb Address            What
1       breakpoint     keep y   0x000000000040072c in -[Decode multipleDef]
                                               at
../.././gdb/testsuite/gdb.objc/objcdecode.m:14
2       breakpoint     keep y   0x0000000000400753 in multipleDef
                                               at
../.././gdb/testsuite/gdb.objc/objcdecode.m:28
(gdb) delete 2
(gdb) r
Starting program: /home/ratmice/git/gdb/gdb/testsuite/gdb.objc/objcdecode
function multipleDef

Breakpoint 1, -[Decode multipleDef] (self=0x604f20, _cmd=0x601450)
    at ../.././gdb/testsuite/gdb.objc/objcdecode.m:14
14	  printf("method multipleDef\n");
(gdb) c
Continuing.
method multipleDef

Program exited normally.
(gdb) delete 1
(gdb) break multipleDef
Breakpoint 3 at 0x40072c: file
../.././gdb/testsuite/gdb.objc/objcdecode.m, line 14.
Breakpoint 4 at 0x400753: file
../.././gdb/testsuite/gdb.objc/objcdecode.m, line 28.
warning: Multiple breakpoints were set.
Use the "delete" command to delete unwanted breakpoints.
(gdb) delete 3
(gdb) r
Starting program: /home/ratmice/git/gdb/gdb/testsuite/gdb.objc/objcdecode
breakpoint.c:7450: internal-error: breakpoint_re_set_one: Assertion
`sals.nelts == 1' failed.

so it only fails on the multipleDef function, not the multipleDef method.

[-- Attachment #2: foo.diff --]
[-- Type: application/octet-stream, Size: 3084 bytes --]

diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 50e61ce..4617c4d 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2009-03-05  Matt Rice  <ratmice@gmail.com>
+
+	* gdb.objc/objcdecode.exp: Set the multiple symbols found behaviour
+	to ask for the original test. Add tests for the multiple symbols
+	found behaviour of all.
+
 2009-03-05  Paul Pluzhnikov  <ppluzhnikov@google.com>
 
 	* solib-display.exp: New file.
diff --git a/gdb/testsuite/gdb.objc/objcdecode.exp b/gdb/testsuite/gdb.objc/objcdecode.exp
index b751fb9..1b77aa6 100644
--- a/gdb/testsuite/gdb.objc/objcdecode.exp
+++ b/gdb/testsuite/gdb.objc/objcdecode.exp
@@ -59,7 +59,8 @@ do_objc_tests
 #
 # Break on multiply defined method (PR objc/1236)
 #
-set name "break on multiply defined method"
+set name "break on multiply defined method using multiple-symbols ask"
+gdb_test "set multiple-symbols ask" ""
 gdb_test_multiple "break multipleDef" $name \
 {
     -re "\\\[0\\\] cancel\r\n\\\[1\\\] all\r\n\\\[2\\\] -.Decode multipleDef. at .*\r\n\\\[3\\\] multipleDef at .*\r\n> $" {
@@ -70,7 +71,7 @@ gdb_test_multiple "break multipleDef" $name \
     -re ".*$gdb_prompt $"   { kfail "gdb/1236" $name }
 }
 
-set name "continue after break on multiply defined symbol"
+set name "run after setting breakpoints on multiply defined symbol"
 gdb_run_cmd
 gdb_test_multiple "" $name \
 {
@@ -84,3 +85,53 @@ gdb_test_multiple "" $name \
 	# It would be difficult to do any more tests after this.
     }
 }
+
+do_objc_tests
+if ![runto_main] { fail "Can't run to main" }
+
+set name "break on multiply defined symbol with multiple-symbols all after main"
+gdb_test "set multiple-symbols all after main" ""
+gdb_test_multiple "break multipleDef" $name \
+{
+  -re "Breakpoint \[0-9\]+ at 0x\[0-9a-f\]+: file .*\r\nBreakpoint \[0-9\]+ at 0x\[0-9a-f\]+: file .*\r\n$gdb_prompt $" { pass $name }
+  -re ".*$gdb_prompt $"   { fail $name }
+}
+
+set name "can hit multiply defined breakpoint on function after main"
+gdb_continue_to_breakpoint "function multipleDef"
+
+set name "can hit multiply defined breakpoint on objc method after main"
+gdb_continue_to_breakpoint "method multipleDef"
+gdb_exit
+
+do_objc_tests
+
+set name "break on multiply defined symbol with multiple-symbols all before main"
+gdb_test_multiple "break multipleDef" $name \
+{
+  -re "Breakpoint \[0-9\]+ at 0x\[0-9a-f\]+: file .*\r\nBreakpoint \[0-9\]+ at 0x\[0-9a-f\]+: file .*\r\n$gdb_prompt $" { pass $name }
+  -re ".*$gdb_prompt $"   { fail $name }
+}
+
+set name "can hit multiply defined breakpoint on function before main"
+gdb_run_cmd
+gdb_test_multiple "" $name \
+{
+   -re "Breakpoint \[0-9\]+, multipleDef \\\(\\\) at .*\r\n$gdb_prompt $" {
+	pass $name
+    }
+   -re ".*$gdb_prompt $" { fail $name }
+}
+
+set name "can hit multiply defined breakpoint on function before main"
+gdb_test_multiple "continue" $name \
+{
+   -re "Breakpoint \[0-9\]+, -\[Decode multipleDef\] at .*\r\n$gdb_prompt $" {
+	pass $name
+    }
+   -re ".*$gdb_prompt $" { fail $name }
+}
+
+gdb_exit
+return 0
+

  reply	other threads:[~2009-03-07 12:07 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 [this message]
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
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=8ba6bed40903070407q3e91f0ffs6fc67b2b9c329081@mail.gmail.com \
    --to=ratmice@gmail.com \
    --cc=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