Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: Luis Machado <luis.machado@linaro.org>, gdb-patches@sourceware.org
Subject: Re: [committed][gdb/testsuite] Add gdb.base/eh_return.exp
Date: Thu, 27 Aug 2020 01:14:40 +0200	[thread overview]
Message-ID: <7a8cc2a5-ea23-31c9-51d5-e81b6d0a2069@suse.de> (raw)
In-Reply-To: <3583b056-388d-86b4-c213-e7b09e30ab89@suse.de>

On 8/26/20 8:02 PM, Tom de Vries wrote:
> On 8/26/20 7:20 PM, Luis Machado wrote:
>> On 8/16/20 8:31 AM, Tom de Vries wrote:
>>> Hi,
>>>
>>> In PR25350, an internal error was reported:
>>> ...
>>> (gdb) break *eh2+0x7e
>>> Breakpoint 1 at 0x13e2: file small.c, line 38.
>>> (gdb) run
>>> Starting program: a.out
>>> [Thread debugging using libthread_db enabled]
>>> Using host libthread_db library "/usr/lib/libthread_db.so.1".
>>>
>>> Breakpoint 1, 0x00005555555553e2 in eh2 (
>>> frame.c:558: internal-error: frame_id get_frame_id(frame_info*): \
>>>    Assertion `stashed' failed.
>>> A problem internal to GDB has been detected,
>>> further debugging may prove unreliable.
>>> ...
>>>
>>> The internal error does not reproduce after recent commit 547ce8f00b
>>> "[gdb/backtrace] Fix printing of fortran string args".
>>>
>>> Add the corresponding test-case as regression test, given that the
>>> code is
>>> rather atypical.
>>>
>>> Tested on x86_64-linux.
>>
>> This doesn't work so well on aarch64-linux because the breakpoint
>> location from before running the program doesn't exists after running
>> it. Things get relocated.
>>
> 
> Right, I don't think that's architecture-related.
> 
> I'm running into the same issue on x86_64-linux with target board
> unix/-fPIE/-pie.
> 
>> -- 
>>
>> (gdb) break *0x000000000000099c^M
>> Breakpoint 1 at 0x99c: file
>> /home/luis.machado/work/tcwg/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.base/eh_return.c,
>> line 54.^M
>> (gdb) PASS: gdb.base/eh_return.exp: setting breakpoint at
>> *0x000000000000099c
>> run ^M
>> Starting program:
>> /home/luis.machado/work/tcwg/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.base/eh_return/eh_return
>> ^M
>> Warning:^M
>> Cannot insert breakpoint 1.^M
>> Cannot access memory at address 0x99c^M
>> ^M
>> (gdb) FAIL: gdb.base/eh_return.exp: hit breakpoint
>>
>> -- 
>>
>> Shouldn't we insert a breakpoint after the relocation has happened?
> 
> As I mentioned in the test-case:
> ...
> # The assert did not reproduce when running to main, and continuing to
> # the breakpoint, so instead, run to the breakpoint.
> ...
> So I'm afraid that's not going to work.
> 
>> Or
>> add the breakpoint to a symbolic reference?
> 
> Yeah, that might work.  If not, we'll have to restrict this to no-pie.

So, I tried this using:
...
$ git diff
diff --git a/gdb/testsuite/gdb.base/eh_return.c
b/gdb/testsuite/gdb.base/eh_ret
urn.c
index 80eea9c783..ba8c1c51aa 100644
--- a/gdb/testsuite/gdb.base/eh_return.c
+++ b/gdb/testsuite/gdb.base/eh_return.c
@@ -51,6 +51,8 @@ eh2 (void *p)
 {
   eh2a (val, val, val, val, val, val, val, val, p);
   __builtin_eh_return (0, p);
+ here:
+  (void)0;
 }


diff --git a/gdb/testsuite/gdb.base/eh_return.exp
b/gdb/testsuite/gdb.base/eh_r
eturn.exp
index e38398ed37..182b2ed86d 100644
--- a/gdb/testsuite/gdb.base/eh_return.exp
+++ b/gdb/testsuite/gdb.base/eh_return.exp
@@ -22,23 +22,9 @@ if {[prepare_for_testing "failed to prepare"
 clean_restart ${binfile}

-gdb_breakpoint "*$address" message
+gdb_breakpoint "eh2:here" message

 # The assert did not reproduce when running to main, and continuing to the
 # breakpoint, so instead, run to the breakpoint.
...

But then we run into another internal-error while setting the
breakpoint, see PR25067:
...
src/gdb/linespec.c:3233: internal-error: void decode_line_full(const
event_location*, int, program_space*, symtab*, int, linespec_result*,
const char*, const char*): Assertion `result.size () == 1 ||
canonical->pre_expanded' failed.^M
A problem internal to GDB has been detected,^M
further debugging may prove unreliable.^M
...

Thanks,
- Tom


  reply	other threads:[~2020-08-26 23:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-16 11:31 Tom de Vries
2020-08-26 17:20 ` Luis Machado
2020-08-26 18:02   ` Tom de Vries
2020-08-26 23:14     ` Tom de Vries [this message]
2020-08-31  8:47       ` Tom de Vries

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=7a8cc2a5-ea23-31c9-51d5-e81b6d0a2069@suse.de \
    --to=tdevries@suse.de \
    --cc=gdb-patches@sourceware.org \
    --cc=luis.machado@linaro.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