public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH v3 2/2] Fix an undefined behavior in record_line
@ 2020-03-27  3:50 Bernd Edlinger
  2020-04-01 16:23 ` Tom Tromey
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Bernd Edlinger @ 2020-03-27  3:50 UTC (permalink / raw)
  To: gdb-patches, Andrew Burgess

Additionally do not completely remove symbols
at the same PC than the end marker, instead
make them non-is-stmt breakpoints.

2020-03-27  Bernd Edlinger  <bernd.edlinger@hotmail.de>
	* buildsym.c (record_line): Fix undefined behavior and preserve
	lines at eof.
---
 gdb/buildsym.c | 34 ++++++++++++++++++----------------
 1 file changed, 18 insertions(+), 16 deletions(-)

diff --git a/gdb/buildsym.c b/gdb/buildsym.c
index 2d1e441..46c5bb1 100644
--- a/gdb/buildsym.c
+++ b/gdb/buildsym.c
@@ -705,27 +705,29 @@ struct blockvector *
 		      * sizeof (struct linetable_entry))));
     }
 
-  /* Normally, we treat lines as unsorted.  But the end of sequence
-     marker is special.  We sort line markers at the same PC by line
-     number, so end of sequence markers (which have line == 0) appear
-     first.  This is right if the marker ends the previous function,
-     and there is no padding before the next function.  But it is
-     wrong if the previous line was empty and we are now marking a
-     switch to a different subfile.  We must leave the end of sequence
-     marker at the end of this group of lines, not sort the empty line
-     to after the marker.  The easiest way to accomplish this is to
-     delete any empty lines from our table, if they are followed by
-     end of sequence markers.  All we lose is the ability to set
-     breakpoints at some lines which contain no instructions
-     anyway.  */
+  /* The end of sequence marker is special.  We need to reset the
+     is_stmt flag on previous lines at the same PC, otherwise these
+     lines may cause problems since they might be at the same address
+     as the following function.  For instance suppose a function calls
+     abort there is no reason to emit a ret after that point (no joke).
+     So the label may be at the same address where the following
+     function begins.  A similar problem appears if a label is at the
+     same address where an inline function ends we cannot reliably tell
+     if this is considered part of the inline function or the calling
+     program or even the next inline function, so stack traces may
+     give surprising results.  Expect gdb.cp/step-and-next-inline.exp
+     to fail if these lines are not modified here.  */
   if (line == 0 && subfile->line_vector->nitems > 0)
     {
-      e = subfile->line_vector->item + subfile->line_vector->nitems - 1;
-      while (subfile->line_vector->nitems > 0 && e->pc == pc)
+      e = subfile->line_vector->item + subfile->line_vector->nitems;
+      do
 	{
 	  e--;
-	  subfile->line_vector->nitems--;
+	  if (e->pc != pc || e->line == 0)
+	    break;
+	  e->is_stmt = 0;
 	}
+      while (e > subfile->line_vector->item);
     }
 
   e = subfile->line_vector->item + subfile->line_vector->nitems++;
-- 
1.9.1

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v3 2/2] Fix an undefined behavior in record_line
  2020-03-27  3:50 [PATCH v3 2/2] Fix an undefined behavior in record_line Bernd Edlinger
@ 2020-04-01 16:23 ` Tom Tromey
  2020-04-01 16:52   ` Bernd Edlinger
  2020-04-03 22:53 ` Luis Machado
  2020-04-04 23:03 ` Andrew Burgess
  2 siblings, 1 reply; 18+ messages in thread
From: Tom Tromey @ 2020-04-01 16:23 UTC (permalink / raw)
  To: Bernd Edlinger; +Cc: gdb-patches, Andrew Burgess

>>>>> "Bernd" == Bernd Edlinger <bernd.edlinger@hotmail.de> writes:

Bernd> Additionally do not completely remove symbols
Bernd> at the same PC than the end marker, instead
Bernd> make them non-is-stmt breakpoints.

Bernd> 2020-03-27  Bernd Edlinger  <bernd.edlinger@hotmail.de>
Bernd> 	* buildsym.c (record_line): Fix undefined behavior and preserve
Bernd> 	lines at eof.

IIUC this fixes:

Bernd> +     give surprising results.  Expect gdb.cp/step-and-next-inline.exp
Bernd> +     to fail if these lines are not modified here.  */

... but doesn't regress anything else?

In that case I think it's fine.  Thank you.

Tom

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v3 2/2] Fix an undefined behavior in record_line
  2020-04-01 16:23 ` Tom Tromey
@ 2020-04-01 16:52   ` Bernd Edlinger
  2020-04-01 18:40     ` Bernd Edlinger
  0 siblings, 1 reply; 18+ messages in thread
From: Bernd Edlinger @ 2020-04-01 16:52 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches, Andrew Burgess

On 4/1/20 6:23 PM, Tom Tromey wrote:
>>>>>> "Bernd" == Bernd Edlinger <bernd.edlinger@hotmail.de> writes:
> 
> Bernd> Additionally do not completely remove symbols
> Bernd> at the same PC than the end marker, instead
> Bernd> make them non-is-stmt breakpoints.
> 
> Bernd> 2020-03-27  Bernd Edlinger  <bernd.edlinger@hotmail.de>
> Bernd> 	* buildsym.c (record_line): Fix undefined behavior and preserve
> Bernd> 	lines at eof.
> 
> IIUC this fixes:
> 
> Bernd> +     give surprising results.  Expect gdb.cp/step-and-next-inline.exp
> Bernd> +     to fail if these lines are not modified here.  */
> 
> ... but doesn't regress anything else?
> 

I did my best to compare the test results with and without this
patch, but I have plenty of time, and can repeat that test before
I commit, just to make sure that it is still the case.

> In that case I think it's fine.  Thank you.
> 
> Tom
> 

Thanks
Bernd.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v3 2/2] Fix an undefined behavior in record_line
  2020-04-01 16:52   ` Bernd Edlinger
@ 2020-04-01 18:40     ` Bernd Edlinger
  2020-04-01 18:53       ` Tom Tromey
  0 siblings, 1 reply; 18+ messages in thread
From: Bernd Edlinger @ 2020-04-01 18:40 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches, Andrew Burgess

On 4/1/20 6:52 PM, Bernd Edlinger wrote:
> On 4/1/20 6:23 PM, Tom Tromey wrote:
>>>>>>> "Bernd" == Bernd Edlinger <bernd.edlinger@hotmail.de> writes:
>>
>> Bernd> Additionally do not completely remove symbols
>> Bernd> at the same PC than the end marker, instead
>> Bernd> make them non-is-stmt breakpoints.
>>
>> Bernd> 2020-03-27  Bernd Edlinger  <bernd.edlinger@hotmail.de>
>> Bernd> 	* buildsym.c (record_line): Fix undefined behavior and preserve
>> Bernd> 	lines at eof.
>>
>> IIUC this fixes:
>>
>> Bernd> +     give surprising results.  Expect gdb.cp/step-and-next-inline.exp
>> Bernd> +     to fail if these lines are not modified here.  */
>>
>> ... but doesn't regress anything else?
>>
> 
> I did my best to compare the test results with and without this
> patch, but I have plenty of time, and can repeat that test before
> I commit, just to make sure that it is still the case.
> 
>> In that case I think it's fine.  Thank you.
>>
>> Tom
>>
> 
> Thanks
> Bernd.
> 

One last question, does this approval also include
part 1/2 "Fix the resizing condition of the line table" ?


Thanks
Bernd.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v3 2/2] Fix an undefined behavior in record_line
  2020-04-01 18:40     ` Bernd Edlinger
@ 2020-04-01 18:53       ` Tom Tromey
  2020-04-01 19:01         ` Bernd Edlinger
  0 siblings, 1 reply; 18+ messages in thread
From: Tom Tromey @ 2020-04-01 18:53 UTC (permalink / raw)
  To: Bernd Edlinger; +Cc: Tom Tromey, gdb-patches

>>>>> "Bernd" == Bernd Edlinger <bernd.edlinger@hotmail.de> writes:

Bernd> One last question, does this approval also include
Bernd> part 1/2 "Fix the resizing condition of the line table" ?

Yeah...  I sent a separate note about that.

https://sourceware.org/pipermail/gdb-patches/2020-April/167214.html

Anyway, no worries, please go ahead :)

Tom

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v3 2/2] Fix an undefined behavior in record_line
  2020-04-01 18:53       ` Tom Tromey
@ 2020-04-01 19:01         ` Bernd Edlinger
  0 siblings, 0 replies; 18+ messages in thread
From: Bernd Edlinger @ 2020-04-01 19:01 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

On 4/1/20 8:53 PM, Tom Tromey wrote:
>>>>>> "Bernd" == Bernd Edlinger <bernd.edlinger@hotmail.de> writes:
> 
> Bernd> One last question, does this approval also include
> Bernd> part 1/2 "Fix the resizing condition of the line table" ?
> 
> Yeah...  I sent a separate note about that.
> 
> https://sourceware.org/pipermail/gdb-patches/2020-April/167214.html
> 
> Anyway, no worries, please go ahead :)
> 
> Tom
> 

Ah, interesting, not in my inbox and not in my spam folder either,
I think I did recently also not receive a response to one of my linux
patches, which I also saw only on the mailing list archives, but
I was wondering why I did not receive it in the first place.
Did this message bounce, or is it grey-listed, I don't think hotmail.de
does this, but you never know.


Thanks
Bernd.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v3 2/2] Fix an undefined behavior in record_line
  2020-03-27  3:50 [PATCH v3 2/2] Fix an undefined behavior in record_line Bernd Edlinger
  2020-04-01 16:23 ` Tom Tromey
@ 2020-04-03 22:53 ` Luis Machado
  2020-04-04  4:21   ` Bernd Edlinger
  2020-04-04 23:03 ` Andrew Burgess
  2 siblings, 1 reply; 18+ messages in thread
From: Luis Machado @ 2020-04-03 22:53 UTC (permalink / raw)
  To: Bernd Edlinger, gdb-patches, Andrew Burgess

Hi,

This seems to have caused a few regressions for aarch64-linux. I'm 
seeing the following:

FAIL: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-3: step into 
foo from main
FAIL: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-3: step into 
bar from foo
FAIL: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-3: step out of 
bar to foo
FAIL: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-3: step into 
foo_cold from foo
FAIL: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-3: step into 
baz from foo_cold
FAIL: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-3: step out of 
baz to foo_cold
FAIL: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-3: step out of 
foo_cold to foo
FAIL: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-3: step out of 
foo to main
FAIL: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-3: step into 
foo from main
FAIL: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-3: step into 
bar from foo
FAIL: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-3: step out of 
bar to foo
FAIL: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-3: step into 
foo_cold from foo
FAIL: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-3: step into 
baz from foo_cold
FAIL: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-3: step out of 
baz to foo_cold
FAIL: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-3: step out of 
foo_cold to foo
FAIL: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-3: step out of 
foo to main

git bisect pointed at this commit:

---

commit 64dc2d4bd24ff7119c913fff91184414f09b8042
Author: Bernd Edlinger <bernd.edlinger@hotmail.de>
Date:   Thu Mar 12 11:52:34 2020 +0100

     Fix an undefined behavior in record_line

     Additionally do not completely remove symbols
     at the same PC than the end marker, instead
     make them non-is-stmt breakpoints.

     2020-04-01  Bernd Edlinger  <bernd.edlinger@hotmail.de>

             * buildsym.c (record_line): Fix undefined behavior and 
preserve lines at eof.

---

What i see in the log is stepping through lines not working as expected.


On 3/27/20 12:50 AM, Bernd Edlinger wrote:
> Additionally do not completely remove symbols
> at the same PC than the end marker, instead
> make them non-is-stmt breakpoints.
> 
> 2020-03-27  Bernd Edlinger  <bernd.edlinger@hotmail.de>
> 	* buildsym.c (record_line): Fix undefined behavior and preserve
> 	lines at eof.
> ---
>   gdb/buildsym.c | 34 ++++++++++++++++++----------------
>   1 file changed, 18 insertions(+), 16 deletions(-)
> 
> diff --git a/gdb/buildsym.c b/gdb/buildsym.c
> index 2d1e441..46c5bb1 100644
> --- a/gdb/buildsym.c
> +++ b/gdb/buildsym.c
> @@ -705,27 +705,29 @@ struct blockvector *
>   		      * sizeof (struct linetable_entry))));
>       }
>   
> -  /* Normally, we treat lines as unsorted.  But the end of sequence
> -     marker is special.  We sort line markers at the same PC by line
> -     number, so end of sequence markers (which have line == 0) appear
> -     first.  This is right if the marker ends the previous function,
> -     and there is no padding before the next function.  But it is
> -     wrong if the previous line was empty and we are now marking a
> -     switch to a different subfile.  We must leave the end of sequence
> -     marker at the end of this group of lines, not sort the empty line
> -     to after the marker.  The easiest way to accomplish this is to
> -     delete any empty lines from our table, if they are followed by
> -     end of sequence markers.  All we lose is the ability to set
> -     breakpoints at some lines which contain no instructions
> -     anyway.  */
> +  /* The end of sequence marker is special.  We need to reset the
> +     is_stmt flag on previous lines at the same PC, otherwise these
> +     lines may cause problems since they might be at the same address
> +     as the following function.  For instance suppose a function calls
> +     abort there is no reason to emit a ret after that point (no joke).
> +     So the label may be at the same address where the following
> +     function begins.  A similar problem appears if a label is at the
> +     same address where an inline function ends we cannot reliably tell
> +     if this is considered part of the inline function or the calling
> +     program or even the next inline function, so stack traces may
> +     give surprising results.  Expect gdb.cp/step-and-next-inline.exp
> +     to fail if these lines are not modified here.  */
>     if (line == 0 && subfile->line_vector->nitems > 0)
>       {
> -      e = subfile->line_vector->item + subfile->line_vector->nitems - 1;
> -      while (subfile->line_vector->nitems > 0 && e->pc == pc)
> +      e = subfile->line_vector->item + subfile->line_vector->nitems;
> +      do
>   	{
>   	  e--;
> -	  subfile->line_vector->nitems--;
> +	  if (e->pc != pc || e->line == 0)
> +	    break;
> +	  e->is_stmt = 0;
>   	}
> +      while (e > subfile->line_vector->item);
>       }
>   
>     e = subfile->line_vector->item + subfile->line_vector->nitems++;
> 

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v3 2/2] Fix an undefined behavior in record_line
  2020-04-03 22:53 ` Luis Machado
@ 2020-04-04  4:21   ` Bernd Edlinger
  2020-04-04  7:06     ` Bernd Edlinger
  0 siblings, 1 reply; 18+ messages in thread
From: Bernd Edlinger @ 2020-04-04  4:21 UTC (permalink / raw)
  To: Luis Machado, gdb-patches, Andrew Burgess



On 4/4/20 12:53 AM, Luis Machado wrote:
> Hi,
> 
> This seems to have caused a few regressions for aarch64-linux. I'm seeing the following:
> 
> FAIL: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-3: step into foo from main
> FAIL: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-3: step into bar from foo
> FAIL: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-3: step out of bar to foo
> FAIL: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-3: step into foo_cold from foo
> FAIL: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-3: step into baz from foo_cold
> FAIL: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-3: step out of baz to foo_cold
> FAIL: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-3: step out of foo_cold to foo
> FAIL: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-3: step out of foo to main
> FAIL: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-3: step into foo from main
> FAIL: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-3: step into bar from foo
> FAIL: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-3: step out of bar to foo
> FAIL: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-3: step into foo_cold from foo
> FAIL: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-3: step into baz from foo_cold
> FAIL: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-3: step out of baz to foo_cold
> FAIL: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-3: step out of foo_cold to foo
> FAIL: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-3: step out of foo to main
> 
> git bisect pointed at this commit:
> 

Oh, dear.

Andrew, please watch out,

your other patch is also about to
change something in this area.

I tested on x86_64 where everything looked good,
(at least for me, but sime test cases are always faling
or are unstable ...)

It could be that your patch

PATCH 2/2] gdb: Preserve is-stmt lines when switch between files

I just saw in my inbox is also trying to address the same issue.

I was not aware that you were working on the same issue.


Thanks
Bernd.

> ---
> 
> commit 64dc2d4bd24ff7119c913fff91184414f09b8042
> Author: Bernd Edlinger <bernd.edlinger@hotmail.de>
> Date:   Thu Mar 12 11:52:34 2020 +0100
> 
>     Fix an undefined behavior in record_line
> 
>     Additionally do not completely remove symbols
>     at the same PC than the end marker, instead
>     make them non-is-stmt breakpoints.
> 
>     2020-04-01  Bernd Edlinger  <bernd.edlinger@hotmail.de>
> 
>             * buildsym.c (record_line): Fix undefined behavior and preserve lines at eof.
> 
> ---
> 
> What i see in the log is stepping through lines not working as expected.
> 
> 
> On 3/27/20 12:50 AM, Bernd Edlinger wrote:
>> Additionally do not completely remove symbols
>> at the same PC than the end marker, instead
>> make them non-is-stmt breakpoints.
>>
>> 2020-03-27  Bernd Edlinger  <bernd.edlinger@hotmail.de>
>>     * buildsym.c (record_line): Fix undefined behavior and preserve
>>     lines at eof.
>> ---
>>   gdb/buildsym.c | 34 ++++++++++++++++++----------------
>>   1 file changed, 18 insertions(+), 16 deletions(-)
>>
>> diff --git a/gdb/buildsym.c b/gdb/buildsym.c
>> index 2d1e441..46c5bb1 100644
>> --- a/gdb/buildsym.c
>> +++ b/gdb/buildsym.c
>> @@ -705,27 +705,29 @@ struct blockvector *
>>                 * sizeof (struct linetable_entry))));
>>       }
>>   -  /* Normally, we treat lines as unsorted.  But the end of sequence
>> -     marker is special.  We sort line markers at the same PC by line
>> -     number, so end of sequence markers (which have line == 0) appear
>> -     first.  This is right if the marker ends the previous function,
>> -     and there is no padding before the next function.  But it is
>> -     wrong if the previous line was empty and we are now marking a
>> -     switch to a different subfile.  We must leave the end of sequence
>> -     marker at the end of this group of lines, not sort the empty line
>> -     to after the marker.  The easiest way to accomplish this is to
>> -     delete any empty lines from our table, if they are followed by
>> -     end of sequence markers.  All we lose is the ability to set
>> -     breakpoints at some lines which contain no instructions
>> -     anyway.  */
>> +  /* The end of sequence marker is special.  We need to reset the
>> +     is_stmt flag on previous lines at the same PC, otherwise these
>> +     lines may cause problems since they might be at the same address
>> +     as the following function.  For instance suppose a function calls
>> +     abort there is no reason to emit a ret after that point (no joke).
>> +     So the label may be at the same address where the following
>> +     function begins.  A similar problem appears if a label is at the
>> +     same address where an inline function ends we cannot reliably tell
>> +     if this is considered part of the inline function or the calling
>> +     program or even the next inline function, so stack traces may
>> +     give surprising results.  Expect gdb.cp/step-and-next-inline.exp
>> +     to fail if these lines are not modified here.  */
>>     if (line == 0 && subfile->line_vector->nitems > 0)
>>       {
>> -      e = subfile->line_vector->item + subfile->line_vector->nitems - 1;
>> -      while (subfile->line_vector->nitems > 0 && e->pc == pc)
>> +      e = subfile->line_vector->item + subfile->line_vector->nitems;
>> +      do
>>       {
>>         e--;
>> -      subfile->line_vector->nitems--;
>> +      if (e->pc != pc || e->line == 0)
>> +        break;
>> +      e->is_stmt = 0;
>>       }
>> +      while (e > subfile->line_vector->item);
>>       }
>>       e = subfile->line_vector->item + subfile->line_vector->nitems++;
>>

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v3 2/2] Fix an undefined behavior in record_line
  2020-04-04  4:21   ` Bernd Edlinger
@ 2020-04-04  7:06     ` Bernd Edlinger
  2020-04-04 13:56       ` Luis Machado
  0 siblings, 1 reply; 18+ messages in thread
From: Bernd Edlinger @ 2020-04-04  7:06 UTC (permalink / raw)
  To: Luis Machado, gdb-patches, Andrew Burgess

On 4/4/20 6:21 AM, Bernd Edlinger wrote:
> 
> 
> On 4/4/20 12:53 AM, Luis Machado wrote:
>> Hi,
>>
>> This seems to have caused a few regressions for aarch64-linux. I'm seeing the following:
>>
>> FAIL: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-3: step into foo from main
>> FAIL: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-3: step into bar from foo
>> FAIL: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-3: step out of bar to foo
>> FAIL: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-3: step into foo_cold from foo
>> FAIL: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-3: step into baz from foo_cold
>> FAIL: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-3: step out of baz to foo_cold
>> FAIL: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-3: step out of foo_cold to foo
>> FAIL: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-3: step out of foo to main
>> FAIL: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-3: step into foo from main
>> FAIL: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-3: step into bar from foo
>> FAIL: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-3: step out of bar to foo
>> FAIL: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-3: step into foo_cold from foo
>> FAIL: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-3: step into baz from foo_cold
>> FAIL: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-3: step out of baz to foo_cold
>> FAIL: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-3: step out of foo_cold to foo
>> FAIL: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-3: step out of foo to main
>>
>> git bisect pointed at this commit:
>>

Louis,

So, I cannot do much, to debug aarch64 here.
I would however like to know what the output of the test result is,
when it fails, that is where the step does stop when it is not where it should.

And how the line table looks in the test case when it is compiled on aarch64,
btw. which gcc version do you use?

Thanks
Bernd.

> 
> Oh, dear.
> 
> Andrew, please watch out,
> 
> your other patch is also about to
> change something in this area.
> 
> I tested on x86_64 where everything looked good,
> (at least for me, but sime test cases are always faling
> or are unstable ...)
> 
> It could be that your patch
> 
> PATCH 2/2] gdb: Preserve is-stmt lines when switch between files
> 
> I just saw in my inbox is also trying to address the same issue.
> 
> I was not aware that you were working on the same issue.
> 
> 
> Thanks
> Bernd.
> 
>> ---
>>
>> commit 64dc2d4bd24ff7119c913fff91184414f09b8042
>> Author: Bernd Edlinger <bernd.edlinger@hotmail.de>
>> Date:   Thu Mar 12 11:52:34 2020 +0100
>>
>>     Fix an undefined behavior in record_line
>>
>>     Additionally do not completely remove symbols
>>     at the same PC than the end marker, instead
>>     make them non-is-stmt breakpoints.
>>
>>     2020-04-01  Bernd Edlinger  <bernd.edlinger@hotmail.de>
>>
>>             * buildsym.c (record_line): Fix undefined behavior and preserve lines at eof.
>>
>> ---
>>
>> What i see in the log is stepping through lines not working as expected.
>>
>>
>> On 3/27/20 12:50 AM, Bernd Edlinger wrote:
>>> Additionally do not completely remove symbols
>>> at the same PC than the end marker, instead
>>> make them non-is-stmt breakpoints.
>>>
>>> 2020-03-27  Bernd Edlinger  <bernd.edlinger@hotmail.de>
>>>     * buildsym.c (record_line): Fix undefined behavior and preserve
>>>     lines at eof.
>>> ---
>>>   gdb/buildsym.c | 34 ++++++++++++++++++----------------
>>>   1 file changed, 18 insertions(+), 16 deletions(-)
>>>
>>> diff --git a/gdb/buildsym.c b/gdb/buildsym.c
>>> index 2d1e441..46c5bb1 100644
>>> --- a/gdb/buildsym.c
>>> +++ b/gdb/buildsym.c
>>> @@ -705,27 +705,29 @@ struct blockvector *
>>>                 * sizeof (struct linetable_entry))));
>>>       }
>>>   -  /* Normally, we treat lines as unsorted.  But the end of sequence
>>> -     marker is special.  We sort line markers at the same PC by line
>>> -     number, so end of sequence markers (which have line == 0) appear
>>> -     first.  This is right if the marker ends the previous function,
>>> -     and there is no padding before the next function.  But it is
>>> -     wrong if the previous line was empty and we are now marking a
>>> -     switch to a different subfile.  We must leave the end of sequence
>>> -     marker at the end of this group of lines, not sort the empty line
>>> -     to after the marker.  The easiest way to accomplish this is to
>>> -     delete any empty lines from our table, if they are followed by
>>> -     end of sequence markers.  All we lose is the ability to set
>>> -     breakpoints at some lines which contain no instructions
>>> -     anyway.  */
>>> +  /* The end of sequence marker is special.  We need to reset the
>>> +     is_stmt flag on previous lines at the same PC, otherwise these
>>> +     lines may cause problems since they might be at the same address
>>> +     as the following function.  For instance suppose a function calls
>>> +     abort there is no reason to emit a ret after that point (no joke).
>>> +     So the label may be at the same address where the following
>>> +     function begins.  A similar problem appears if a label is at the
>>> +     same address where an inline function ends we cannot reliably tell
>>> +     if this is considered part of the inline function or the calling
>>> +     program or even the next inline function, so stack traces may
>>> +     give surprising results.  Expect gdb.cp/step-and-next-inline.exp
>>> +     to fail if these lines are not modified here.  */
>>>     if (line == 0 && subfile->line_vector->nitems > 0)
>>>       {
>>> -      e = subfile->line_vector->item + subfile->line_vector->nitems - 1;
>>> -      while (subfile->line_vector->nitems > 0 && e->pc == pc)
>>> +      e = subfile->line_vector->item + subfile->line_vector->nitems;
>>> +      do
>>>       {
>>>         e--;
>>> -      subfile->line_vector->nitems--;
>>> +      if (e->pc != pc || e->line == 0)
>>> +        break;
>>> +      e->is_stmt = 0;
>>>       }
>>> +      while (e > subfile->line_vector->item);
>>>       }
>>>       e = subfile->line_vector->item + subfile->line_vector->nitems++;
>>>

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v3 2/2] Fix an undefined behavior in record_line
  2020-04-04  7:06     ` Bernd Edlinger
@ 2020-04-04 13:56       ` Luis Machado
  2020-04-04 16:06         ` Bernd Edlinger
  0 siblings, 1 reply; 18+ messages in thread
From: Luis Machado @ 2020-04-04 13:56 UTC (permalink / raw)
  To: Bernd Edlinger, gdb-patches, Andrew Burgess

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

Hi Bernd,

On 4/4/20 4:06 AM, Bernd Edlinger wrote:
> On 4/4/20 6:21 AM, Bernd Edlinger wrote:
>>
>>
>> On 4/4/20 12:53 AM, Luis Machado wrote:
>>> Hi,
>>>
>>> This seems to have caused a few regressions for aarch64-linux. I'm seeing the following:
>>>
>>> FAIL: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-3: step into foo from main
>>> FAIL: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-3: step into bar from foo
>>> FAIL: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-3: step out of bar to foo
>>> FAIL: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-3: step into foo_cold from foo
>>> FAIL: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-3: step into baz from foo_cold
>>> FAIL: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-3: step out of baz to foo_cold
>>> FAIL: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-3: step out of foo_cold to foo
>>> FAIL: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-3: step out of foo to main
>>> FAIL: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-3: step into foo from main
>>> FAIL: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-3: step into bar from foo
>>> FAIL: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-3: step out of bar to foo
>>> FAIL: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-3: step into foo_cold from foo
>>> FAIL: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-3: step into baz from foo_cold
>>> FAIL: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-3: step out of baz to foo_cold
>>> FAIL: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-3: step out of foo_cold to foo
>>> FAIL: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-3: step out of foo to main
>>>
>>> git bisect pointed at this commit:
>>>
> 
> Louis,
> 
> So, I cannot do much, to debug aarch64 here.
> I would however like to know what the output of the test result is,
> when it fails, that is where the step does stop when it is not where it should.

On a quick look, we're stopping at the wrong location during an attempt 
to break at "main". I think things just derail from there.

For now, please find attached a couple logs, one without regressions and 
one with the failing tests.

Also, I've attached the decoded/raw line information for both binaries 
from this testcase. I can play with it further to get more information 
if you need. Hopefully this data is useful for now.

Let me know otherwise.

> 
> And how the line table looks in the test case when it is compiled on aarch64,
> btw. which gcc version do you use?

The compiler version is gcc version 7.4.0 (Ubuntu/Linaro 
7.4.0-1ubuntu1~18.04.1).

> 
> Thanks
> Bernd.
> 
>>
>> Oh, dear.
>>
>> Andrew, please watch out,
>>
>> your other patch is also about to
>> change something in this area.
>>
>> I tested on x86_64 where everything looked good,
>> (at least for me, but sime test cases are always faling
>> or are unstable ...)
>>
>> It could be that your patch
>>
>> PATCH 2/2] gdb: Preserve is-stmt lines when switch between files
>>
>> I just saw in my inbox is also trying to address the same issue.
>>
>> I was not aware that you were working on the same issue.
>>
>>
>> Thanks
>> Bernd.
>>
>>> ---
>>>
>>> commit 64dc2d4bd24ff7119c913fff91184414f09b8042
>>> Author: Bernd Edlinger <bernd.edlinger@hotmail.de>
>>> Date:   Thu Mar 12 11:52:34 2020 +0100
>>>
>>>      Fix an undefined behavior in record_line
>>>
>>>      Additionally do not completely remove symbols
>>>      at the same PC than the end marker, instead
>>>      make them non-is-stmt breakpoints.
>>>
>>>      2020-04-01  Bernd Edlinger  <bernd.edlinger@hotmail.de>
>>>
>>>              * buildsym.c (record_line): Fix undefined behavior and preserve lines at eof.
>>>
>>> ---
>>>
>>> What i see in the log is stepping through lines not working as expected.
>>>
>>>
>>> On 3/27/20 12:50 AM, Bernd Edlinger wrote:
>>>> Additionally do not completely remove symbols
>>>> at the same PC than the end marker, instead
>>>> make them non-is-stmt breakpoints.
>>>>
>>>> 2020-03-27  Bernd Edlinger  <bernd.edlinger@hotmail.de>
>>>>      * buildsym.c (record_line): Fix undefined behavior and preserve
>>>>      lines at eof.
>>>> ---
>>>>    gdb/buildsym.c | 34 ++++++++++++++++++----------------
>>>>    1 file changed, 18 insertions(+), 16 deletions(-)
>>>>
>>>> diff --git a/gdb/buildsym.c b/gdb/buildsym.c
>>>> index 2d1e441..46c5bb1 100644
>>>> --- a/gdb/buildsym.c
>>>> +++ b/gdb/buildsym.c
>>>> @@ -705,27 +705,29 @@ struct blockvector *
>>>>                  * sizeof (struct linetable_entry))));
>>>>        }
>>>>    -  /* Normally, we treat lines as unsorted.  But the end of sequence
>>>> -     marker is special.  We sort line markers at the same PC by line
>>>> -     number, so end of sequence markers (which have line == 0) appear
>>>> -     first.  This is right if the marker ends the previous function,
>>>> -     and there is no padding before the next function.  But it is
>>>> -     wrong if the previous line was empty and we are now marking a
>>>> -     switch to a different subfile.  We must leave the end of sequence
>>>> -     marker at the end of this group of lines, not sort the empty line
>>>> -     to after the marker.  The easiest way to accomplish this is to
>>>> -     delete any empty lines from our table, if they are followed by
>>>> -     end of sequence markers.  All we lose is the ability to set
>>>> -     breakpoints at some lines which contain no instructions
>>>> -     anyway.  */
>>>> +  /* The end of sequence marker is special.  We need to reset the
>>>> +     is_stmt flag on previous lines at the same PC, otherwise these
>>>> +     lines may cause problems since they might be at the same address
>>>> +     as the following function.  For instance suppose a function calls
>>>> +     abort there is no reason to emit a ret after that point (no joke).
>>>> +     So the label may be at the same address where the following
>>>> +     function begins.  A similar problem appears if a label is at the
>>>> +     same address where an inline function ends we cannot reliably tell
>>>> +     if this is considered part of the inline function or the calling
>>>> +     program or even the next inline function, so stack traces may
>>>> +     give surprising results.  Expect gdb.cp/step-and-next-inline.exp
>>>> +     to fail if these lines are not modified here.  */
>>>>      if (line == 0 && subfile->line_vector->nitems > 0)
>>>>        {
>>>> -      e = subfile->line_vector->item + subfile->line_vector->nitems - 1;
>>>> -      while (subfile->line_vector->nitems > 0 && e->pc == pc)
>>>> +      e = subfile->line_vector->item + subfile->line_vector->nitems;
>>>> +      do
>>>>        {
>>>>          e--;
>>>> -      subfile->line_vector->nitems--;
>>>> +      if (e->pc != pc || e->line == 0)
>>>> +        break;
>>>> +      e->is_stmt = 0;
>>>>        }
>>>> +      while (e > subfile->line_vector->item);
>>>>        }
>>>>        e = subfile->line_vector->item + subfile->line_vector->nitems++;
>>>>

[-- Attachment #2: dw2-ranges-func-hi-cold.l --]
[-- Type: text/plain, Size: 3077 bytes --]

Raw dump of debug contents of section .debug_line:

  Offset:                      0x0
  Length:                      413
  DWARF Version:               2
  Prologue Length:             170
  Minimum Instruction Length:  1
  Initial value of 'is_stmt':  1
  Line Base:                   1
  Line Range:                  1
  Opcode Base:                 10

 Opcodes:
  Opcode 1 has 0 args
  Opcode 2 has 1 arg
  Opcode 3 has 1 arg
  Opcode 4 has 1 arg
  Opcode 5 has 1 arg
  Opcode 6 has 0 args
  Opcode 7 has 0 args
  Opcode 8 has 0 args
  Opcode 9 has 1 arg

 The Directory Table (offset 0x18):
  1	/home/luis.machado/work/tcwg/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2

 The File Name Table (offset 0x96):
  Entry	Dir	Time	Size	Name
  1	1	0	0	dw2-ranges-func-lo-cold.c

 Line Number Statements:
  [0x000000b4]  Extended opcode 2: set Address to 0x73c
  [0x000000bf]  Advance Line by 75 to 76
  [0x000000c2]  Copy
  [0x000000c3]  Extended opcode 2: set Address to 0x744
  [0x000000ce]  Advance Line by 2 to 78
  [0x000000d0]  Copy
  [0x000000d1]  Extended opcode 2: set Address to 0x748
  [0x000000dc]  Advance Line by 2 to 80
  [0x000000de]  Copy
  [0x000000df]  Extended opcode 2: set Address to 0x754
  [0x000000ea]  Advance Line by 2 to 82
  [0x000000ec]  Copy
  [0x000000ed]  Extended opcode 1: End of Sequence

  [0x000000f0]  Extended opcode 2: set Address to 0x70c
  [0x000000fb]  Advance Line by 65 to 66
  [0x000000fe]  Copy
  [0x000000ff]  Extended opcode 2: set Address to 0x714
  [0x0000010a]  Advance Line by 2 to 68
  [0x0000010c]  Copy
  [0x0000010d]  Extended opcode 2: set Address to 0x718
  [0x00000118]  Advance Line by 2 to 70
  [0x0000011a]  Copy
  [0x0000011b]  Extended opcode 2: set Address to 0x730
  [0x00000126]  Advance Line by 2 to 72
  [0x00000128]  Copy
  [0x00000129]  Extended opcode 2: set Address to 0x73c
  [0x00000134]  Advance Line by 1 to 73
  [0x00000136]  Copy
  [0x00000137]  Extended opcode 1: End of Sequence

  [0x0000013a]  Extended opcode 2: set Address to 0x704
  [0x00000145]  Advance Line by 61 to 62
  [0x00000147]  Copy
  [0x00000148]  Advance PC by 8 to 0x70c
  [0x0000014a]  Advance Line by 1 to 63
  [0x0000014c]  Copy
  [0x0000014d]  Extended opcode 1: End of Sequence

  [0x00000150]  Extended opcode 2: set Address to 0x6e4
  [0x0000015b]  Advance Line by 47 to 48
  [0x0000015d]  Copy
  [0x0000015e]  Advance PC by 8 to 0x6ec
  [0x00000160]  Advance Line by 1 to 49
  [0x00000162]  Copy
  [0x00000163]  Extended opcode 1: End of Sequence

  [0x00000166]  Extended opcode 2: set Address to 0x6ec
  [0x00000171]  Advance Line by 51 to 52
  [0x00000173]  Copy
  [0x00000174]  Extended opcode 2: set Address to 0x6f4
  [0x0000017f]  Advance Line by 2 to 54
  [0x00000181]  Copy
  [0x00000182]  Extended opcode 2: set Address to 0x6f8
  [0x0000018d]  Advance Line by 2 to 56
  [0x0000018f]  Copy
  [0x00000190]  Extended opcode 2: set Address to 0x704
  [0x0000019b]  Advance Line by 1 to 57
  [0x0000019d]  Copy
  [0x0000019e]  Extended opcode 1: End of Sequence



[-- Attachment #3: dw2-ranges-func-hi-cold.L --]
[-- Type: text/plain, Size: 1706 bytes --]

Contents of the .debug_line section:

dw2-ranges-func-lo-cold.c:
File name                            Line number    Starting address    View
dw2-ranges-func-lo-cold.c                     76               0x73c
dw2-ranges-func-lo-cold.c                     78               0x744
dw2-ranges-func-lo-cold.c                     80               0x748
dw2-ranges-func-lo-cold.c                     82               0x754
dw2-ranges-func-lo-cold.c                     82               0x754       1

dw2-ranges-func-lo-cold.c                     66               0x70c
dw2-ranges-func-lo-cold.c                     68               0x714
dw2-ranges-func-lo-cold.c                     70               0x718
dw2-ranges-func-lo-cold.c                     72               0x730
dw2-ranges-func-lo-cold.c                     73               0x73c
dw2-ranges-func-lo-cold.c                     73               0x73c       1

dw2-ranges-func-lo-cold.c                     62               0x704
dw2-ranges-func-lo-cold.c                     63               0x70c
dw2-ranges-func-lo-cold.c                     63               0x70c       1

dw2-ranges-func-lo-cold.c                     48               0x6e4
dw2-ranges-func-lo-cold.c                     49               0x6ec
dw2-ranges-func-lo-cold.c                     49               0x6ec       1

dw2-ranges-func-lo-cold.c                     52               0x6ec
dw2-ranges-func-lo-cold.c                     54               0x6f4
dw2-ranges-func-lo-cold.c                     56               0x6f8
dw2-ranges-func-lo-cold.c                     57               0x704
dw2-ranges-func-lo-cold.c                     57               0x704       1



[-- Attachment #4: dw2-ranges-func-lo-cold.l --]
[-- Type: text/plain, Size: 3077 bytes --]

Raw dump of debug contents of section .debug_line:

  Offset:                      0x0
  Length:                      413
  DWARF Version:               2
  Prologue Length:             170
  Minimum Instruction Length:  1
  Initial value of 'is_stmt':  1
  Line Base:                   1
  Line Range:                  1
  Opcode Base:                 10

 Opcodes:
  Opcode 1 has 0 args
  Opcode 2 has 1 arg
  Opcode 3 has 1 arg
  Opcode 4 has 1 arg
  Opcode 5 has 1 arg
  Opcode 6 has 0 args
  Opcode 7 has 0 args
  Opcode 8 has 0 args
  Opcode 9 has 1 arg

 The Directory Table (offset 0x18):
  1	/home/luis.machado/work/tcwg/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2

 The File Name Table (offset 0x96):
  Entry	Dir	Time	Size	Name
  1	1	0	0	dw2-ranges-func-lo-cold.c

 Line Number Statements:
  [0x000000b4]  Extended opcode 2: set Address to 0x73c
  [0x000000bf]  Advance Line by 75 to 76
  [0x000000c2]  Copy
  [0x000000c3]  Extended opcode 2: set Address to 0x744
  [0x000000ce]  Advance Line by 2 to 78
  [0x000000d0]  Copy
  [0x000000d1]  Extended opcode 2: set Address to 0x748
  [0x000000dc]  Advance Line by 2 to 80
  [0x000000de]  Copy
  [0x000000df]  Extended opcode 2: set Address to 0x754
  [0x000000ea]  Advance Line by 2 to 82
  [0x000000ec]  Copy
  [0x000000ed]  Extended opcode 1: End of Sequence

  [0x000000f0]  Extended opcode 2: set Address to 0x70c
  [0x000000fb]  Advance Line by 65 to 66
  [0x000000fe]  Copy
  [0x000000ff]  Extended opcode 2: set Address to 0x714
  [0x0000010a]  Advance Line by 2 to 68
  [0x0000010c]  Copy
  [0x0000010d]  Extended opcode 2: set Address to 0x718
  [0x00000118]  Advance Line by 2 to 70
  [0x0000011a]  Copy
  [0x0000011b]  Extended opcode 2: set Address to 0x730
  [0x00000126]  Advance Line by 2 to 72
  [0x00000128]  Copy
  [0x00000129]  Extended opcode 2: set Address to 0x73c
  [0x00000134]  Advance Line by 1 to 73
  [0x00000136]  Copy
  [0x00000137]  Extended opcode 1: End of Sequence

  [0x0000013a]  Extended opcode 2: set Address to 0x704
  [0x00000145]  Advance Line by 61 to 62
  [0x00000147]  Copy
  [0x00000148]  Advance PC by 8 to 0x70c
  [0x0000014a]  Advance Line by 1 to 63
  [0x0000014c]  Copy
  [0x0000014d]  Extended opcode 1: End of Sequence

  [0x00000150]  Extended opcode 2: set Address to 0x6e4
  [0x0000015b]  Advance Line by 47 to 48
  [0x0000015d]  Copy
  [0x0000015e]  Advance PC by 8 to 0x6ec
  [0x00000160]  Advance Line by 1 to 49
  [0x00000162]  Copy
  [0x00000163]  Extended opcode 1: End of Sequence

  [0x00000166]  Extended opcode 2: set Address to 0x6ec
  [0x00000171]  Advance Line by 51 to 52
  [0x00000173]  Copy
  [0x00000174]  Extended opcode 2: set Address to 0x6f4
  [0x0000017f]  Advance Line by 2 to 54
  [0x00000181]  Copy
  [0x00000182]  Extended opcode 2: set Address to 0x6f8
  [0x0000018d]  Advance Line by 2 to 56
  [0x0000018f]  Copy
  [0x00000190]  Extended opcode 2: set Address to 0x704
  [0x0000019b]  Advance Line by 1 to 57
  [0x0000019d]  Copy
  [0x0000019e]  Extended opcode 1: End of Sequence



[-- Attachment #5: dw2-ranges-func-lo-cold.L --]
[-- Type: text/plain, Size: 1706 bytes --]

Contents of the .debug_line section:

dw2-ranges-func-lo-cold.c:
File name                            Line number    Starting address    View
dw2-ranges-func-lo-cold.c                     76               0x73c
dw2-ranges-func-lo-cold.c                     78               0x744
dw2-ranges-func-lo-cold.c                     80               0x748
dw2-ranges-func-lo-cold.c                     82               0x754
dw2-ranges-func-lo-cold.c                     82               0x754       1

dw2-ranges-func-lo-cold.c                     66               0x70c
dw2-ranges-func-lo-cold.c                     68               0x714
dw2-ranges-func-lo-cold.c                     70               0x718
dw2-ranges-func-lo-cold.c                     72               0x730
dw2-ranges-func-lo-cold.c                     73               0x73c
dw2-ranges-func-lo-cold.c                     73               0x73c       1

dw2-ranges-func-lo-cold.c                     62               0x704
dw2-ranges-func-lo-cold.c                     63               0x70c
dw2-ranges-func-lo-cold.c                     63               0x70c       1

dw2-ranges-func-lo-cold.c                     48               0x6e4
dw2-ranges-func-lo-cold.c                     49               0x6ec
dw2-ranges-func-lo-cold.c                     49               0x6ec       1

dw2-ranges-func-lo-cold.c                     52               0x6ec
dw2-ranges-func-lo-cold.c                     54               0x6f4
dw2-ranges-func-lo-cold.c                     56               0x6f8
dw2-ranges-func-lo-cold.c                     57               0x704
dw2-ranges-func-lo-cold.c                     57               0x704       1



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #6: dw_bad.log --]
[-- Type: text/x-log; name="dw_bad.log", Size: 72741 bytes --]

Test run by user on Sat Apr  4 13:38:30 2020
Native configuration is aarch64-unknown-linux-gnu

		=== gdb tests ===

Schedule of variations:
    unix

Running target unix
Using /usr/share/dejagnu/baseboards/unix.exp as board description file for target.
Using /usr/share/dejagnu/config/unix.exp as generic interface file for target.
Using /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/config/unix.exp as tool-and-target-specific interface file.
Running /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func.exp ...
get_compiler_info: gcc-7-4-0
Executing on host: gcc  -fno-stack-protector  -fdiagnostics-color=never -c -g  -o /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-lo-cold0.o /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c    (timeout = 300)
spawn -ignore SIGHUP gcc -fno-stack-protector -fdiagnostics-color=never -c -g -o /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-lo-cold0.o /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c
Executing on host: gcc  -fno-stack-protector /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-lo-cold0.o  -fdiagnostics-color=never -g  -lm   -o /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-lo-cold    (timeout = 300)
spawn -ignore SIGHUP gcc -fno-stack-protector /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-lo-cold0.o -fdiagnostics-color=never -g -lm -o /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-lo-cold
spawn /home/user/build/binutils-gdb-master/gdb/testsuite/../../gdb/gdb -nw -nx -data-directory /home/user/build/binutils-gdb-master/gdb/testsuite/../data-directory
GNU gdb (GDB) 10.0.50.20200401-git
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "aarch64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) set height 0
(gdb) set width 0
(gdb) dir
Reinitialize source path to empty? (y or n) y
Source directories searched: $cdir:$cwd
(gdb) dir /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2
Source directories searched: /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2:$cdir:$cwd
(gdb) kill
The program is not being run.
(gdb) file /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-lo-cold
Reading symbols from /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-lo-cold...
(gdb) Executing on host: gcc  -fno-stack-protector  -fdiagnostics-color=never -w -c -g  -o /home/user/build/binutils-gdb-master/gdb/testsuite/temp/39835/is_64_target-39835.o /home/user/build/binutils-gdb-master/gdb/testsuite/temp/39835/is_64_target-39835.c    (timeout = 300)
spawn -ignore SIGHUP gcc -fno-stack-protector -fdiagnostics-color=never -w -c -g -o /home/user/build/binutils-gdb-master/gdb/testsuite/temp/39835/is_64_target-39835.o /home/user/build/binutils-gdb-master/gdb/testsuite/temp/39835/is_64_target-39835.c
print /d sizeof (int)
$1 = 4
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: get integer valueof "sizeof (int)"
Executing on host: gcc  -fno-stack-protector /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c  -fdiagnostics-color=never -g  -lm   -o /home/user/build/binutils-gdb-master/gdb/testsuite/temp/39835/func_addr39835.x    (timeout = 300)
spawn -ignore SIGHUP gcc -fno-stack-protector /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c -fdiagnostics-color=never -g -lm -o /home/user/build/binutils-gdb-master/gdb/testsuite/temp/39835/func_addr39835.x
spawn /home/user/build/binutils-gdb-master/gdb/testsuite/../../gdb/gdb -nw -nx -data-directory /home/user/build/binutils-gdb-master/gdb/testsuite/../data-directory
GNU gdb (GDB) 10.0.50.20200401-git
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "aarch64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) set height 0
(gdb) set width 0
(gdb) kill
The program is not being run.
(gdb) file /home/user/build/binutils-gdb-master/gdb/testsuite/temp/39835/func_addr39835.x
Reading symbols from /home/user/build/binutils-gdb-master/gdb/testsuite/temp/39835/func_addr39835.x...
(gdb) p main_label - main
$1 = 8
(gdb) disassemble main
Dump of assembler code for function main:
   0x000000000000073c <+0>:	stp	x29, x30, [sp, #-16]!
   0x0000000000000740 <+4>:	mov	x29, sp
   0x0000000000000744 <+8>:	bl	0x70c <foo>
   0x0000000000000748 <+12>:	mov	w0, #0x0                   	// #0
   0x000000000000074c <+16>:	ldp	x29, x30, [sp], #16
   0x0000000000000750 <+20>:	ret
End of assembler dump.
(gdb) x/2i main+20
   0x750 <main+20>:	ret
   0x754 <main_label2+12>:	.inst	0x00000000 ; undefined
(gdb) Executing on host: gcc  -fno-stack-protector /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c  -fdiagnostics-color=never -g  -lm   -o /home/user/build/binutils-gdb-master/gdb/testsuite/temp/39835/func_addr39835.x    (timeout = 300)
spawn -ignore SIGHUP gcc -fno-stack-protector /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c -fdiagnostics-color=never -g -lm -o /home/user/build/binutils-gdb-master/gdb/testsuite/temp/39835/func_addr39835.x
spawn /home/user/build/binutils-gdb-master/gdb/testsuite/../../gdb/gdb -nw -nx -data-directory /home/user/build/binutils-gdb-master/gdb/testsuite/../data-directory
GNU gdb (GDB) 10.0.50.20200401-git
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "aarch64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) set height 0
(gdb) set width 0
(gdb) kill
The program is not being run.
(gdb) file /home/user/build/binutils-gdb-master/gdb/testsuite/temp/39835/func_addr39835.x
Reading symbols from /home/user/build/binutils-gdb-master/gdb/testsuite/temp/39835/func_addr39835.x...
(gdb) p foo_label - foo
$1 = 8
(gdb) disassemble foo
Dump of assembler code for function foo:
   0x000000000000070c <+0>:	stp	x29, x30, [sp, #-16]!
   0x0000000000000710 <+4>:	mov	x29, sp
   0x0000000000000714 <+8>:	bl	0x704 <bar>
   0x0000000000000718 <+12>:	adrp	x0, 0x11000
   0x000000000000071c <+16>:	add	x0, x0, #0x14
   0x0000000000000720 <+20>:	ldr	w0, [x0]
   0x0000000000000724 <+24>:	cmp	w0, #0x0
   0x0000000000000728 <+28>:	b.eq	0x730 <foo+36>  // b.none
   0x000000000000072c <+32>:	bl	0x6ec <foo_cold>
   0x0000000000000730 <+36>:	nop
   0x0000000000000734 <+40>:	ldp	x29, x30, [sp], #16
   0x0000000000000738 <+44>:	ret
End of assembler dump.
(gdb) x/2i foo+44
   0x738 <foo+44>:	ret
   0x73c <main>:	stp	x29, x30, [sp, #-16]!
(gdb) Executing on host: gcc  -fno-stack-protector /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c  -fdiagnostics-color=never -g  -lm   -o /home/user/build/binutils-gdb-master/gdb/testsuite/temp/39835/func_addr39835.x    (timeout = 300)
spawn -ignore SIGHUP gcc -fno-stack-protector /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c -fdiagnostics-color=never -g -lm -o /home/user/build/binutils-gdb-master/gdb/testsuite/temp/39835/func_addr39835.x
spawn /home/user/build/binutils-gdb-master/gdb/testsuite/../../gdb/gdb -nw -nx -data-directory /home/user/build/binutils-gdb-master/gdb/testsuite/../data-directory
GNU gdb (GDB) 10.0.50.20200401-git
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "aarch64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) set height 0
(gdb) set width 0
(gdb) kill
The program is not being run.
(gdb) file /home/user/build/binutils-gdb-master/gdb/testsuite/temp/39835/func_addr39835.x
Reading symbols from /home/user/build/binutils-gdb-master/gdb/testsuite/temp/39835/func_addr39835.x...
(gdb) p foo_cold_label - foo_cold
$1 = 8
(gdb) disassemble foo_cold
Dump of assembler code for function foo_cold:
   0x00000000000006ec <+0>:	stp	x29, x30, [sp, #-16]!
   0x00000000000006f0 <+4>:	mov	x29, sp
   0x00000000000006f4 <+8>:	bl	0x6e4 <baz>
   0x00000000000006f8 <+12>:	nop
   0x00000000000006fc <+16>:	ldp	x29, x30, [sp], #16
   0x0000000000000700 <+20>:	ret
End of assembler dump.
(gdb) x/2i foo_cold+20
   0x700 <foo_cold+20>:	ret
   0x704 <bar>:	nop
(gdb) Executing on host: gcc  -fno-stack-protector /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c  -fdiagnostics-color=never -g  -lm   -o /home/user/build/binutils-gdb-master/gdb/testsuite/temp/39835/func_addr39835.x    (timeout = 300)
spawn -ignore SIGHUP gcc -fno-stack-protector /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c -fdiagnostics-color=never -g -lm -o /home/user/build/binutils-gdb-master/gdb/testsuite/temp/39835/func_addr39835.x
spawn /home/user/build/binutils-gdb-master/gdb/testsuite/../../gdb/gdb -nw -nx -data-directory /home/user/build/binutils-gdb-master/gdb/testsuite/../data-directory
GNU gdb (GDB) 10.0.50.20200401-git
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "aarch64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) set height 0
(gdb) set width 0
(gdb) kill
The program is not being run.
(gdb) file /home/user/build/binutils-gdb-master/gdb/testsuite/temp/39835/func_addr39835.x
Reading symbols from /home/user/build/binutils-gdb-master/gdb/testsuite/temp/39835/func_addr39835.x...
(gdb) p bar_label - bar
$1 = 0
(gdb) disassemble bar
Dump of assembler code for function bar:
   0x0000000000000704 <+0>:	nop
   0x0000000000000708 <+4>:	ret
End of assembler dump.
(gdb) x/2i bar+4
   0x708 <bar+4>:	ret
   0x70c <foo>:	stp	x29, x30, [sp, #-16]!
(gdb) Executing on host: gcc  -fno-stack-protector /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c  -fdiagnostics-color=never -g  -lm   -o /home/user/build/binutils-gdb-master/gdb/testsuite/temp/39835/func_addr39835.x    (timeout = 300)
spawn -ignore SIGHUP gcc -fno-stack-protector /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c -fdiagnostics-color=never -g -lm -o /home/user/build/binutils-gdb-master/gdb/testsuite/temp/39835/func_addr39835.x
spawn /home/user/build/binutils-gdb-master/gdb/testsuite/../../gdb/gdb -nw -nx -data-directory /home/user/build/binutils-gdb-master/gdb/testsuite/../data-directory
GNU gdb (GDB) 10.0.50.20200401-git
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "aarch64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) set height 0
(gdb) set width 0
(gdb) kill
The program is not being run.
(gdb) file /home/user/build/binutils-gdb-master/gdb/testsuite/temp/39835/func_addr39835.x
Reading symbols from /home/user/build/binutils-gdb-master/gdb/testsuite/temp/39835/func_addr39835.x...
(gdb) p baz_label - baz
$1 = 0
(gdb) disassemble baz
Dump of assembler code for function baz:
   0x00000000000006e4 <+0>:	nop
   0x00000000000006e8 <+4>:	ret
End of assembler dump.
(gdb) x/2i baz+4
   0x6e8 <baz+4>:	ret
   0x6ec <foo_cold>:	stp	x29, x30, [sp, #-16]!
(gdb) Executing on host: gcc  -fno-stack-protector /home/user/build/binutils-gdb-master/gdb/testsuite/temp/39835/target_symbol_prefix-39835.c  -fdiagnostics-color=never -w -g  -lm   -o /home/user/build/binutils-gdb-master/gdb/testsuite/temp/39835/target_symbol_prefix-39835.x    (timeout = 300)
spawn -ignore SIGHUP gcc -fno-stack-protector /home/user/build/binutils-gdb-master/gdb/testsuite/temp/39835/target_symbol_prefix-39835.c -fdiagnostics-color=never -w -g -lm -o /home/user/build/binutils-gdb-master/gdb/testsuite/temp/39835/target_symbol_prefix-39835.x
Executing on host: gcc  -fno-stack-protector  -fdiagnostics-color=never -c  -o /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-lo-cold0.o /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c    (timeout = 300)
spawn -ignore SIGHUP gcc -fno-stack-protector -fdiagnostics-color=never -c -o /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-lo-cold0.o /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c
Executing on host: gcc  -fno-stack-protector  -fdiagnostics-color=never -c  -o /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-lo-cold1.o /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-lo-cold-dw2.S    (timeout = 300)
spawn -ignore SIGHUP gcc -fno-stack-protector -fdiagnostics-color=never -c -o /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-lo-cold1.o /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-lo-cold-dw2.S
Executing on host: gcc  -fno-stack-protector /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-lo-cold0.o /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-lo-cold1.o  -fdiagnostics-color=never  -lm   -o /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-lo-cold    (timeout = 300)
spawn -ignore SIGHUP gcc -fno-stack-protector /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-lo-cold0.o /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-lo-cold1.o -fdiagnostics-color=never -lm -o /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-lo-cold
spawn /home/user/build/binutils-gdb-master/gdb/testsuite/../../gdb/gdb -nw -nx -data-directory /home/user/build/binutils-gdb-master/gdb/testsuite/../data-directory
GNU gdb (GDB) 10.0.50.20200401-git
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "aarch64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) set height 0
(gdb) set width 0
(gdb) dir
Reinitialize source path to empty? (y or n) y
Source directories searched: $cdir:$cwd
(gdb) dir /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2
Source directories searched: /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2:$cdir:$cwd
(gdb) kill
The program is not being run.
(gdb) file /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-lo-cold
Reading symbols from /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-lo-cold...
(gdb) delete breakpoints
(gdb) info breakpoints
No breakpoints or watchpoints.
(gdb) break main
Breakpoint 1 at 0x73c: file /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c, line 76.
(gdb) run 
Starting program: /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-lo-cold 

Breakpoint 1, main () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c:76
76	{						/* main prologue */
(gdb) info line main
Line 76 of "/home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c" starts at address 0xaaaaaaaaa73c <main> and ends at 0xaaaaaaaaa744 <main+8>.
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: info line main
break 68
Breakpoint 2 at 0xaaaaaaaaa714: file /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c, line 68.
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-1: break at call to bar
continue
Continuing.

Breakpoint 2, foo () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c:68
68	  bar ();					/* foo bar call */
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-1: continue to call of bar
step
bar () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c:62
62	}						/* bar end */
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-1: step into bar
step
foo () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c:70
70	  if (e) foo_cold ();				/* foo foo_cold call */
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-1: step out of bar, back into foo
spawn /home/user/build/binutils-gdb-master/gdb/testsuite/../../gdb/gdb -nw -nx -data-directory /home/user/build/binutils-gdb-master/gdb/testsuite/../data-directory
GNU gdb (GDB) 10.0.50.20200401-git
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "aarch64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) set height 0
(gdb) set width 0
(gdb) dir
Reinitialize source path to empty? (y or n) y
Source directories searched: $cdir:$cwd
(gdb) dir /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2
Source directories searched: /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2:$cdir:$cwd
(gdb) kill
The program is not being run.
(gdb) file /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-lo-cold
Reading symbols from /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-lo-cold...
(gdb) delete breakpoints
(gdb) info breakpoints
No breakpoints or watchpoints.
(gdb) break main
Breakpoint 1 at 0x73c: file /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c, line 76.
(gdb) run 
Starting program: /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-lo-cold 

Breakpoint 1, main () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c:76
76	{						/* main prologue */
(gdb) break foo
Breakpoint 2 at 0xaaaaaaaaa70c: file /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c, line 66.
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-2: break foo
continue
Continuing.

Breakpoint 2, foo () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c:66
66	{						/* foo prologue */
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-2: continue to foo
step
68	  bar ();					/* foo bar call */
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-2: step to call of bar after landing on prologue
step
bar () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c:62
62	}						/* bar end */
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-2: step into bar
step
foo () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c:70
70	  if (e) foo_cold ();				/* foo foo_cold call */
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-2: step out of bar, back into foo
spawn /home/user/build/binutils-gdb-master/gdb/testsuite/../../gdb/gdb -nw -nx -data-directory /home/user/build/binutils-gdb-master/gdb/testsuite/../data-directory
GNU gdb (GDB) 10.0.50.20200401-git
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "aarch64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) set height 0
(gdb) set width 0
(gdb) dir
Reinitialize source path to empty? (y or n) y
Source directories searched: $cdir:$cwd
(gdb) dir /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2
Source directories searched: /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2:$cdir:$cwd
(gdb) kill
The program is not being run.
(gdb) file /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-lo-cold
Reading symbols from /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-lo-cold...
(gdb) delete breakpoints
(gdb) info breakpoints
No breakpoints or watchpoints.
(gdb) break main
Breakpoint 1 at 0x73c: file /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c, line 76.
(gdb) run 
Starting program: /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-lo-cold 

Breakpoint 1, main () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c:76
76	{						/* main prologue */
(gdb) gdb_expect_list pattern: /Dump of assembler code for function foo:/
disassemble foo
Dump of assembler code for function foo:
Address range 0xaaaaaaaaa70c to 0xaaaaaaaaa73c:
   0x0000aaaaaaaaa70c <+0>:	stp	x29, x30, [sp, #-16]!
   0x0000aaaaaaaaa710 <+4>:	mov	x29, sp
   0x0000aaaaaaaaa714 <+8>:	bl	0xaaaaaaaaa704 <bar>
gdb_expect_list pattern: /Address range 0x[0-9A-Fa-f]+ to 0x[0-9A-Fa-f]+:/
gdb_expect_list pattern: /   0x[0-9A-Fa-f]+ <\+0>:/
gdb_expect_list pattern: /Address range 0x[0-9A-Fa-f]+ to 0x[0-9A-Fa-f]+:/
   0x0000aaaaaaaaa718 <+12>:	adrp	x0, 0xaaaaaaabb000
   0x0000aaaaaaaaa71c <+16>:	add	x0, x0, #0x14
   0x0000aaaaaaaaa720 <+20>:	ldr	w0, [x0]
   0x0000aaaaaaaaa724 <+24>:	cmp	w0, #0x0
   0x0000aaaaaaaaa728 <+28>:	b.eq	0xaaaaaaaaa730 <foo+36>  // b.none
   0x0000aaaaaaaaa72c <+32>:	bl	0xaaaaaaaaa6ec <foo_cold>
   0x0000aaaaaaaaa730 <+36>:	nop
   0x0000aaaaaaaaa734 <+40>:	ldp	x29, x30, [sp], #16
   0x0000aaaaaaaaa738 <+44>:	ret
Address range 0xaaaaaaaaa6ec to 0xaaaaaaaaa704:
   0x0000aaaaaaaaa6ec <-32>:	stp	x29, x30, [sp, #-16]!
   0x0000aaaaaaaaa6f0 <-28>:	mov	x29, sp
   0x0000aaaaaaaaa6f4 <-24>:	bl	0xaaaaaaaaa6e4 <baz>
   0x0000aaaaaaaaa6f8 <-20>:	nop
   0x0000aaaaaaaaa6fc <-16>:	ldp	x29, x30, [sp], #16
   0x0000aaaaaaaaa700 <-12>:	ret
End of assembler dump.
(gdb) gdb_expect_list pattern: /   0x[0-9A-Fa-f]+ <(.+?)>:/
gdb_expect_list pattern: /End of assembler dump\./
gdb_expect_list pattern: //
PASS: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: disassemble foo
x/i foo_cold
   0xaaaaaaaaa6ec <foo_cold>:	stp	x29, x30, [sp, #-16]!
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: x/i foo_cold
x/i foo
   0xaaaaaaaaa70c <foo>:	stp	x29, x30, [sp, #-16]!
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: x/i foo
PASS: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: foo and foo_cold are at different addresses
break foo
Breakpoint 2 at 0xaaaaaaaaa70c: file /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c, line 66.
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: break foo
break baz
Breakpoint 3 at 0xaaaaaaaaa6e4: file /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c, line 48.
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: break baz
continue
Continuing.

Breakpoint 2, foo () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c:66
66	{						/* foo prologue */
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: continue to foo
set variable e=1
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: set variable e=1
continue
Continuing.

Breakpoint 3, baz () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c:48
48	}						/* baz end */
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: continue to baz
gdb_expect_list pattern: /[
]#0 .*? baz \(\) /
bt
#0  baz () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c:48
gdb_expect_list pattern: /[
]#1 .*? foo \(\) /
#1  0x0000aaaaaaaaa6f8 in foo () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c:54
#2  0x0000aaaaaaaaa730 in foo () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c:70
gdb_expect_list pattern: /[
]#2 .*? foo \(\) /
gdb_expect_list pattern: /[
]#3 .*? main \(\) /
#3  0x0000aaaaaaaaa748 in main () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c:78
gdb_expect_list pattern: //
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: no-cold-names: backtrace from baz
x/2i foo_cold
   0xaaaaaaaaa6ec <foo_cold>:	stp	x29, x30, [sp, #-16]!
   0xaaaaaaaaa6f0 <foo-28>:	mov	x29, sp
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: no-cold-names: x/2i foo_cold
PASS: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: no-cold-names: offset to foo_cold is not too large
info line *foo_cold
Line 52 of "/home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c" starts at address 0xaaaaaaaaa6ec <foo_cold> and ends at 0xaaaaaaaaa6f4 <foo-24>.
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: no-cold-names: info line *foo_cold
spawn /home/user/build/binutils-gdb-master/gdb/testsuite/../../gdb/gdb -nw -nx -data-directory /home/user/build/binutils-gdb-master/gdb/testsuite/../data-directory
GNU gdb (GDB) 10.0.50.20200401-git
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "aarch64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) set height 0
(gdb) set width 0
(gdb) dir
Reinitialize source path to empty? (y or n) y
Source directories searched: $cdir:$cwd
(gdb) dir /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2
Source directories searched: /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2:$cdir:$cwd
(gdb) kill
The program is not being run.
(gdb) file /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-lo-cold
Reading symbols from /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-lo-cold...
(gdb) delete breakpoints
(gdb) info breakpoints
No breakpoints or watchpoints.
(gdb) break main
Breakpoint 1 at 0x73c: file /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c, line 76.
(gdb) run 
Starting program: /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-lo-cold 

Breakpoint 1, main () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c:76
76	{						/* main prologue */
(gdb) step
78	  foo ();					/* main foo call */
(gdb) FAIL: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-3: step into foo from main
step
foo () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c:66
66	{						/* foo prologue */
(gdb) FAIL: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-3: step into bar from foo
step
68	  bar ();					/* foo bar call */
(gdb) FAIL: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-3: step out of bar to foo
set variable e=1
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-3: set variable e=1
step
bar () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c:62
62	}						/* bar end */
(gdb) FAIL: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-3: step into foo_cold from foo
step
foo () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c:70
70	  if (e) foo_cold ();				/* foo foo_cold call */
(gdb) FAIL: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-3: step into baz from foo_cold
step
foo () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c:54
54	  baz ();					/* foo_cold baz call */
(gdb) FAIL: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-3: step out of baz to foo_cold
step
baz () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c:48
48	}						/* baz end */
(gdb) FAIL: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-3: step out of foo_cold to foo
step
foo () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c:56
56	}						/* foo_cold end */
(gdb) FAIL: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-3: step out of foo to main
Executing on host: gcc  -fno-stack-protector  -fdiagnostics-color=never -c -g  -o /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-hi-cold0.o /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c    (timeout = 300)
spawn -ignore SIGHUP gcc -fno-stack-protector -fdiagnostics-color=never -c -g -o /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-hi-cold0.o /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c
Executing on host: gcc  -fno-stack-protector /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-hi-cold0.o  -fdiagnostics-color=never -g  -lm   -o /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-hi-cold    (timeout = 300)
spawn -ignore SIGHUP gcc -fno-stack-protector /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-hi-cold0.o -fdiagnostics-color=never -g -lm -o /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-hi-cold
spawn /home/user/build/binutils-gdb-master/gdb/testsuite/../../gdb/gdb -nw -nx -data-directory /home/user/build/binutils-gdb-master/gdb/testsuite/../data-directory
GNU gdb (GDB) 10.0.50.20200401-git
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "aarch64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) set height 0
(gdb) set width 0
(gdb) dir
Reinitialize source path to empty? (y or n) y
Source directories searched: $cdir:$cwd
(gdb) dir /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2
Source directories searched: /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2:$cdir:$cwd
(gdb) kill
The program is not being run.
(gdb) file /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-hi-cold
Reading symbols from /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-hi-cold...
(gdb) print /d sizeof (int)
$1 = 4
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: get integer valueof "sizeof (int)"
Executing on host: gcc  -fno-stack-protector /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c  -fdiagnostics-color=never -g  -lm   -o /home/user/build/binutils-gdb-master/gdb/testsuite/temp/39835/func_addr39835.x    (timeout = 300)
spawn -ignore SIGHUP gcc -fno-stack-protector /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c -fdiagnostics-color=never -g -lm -o /home/user/build/binutils-gdb-master/gdb/testsuite/temp/39835/func_addr39835.x
spawn /home/user/build/binutils-gdb-master/gdb/testsuite/../../gdb/gdb -nw -nx -data-directory /home/user/build/binutils-gdb-master/gdb/testsuite/../data-directory
GNU gdb (GDB) 10.0.50.20200401-git
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "aarch64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) set height 0
(gdb) set width 0
(gdb) kill
The program is not being run.
(gdb) file /home/user/build/binutils-gdb-master/gdb/testsuite/temp/39835/func_addr39835.x
Reading symbols from /home/user/build/binutils-gdb-master/gdb/testsuite/temp/39835/func_addr39835.x...
(gdb) p main_label - main
$1 = 8
(gdb) disassemble main
Dump of assembler code for function main:
   0x000000000000073c <+0>:	stp	x29, x30, [sp, #-16]!
   0x0000000000000740 <+4>:	mov	x29, sp
   0x0000000000000744 <+8>:	bl	0x6e4 <foo>
   0x0000000000000748 <+12>:	mov	w0, #0x0                   	// #0
   0x000000000000074c <+16>:	ldp	x29, x30, [sp], #16
   0x0000000000000750 <+20>:	ret
End of assembler dump.
(gdb) x/2i main+20
   0x750 <main+20>:	ret
   0x754 <main_label2+12>:	.inst	0x00000000 ; undefined
(gdb) Executing on host: gcc  -fno-stack-protector /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c  -fdiagnostics-color=never -g  -lm   -o /home/user/build/binutils-gdb-master/gdb/testsuite/temp/39835/func_addr39835.x    (timeout = 300)
spawn -ignore SIGHUP gcc -fno-stack-protector /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c -fdiagnostics-color=never -g -lm -o /home/user/build/binutils-gdb-master/gdb/testsuite/temp/39835/func_addr39835.x
spawn /home/user/build/binutils-gdb-master/gdb/testsuite/../../gdb/gdb -nw -nx -data-directory /home/user/build/binutils-gdb-master/gdb/testsuite/../data-directory
GNU gdb (GDB) 10.0.50.20200401-git
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "aarch64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) set height 0
(gdb) set width 0
(gdb) kill
The program is not being run.
(gdb) file /home/user/build/binutils-gdb-master/gdb/testsuite/temp/39835/func_addr39835.x
Reading symbols from /home/user/build/binutils-gdb-master/gdb/testsuite/temp/39835/func_addr39835.x...
(gdb) p foo_label - foo
$1 = 8
(gdb) disassemble foo
Dump of assembler code for function foo:
   0x00000000000006e4 <+0>:	stp	x29, x30, [sp, #-16]!
   0x00000000000006e8 <+4>:	mov	x29, sp
   0x00000000000006ec <+8>:	bl	0x714 <bar>
   0x00000000000006f0 <+12>:	adrp	x0, 0x11000
   0x00000000000006f4 <+16>:	add	x0, x0, #0x14
   0x00000000000006f8 <+20>:	ldr	w0, [x0]
   0x00000000000006fc <+24>:	cmp	w0, #0x0
   0x0000000000000700 <+28>:	b.eq	0x708 <foo+36>  // b.none
   0x0000000000000704 <+32>:	bl	0x71c <foo_cold>
   0x0000000000000708 <+36>:	nop
   0x000000000000070c <+40>:	ldp	x29, x30, [sp], #16
   0x0000000000000710 <+44>:	ret
End of assembler dump.
(gdb) x/2i foo+44
   0x710 <foo+44>:	ret
   0x714 <bar>:	nop
(gdb) Executing on host: gcc  -fno-stack-protector /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c  -fdiagnostics-color=never -g  -lm   -o /home/user/build/binutils-gdb-master/gdb/testsuite/temp/39835/func_addr39835.x    (timeout = 300)
spawn -ignore SIGHUP gcc -fno-stack-protector /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c -fdiagnostics-color=never -g -lm -o /home/user/build/binutils-gdb-master/gdb/testsuite/temp/39835/func_addr39835.x
spawn /home/user/build/binutils-gdb-master/gdb/testsuite/../../gdb/gdb -nw -nx -data-directory /home/user/build/binutils-gdb-master/gdb/testsuite/../data-directory
GNU gdb (GDB) 10.0.50.20200401-git
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "aarch64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) set height 0
(gdb) set width 0
(gdb) kill
The program is not being run.
(gdb) file /home/user/build/binutils-gdb-master/gdb/testsuite/temp/39835/func_addr39835.x
Reading symbols from /home/user/build/binutils-gdb-master/gdb/testsuite/temp/39835/func_addr39835.x...
(gdb) p foo_cold_label - foo_cold
$1 = 8
(gdb) disassemble foo_cold
Dump of assembler code for function foo_cold:
   0x000000000000071c <+0>:	stp	x29, x30, [sp, #-16]!
   0x0000000000000720 <+4>:	mov	x29, sp
   0x0000000000000724 <+8>:	bl	0x734 <baz>
   0x0000000000000728 <+12>:	nop
   0x000000000000072c <+16>:	ldp	x29, x30, [sp], #16
   0x0000000000000730 <+20>:	ret
End of assembler dump.
(gdb) x/2i foo_cold+20
   0x730 <foo_cold+20>:	ret
   0x734 <baz>:	nop
(gdb) Executing on host: gcc  -fno-stack-protector /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c  -fdiagnostics-color=never -g  -lm   -o /home/user/build/binutils-gdb-master/gdb/testsuite/temp/39835/func_addr39835.x    (timeout = 300)
spawn -ignore SIGHUP gcc -fno-stack-protector /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c -fdiagnostics-color=never -g -lm -o /home/user/build/binutils-gdb-master/gdb/testsuite/temp/39835/func_addr39835.x
spawn /home/user/build/binutils-gdb-master/gdb/testsuite/../../gdb/gdb -nw -nx -data-directory /home/user/build/binutils-gdb-master/gdb/testsuite/../data-directory
GNU gdb (GDB) 10.0.50.20200401-git
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "aarch64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) set height 0
(gdb) set width 0
(gdb) kill
The program is not being run.
(gdb) file /home/user/build/binutils-gdb-master/gdb/testsuite/temp/39835/func_addr39835.x
Reading symbols from /home/user/build/binutils-gdb-master/gdb/testsuite/temp/39835/func_addr39835.x...
(gdb) p bar_label - bar
$1 = 0
(gdb) disassemble bar
Dump of assembler code for function bar:
   0x0000000000000714 <+0>:	nop
   0x0000000000000718 <+4>:	ret
End of assembler dump.
(gdb) x/2i bar+4
   0x718 <bar+4>:	ret
   0x71c <foo_cold>:	stp	x29, x30, [sp, #-16]!
(gdb) Executing on host: gcc  -fno-stack-protector /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c  -fdiagnostics-color=never -g  -lm   -o /home/user/build/binutils-gdb-master/gdb/testsuite/temp/39835/func_addr39835.x    (timeout = 300)
spawn -ignore SIGHUP gcc -fno-stack-protector /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c -fdiagnostics-color=never -g -lm -o /home/user/build/binutils-gdb-master/gdb/testsuite/temp/39835/func_addr39835.x
spawn /home/user/build/binutils-gdb-master/gdb/testsuite/../../gdb/gdb -nw -nx -data-directory /home/user/build/binutils-gdb-master/gdb/testsuite/../data-directory
GNU gdb (GDB) 10.0.50.20200401-git
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "aarch64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) set height 0
(gdb) set width 0
(gdb) kill
The program is not being run.
(gdb) file /home/user/build/binutils-gdb-master/gdb/testsuite/temp/39835/func_addr39835.x
Reading symbols from /home/user/build/binutils-gdb-master/gdb/testsuite/temp/39835/func_addr39835.x...
(gdb) p baz_label - baz
$1 = 0
(gdb) disassemble baz
Dump of assembler code for function baz:
   0x0000000000000734 <+0>:	nop
   0x0000000000000738 <+4>:	ret
End of assembler dump.
(gdb) x/2i baz+4
   0x738 <baz+4>:	ret
   0x73c <main>:	stp	x29, x30, [sp, #-16]!
(gdb) Executing on host: gcc  -fno-stack-protector  -fdiagnostics-color=never -c  -o /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-hi-cold0.o /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c    (timeout = 300)
spawn -ignore SIGHUP gcc -fno-stack-protector -fdiagnostics-color=never -c -o /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-hi-cold0.o /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c
Executing on host: gcc  -fno-stack-protector  -fdiagnostics-color=never -c  -o /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-hi-cold1.o /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-hi-cold-dw2.S    (timeout = 300)
spawn -ignore SIGHUP gcc -fno-stack-protector -fdiagnostics-color=never -c -o /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-hi-cold1.o /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-hi-cold-dw2.S
Executing on host: gcc  -fno-stack-protector /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-hi-cold0.o /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-hi-cold1.o  -fdiagnostics-color=never  -lm   -o /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-hi-cold    (timeout = 300)
spawn -ignore SIGHUP gcc -fno-stack-protector /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-hi-cold0.o /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-hi-cold1.o -fdiagnostics-color=never -lm -o /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-hi-cold
spawn /home/user/build/binutils-gdb-master/gdb/testsuite/../../gdb/gdb -nw -nx -data-directory /home/user/build/binutils-gdb-master/gdb/testsuite/../data-directory
GNU gdb (GDB) 10.0.50.20200401-git
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "aarch64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) set height 0
(gdb) set width 0
(gdb) dir
Reinitialize source path to empty? (y or n) y
Source directories searched: $cdir:$cwd
(gdb) dir /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2
Source directories searched: /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2:$cdir:$cwd
(gdb) kill
The program is not being run.
(gdb) file /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-hi-cold
Reading symbols from /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-hi-cold...
(gdb) delete breakpoints
(gdb) info breakpoints
No breakpoints or watchpoints.
(gdb) break main
Breakpoint 1 at 0x73c: file /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c, line 76.
(gdb) run 
Starting program: /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-hi-cold 

Breakpoint 1, main () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c:76
76	{						/* main prologue */
(gdb) info line main
Line 76 of "/home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c" starts at address 0xaaaaaaaaa73c <main> and ends at 0xaaaaaaaaa744 <main+8>.
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: info line main
break 48
Breakpoint 2 at 0xaaaaaaaaa6ec: file /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c, line 48.
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-1: break at call to bar
continue
Continuing.

Breakpoint 2, foo () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c:48
48	  bar ();					/* foo bar call */
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-1: continue to call of bar
step
bar () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c:58
58	}						/* bar end */
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-1: step into bar
step
foo () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c:50
50	  if (e) foo_cold ();				/* foo foo_cold call */
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-1: step out of bar, back into foo
spawn /home/user/build/binutils-gdb-master/gdb/testsuite/../../gdb/gdb -nw -nx -data-directory /home/user/build/binutils-gdb-master/gdb/testsuite/../data-directory
GNU gdb (GDB) 10.0.50.20200401-git
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "aarch64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) set height 0
(gdb) set width 0
(gdb) dir
Reinitialize source path to empty? (y or n) y
Source directories searched: $cdir:$cwd
(gdb) dir /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2
Source directories searched: /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2:$cdir:$cwd
(gdb) kill
The program is not being run.
(gdb) file /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-hi-cold
Reading symbols from /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-hi-cold...
(gdb) delete breakpoints
(gdb) info breakpoints
No breakpoints or watchpoints.
(gdb) break main
Breakpoint 1 at 0x73c: file /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c, line 76.
(gdb) run 
Starting program: /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-hi-cold 

Breakpoint 1, main () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c:76
76	{						/* main prologue */
(gdb) break foo
Breakpoint 2 at 0xaaaaaaaaa6ec: file /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c, line 48.
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-2: break foo
continue
Continuing.

Breakpoint 2, foo () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c:48
48	  bar ();					/* foo bar call */
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-2: continue to foo
step
bar () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c:58
58	}						/* bar end */
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-2: step into bar
step
foo () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c:50
50	  if (e) foo_cold ();				/* foo foo_cold call */
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-2: step out of bar, back into foo
spawn /home/user/build/binutils-gdb-master/gdb/testsuite/../../gdb/gdb -nw -nx -data-directory /home/user/build/binutils-gdb-master/gdb/testsuite/../data-directory
GNU gdb (GDB) 10.0.50.20200401-git
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "aarch64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) set height 0
(gdb) set width 0
(gdb) dir
Reinitialize source path to empty? (y or n) y
Source directories searched: $cdir:$cwd
(gdb) dir /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2
Source directories searched: /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2:$cdir:$cwd
(gdb) kill
The program is not being run.
(gdb) file /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-hi-cold
Reading symbols from /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-hi-cold...
(gdb) delete breakpoints
(gdb) info breakpoints
No breakpoints or watchpoints.
(gdb) break main
Breakpoint 1 at 0x73c: file /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c, line 76.
(gdb) run 
Starting program: /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-hi-cold 

Breakpoint 1, main () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c:76
76	{						/* main prologue */
(gdb) gdb_expect_list pattern: /Dump of assembler code for function foo:/
disassemble foo
Dump of assembler code for function foo:
Address range 0xaaaaaaaaa6e4 to 0xaaaaaaaaa714:
gdb_expect_list pattern: /Address range 0x[0-9A-Fa-f]+ to 0x[0-9A-Fa-f]+:/
gdb_expect_list pattern: /   0x[0-9A-Fa-f]+ <\+0>:/
   0x0000aaaaaaaaa6e4 <+0>:	stp	x29, x30, [sp, #-16]!
   0x0000aaaaaaaaa6e8 <+4>:	mov	x29, sp
   0x0000aaaaaaaaa6ec <+8>:	bl	0xaaaaaaaaa714 <bar>
   0x0000aaaaaaaaa6f0 <+12>:	adrp	x0, 0xaaaaaaabb000
   0x0000aaaaaaaaa6f4 <+16>:	add	x0, x0, #0x14
   0x0000aaaaaaaaa6f8 <+20>:	ldr	w0, [x0]
   0x0000aaaaaaaaa6fc <+24>:	cmp	w0, #0x0
   0x0000aaaaaaaaa700 <+28>:	b.eq	0xaaaaaaaaa708 <foo+36>  // b.none
   0x0000aaaaaaaaa704 <+32>:	bl	0xaaaaaaaaa71c <foo_cold>
   0x0000aaaaaaaaa708 <+36>:	nop
   0x0000aaaaaaaaa70c <+40>:	ldp	x29, x30, [sp], #16
   0x0000aaaaaaaaa710 <+44>:	ret
Address range 0xaaaaaaaaa71c to 0xaaaaaaaaa734:
gdb_expect_list pattern: /Address range 0x[0-9A-Fa-f]+ to 0x[0-9A-Fa-f]+:/
gdb_expect_list pattern: /   0x[0-9A-Fa-f]+ <(.+?)>:/
   0x0000aaaaaaaaa71c <+56>:	stp	x29, x30, [sp, #-16]!
   0x0000aaaaaaaaa720 <+60>:	mov	x29, sp
   0x0000aaaaaaaaa724 <+64>:	bl	0xaaaaaaaaa734 <baz>
   0x0000aaaaaaaaa728 <+68>:	nop
   0x0000aaaaaaaaa72c <+72>:	ldp	x29, x30, [sp], #16
   0x0000aaaaaaaaa730 <+76>:	ret
End of assembler dump.
(gdb) gdb_expect_list pattern: /End of assembler dump\./
gdb_expect_list pattern: //
PASS: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: disassemble foo
x/i foo_cold
   0xaaaaaaaaa71c <foo_cold>:	stp	x29, x30, [sp, #-16]!
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: x/i foo_cold
x/i foo
   0xaaaaaaaaa6e4 <foo>:	stp	x29, x30, [sp, #-16]!
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: x/i foo
PASS: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: foo and foo_cold are at different addresses
break foo
Breakpoint 2 at 0xaaaaaaaaa6ec: file /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c, line 48.
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: break foo
break baz
Breakpoint 3 at 0xaaaaaaaaa734: file /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c, line 72.
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: break baz
continue
Continuing.

Breakpoint 2, foo () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c:48
48	  bar ();					/* foo bar call */
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: continue to foo
set variable e=1
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: set variable e=1
continue
Continuing.

Breakpoint 3, baz () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c:72
72	}						/* baz end */
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: continue to baz
gdb_expect_list pattern: /[
]#0 .*? baz \(\) /
bt
#0  baz () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c:72
gdb_expect_list pattern: /[
]#1 .*? foo \(\) /
#1  0x0000aaaaaaaaa728 in foo () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c:64
#2  0x0000aaaaaaaaa708 in foo () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c:50
gdb_expect_list pattern: /[
]#2 .*? foo \(\) /
gdb_expect_list pattern: /[
]#3 .*? main \(\) /
#3  0x0000aaaaaaaaa748 in main () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c:78
gdb_expect_list pattern: //
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: no-cold-names: backtrace from baz
x/2i foo_cold
   0xaaaaaaaaa71c <foo_cold>:	stp	x29, x30, [sp, #-16]!
   0xaaaaaaaaa720 <foo+60>:	mov	x29, sp
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: no-cold-names: x/2i foo_cold
PASS: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: no-cold-names: offset to foo_cold is not too large
info line *foo_cold
Line 62 of "/home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c" starts at address 0xaaaaaaaaa71c <foo_cold> and ends at 0xaaaaaaaaa724 <foo+64>.
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: no-cold-names: info line *foo_cold
spawn /home/user/build/binutils-gdb-master/gdb/testsuite/../../gdb/gdb -nw -nx -data-directory /home/user/build/binutils-gdb-master/gdb/testsuite/../data-directory
GNU gdb (GDB) 10.0.50.20200401-git
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "aarch64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) set height 0
(gdb) set width 0
(gdb) dir
Reinitialize source path to empty? (y or n) y
Source directories searched: $cdir:$cwd
(gdb) dir /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2
Source directories searched: /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2:$cdir:$cwd
(gdb) kill
The program is not being run.
(gdb) file /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-hi-cold
Reading symbols from /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-hi-cold...
(gdb) delete breakpoints
(gdb) info breakpoints
No breakpoints or watchpoints.
(gdb) break main
Breakpoint 1 at 0x73c: file /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c, line 76.
(gdb) run 
Starting program: /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-hi-cold 

Breakpoint 1, main () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c:76
76	{						/* main prologue */
(gdb) step
78	  foo ();					/* main foo call */
(gdb) FAIL: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-3: step into foo from main
step
foo () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c:48
48	  bar ();					/* foo bar call */
(gdb) FAIL: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-3: step into bar from foo
step
bar () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c:58
58	}						/* bar end */
(gdb) FAIL: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-3: step out of bar to foo
set variable e=1
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-3: set variable e=1
step
foo () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c:50
50	  if (e) foo_cold ();				/* foo foo_cold call */
(gdb) FAIL: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-3: step into foo_cold from foo
step
foo () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c:64
64	  baz ();					/* foo_cold baz call */
(gdb) FAIL: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-3: step into baz from foo_cold
step
baz () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c:72
72	}						/* baz end */
(gdb) FAIL: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-3: step out of baz to foo_cold
step
foo () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c:66
66	}						/* foo_cold end */
(gdb) FAIL: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-3: step out of foo_cold to foo
step
foo () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c:52
52	}						/* foo end */
(gdb) FAIL: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-3: step out of foo to main
testcase /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func.exp completed in 3 seconds

		=== gdb Summary ===

# of expected passes		49
# of unexpected failures	16
Executing on host: /home/user/build/binutils-gdb-master/gdb/testsuite/../../gdb/gdb -nw -nx -data-directory /home/user/build/binutils-gdb-master/gdb/testsuite/../data-directory --version    (timeout = 300)
spawn -ignore SIGHUP /home/user/build/binutils-gdb-master/gdb/testsuite/../../gdb/gdb -nw -nx -data-directory /home/user/build/binutils-gdb-master/gdb/testsuite/../data-directory --version
GNU gdb (GDB) 10.0.50.20200401-git
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
/home/user/build/binutils-gdb-master/gdb/gdb version  10.0.50.20200401-git -nw -nx -data-directory /home/user/build/binutils-gdb-master/gdb/testsuite/../data-directory 

runtest completed at Sat Apr  4 13:38:33 2020

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #7: dw_good.log --]
[-- Type: text/x-log; name="dw_good.log", Size: 73066 bytes --]

Test run by user on Sat Apr  4 13:41:33 2020
Native configuration is aarch64-unknown-linux-gnu

		=== gdb tests ===

Schedule of variations:
    unix

Running target unix
Using /usr/share/dejagnu/baseboards/unix.exp as board description file for target.
Using /usr/share/dejagnu/config/unix.exp as generic interface file for target.
Using /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/config/unix.exp as tool-and-target-specific interface file.
Running /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func.exp ...
get_compiler_info: gcc-7-4-0
Executing on host: gcc  -fno-stack-protector  -fdiagnostics-color=never -c -g  -o /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-lo-cold0.o /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c    (timeout = 300)
spawn -ignore SIGHUP gcc -fno-stack-protector -fdiagnostics-color=never -c -g -o /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-lo-cold0.o /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c
Executing on host: gcc  -fno-stack-protector /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-lo-cold0.o  -fdiagnostics-color=never -g  -lm   -o /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-lo-cold    (timeout = 300)
spawn -ignore SIGHUP gcc -fno-stack-protector /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-lo-cold0.o -fdiagnostics-color=never -g -lm -o /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-lo-cold
spawn /home/user/build/binutils-gdb-master/gdb/testsuite/../../gdb/gdb -nw -nx -data-directory /home/user/build/binutils-gdb-master/gdb/testsuite/../data-directory
GNU gdb (GDB) 10.0.50.20200319-git
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "aarch64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) set height 0
(gdb) set width 0
(gdb) dir
Reinitialize source path to empty? (y or n) y
Source directories searched: $cdir:$cwd
(gdb) dir /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2
Source directories searched: /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2:$cdir:$cwd
(gdb) kill
The program is not being run.
(gdb) file /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-lo-cold
Reading symbols from /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-lo-cold...
(gdb) Executing on host: gcc  -fno-stack-protector  -fdiagnostics-color=never -w -c -g  -o /home/user/build/binutils-gdb-master/gdb/testsuite/temp/54423/is_64_target-54423.o /home/user/build/binutils-gdb-master/gdb/testsuite/temp/54423/is_64_target-54423.c    (timeout = 300)
spawn -ignore SIGHUP gcc -fno-stack-protector -fdiagnostics-color=never -w -c -g -o /home/user/build/binutils-gdb-master/gdb/testsuite/temp/54423/is_64_target-54423.o /home/user/build/binutils-gdb-master/gdb/testsuite/temp/54423/is_64_target-54423.c
print /d sizeof (int)
$1 = 4
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: get integer valueof "sizeof (int)"
Executing on host: gcc  -fno-stack-protector /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c  -fdiagnostics-color=never -g  -lm   -o /home/user/build/binutils-gdb-master/gdb/testsuite/temp/54423/func_addr54423.x    (timeout = 300)
spawn -ignore SIGHUP gcc -fno-stack-protector /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c -fdiagnostics-color=never -g -lm -o /home/user/build/binutils-gdb-master/gdb/testsuite/temp/54423/func_addr54423.x
spawn /home/user/build/binutils-gdb-master/gdb/testsuite/../../gdb/gdb -nw -nx -data-directory /home/user/build/binutils-gdb-master/gdb/testsuite/../data-directory
GNU gdb (GDB) 10.0.50.20200319-git
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "aarch64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) set height 0
(gdb) set width 0
(gdb) kill
The program is not being run.
(gdb) file /home/user/build/binutils-gdb-master/gdb/testsuite/temp/54423/func_addr54423.x
Reading symbols from /home/user/build/binutils-gdb-master/gdb/testsuite/temp/54423/func_addr54423.x...
(gdb) p main_label - main
$1 = 8
(gdb) disassemble main
Dump of assembler code for function main:
   0x000000000000073c <+0>:	stp	x29, x30, [sp, #-16]!
   0x0000000000000740 <+4>:	mov	x29, sp
   0x0000000000000744 <+8>:	bl	0x70c <foo>
   0x0000000000000748 <+12>:	mov	w0, #0x0                   	// #0
   0x000000000000074c <+16>:	ldp	x29, x30, [sp], #16
   0x0000000000000750 <+20>:	ret
End of assembler dump.
(gdb) x/2i main+20
   0x750 <main+20>:	ret
   0x754 <main_label2+12>:	.inst	0x00000000 ; undefined
(gdb) Executing on host: gcc  -fno-stack-protector /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c  -fdiagnostics-color=never -g  -lm   -o /home/user/build/binutils-gdb-master/gdb/testsuite/temp/54423/func_addr54423.x    (timeout = 300)
spawn -ignore SIGHUP gcc -fno-stack-protector /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c -fdiagnostics-color=never -g -lm -o /home/user/build/binutils-gdb-master/gdb/testsuite/temp/54423/func_addr54423.x
spawn /home/user/build/binutils-gdb-master/gdb/testsuite/../../gdb/gdb -nw -nx -data-directory /home/user/build/binutils-gdb-master/gdb/testsuite/../data-directory
GNU gdb (GDB) 10.0.50.20200319-git
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "aarch64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) set height 0
(gdb) set width 0
(gdb) kill
The program is not being run.
(gdb) file /home/user/build/binutils-gdb-master/gdb/testsuite/temp/54423/func_addr54423.x
Reading symbols from /home/user/build/binutils-gdb-master/gdb/testsuite/temp/54423/func_addr54423.x...
(gdb) p foo_label - foo
$1 = 8
(gdb) disassemble foo
Dump of assembler code for function foo:
   0x000000000000070c <+0>:	stp	x29, x30, [sp, #-16]!
   0x0000000000000710 <+4>:	mov	x29, sp
   0x0000000000000714 <+8>:	bl	0x704 <bar>
   0x0000000000000718 <+12>:	adrp	x0, 0x11000
   0x000000000000071c <+16>:	add	x0, x0, #0x14
   0x0000000000000720 <+20>:	ldr	w0, [x0]
   0x0000000000000724 <+24>:	cmp	w0, #0x0
   0x0000000000000728 <+28>:	b.eq	0x730 <foo+36>  // b.none
   0x000000000000072c <+32>:	bl	0x6ec <foo_cold>
   0x0000000000000730 <+36>:	nop
   0x0000000000000734 <+40>:	ldp	x29, x30, [sp], #16
   0x0000000000000738 <+44>:	ret
End of assembler dump.
(gdb) x/2i foo+44
   0x738 <foo+44>:	ret
   0x73c <main>:	stp	x29, x30, [sp, #-16]!
(gdb) Executing on host: gcc  -fno-stack-protector /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c  -fdiagnostics-color=never -g  -lm   -o /home/user/build/binutils-gdb-master/gdb/testsuite/temp/54423/func_addr54423.x    (timeout = 300)
spawn -ignore SIGHUP gcc -fno-stack-protector /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c -fdiagnostics-color=never -g -lm -o /home/user/build/binutils-gdb-master/gdb/testsuite/temp/54423/func_addr54423.x
spawn /home/user/build/binutils-gdb-master/gdb/testsuite/../../gdb/gdb -nw -nx -data-directory /home/user/build/binutils-gdb-master/gdb/testsuite/../data-directory
GNU gdb (GDB) 10.0.50.20200319-git
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "aarch64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) set height 0
(gdb) set width 0
(gdb) kill
The program is not being run.
(gdb) file /home/user/build/binutils-gdb-master/gdb/testsuite/temp/54423/func_addr54423.x
Reading symbols from /home/user/build/binutils-gdb-master/gdb/testsuite/temp/54423/func_addr54423.x...
(gdb) p foo_cold_label - foo_cold
$1 = 8
(gdb) disassemble foo_cold
Dump of assembler code for function foo_cold:
   0x00000000000006ec <+0>:	stp	x29, x30, [sp, #-16]!
   0x00000000000006f0 <+4>:	mov	x29, sp
   0x00000000000006f4 <+8>:	bl	0x6e4 <baz>
   0x00000000000006f8 <+12>:	nop
   0x00000000000006fc <+16>:	ldp	x29, x30, [sp], #16
   0x0000000000000700 <+20>:	ret
End of assembler dump.
(gdb) x/2i foo_cold+20
   0x700 <foo_cold+20>:	ret
   0x704 <bar>:	nop
(gdb) Executing on host: gcc  -fno-stack-protector /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c  -fdiagnostics-color=never -g  -lm   -o /home/user/build/binutils-gdb-master/gdb/testsuite/temp/54423/func_addr54423.x    (timeout = 300)
spawn -ignore SIGHUP gcc -fno-stack-protector /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c -fdiagnostics-color=never -g -lm -o /home/user/build/binutils-gdb-master/gdb/testsuite/temp/54423/func_addr54423.x
spawn /home/user/build/binutils-gdb-master/gdb/testsuite/../../gdb/gdb -nw -nx -data-directory /home/user/build/binutils-gdb-master/gdb/testsuite/../data-directory
GNU gdb (GDB) 10.0.50.20200319-git
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "aarch64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) set height 0
(gdb) set width 0
(gdb) kill
The program is not being run.
(gdb) file /home/user/build/binutils-gdb-master/gdb/testsuite/temp/54423/func_addr54423.x
Reading symbols from /home/user/build/binutils-gdb-master/gdb/testsuite/temp/54423/func_addr54423.x...
(gdb) p bar_label - bar
$1 = 0
(gdb) disassemble bar
Dump of assembler code for function bar:
   0x0000000000000704 <+0>:	nop
   0x0000000000000708 <+4>:	ret
End of assembler dump.
(gdb) x/2i bar+4
   0x708 <bar+4>:	ret
   0x70c <foo>:	stp	x29, x30, [sp, #-16]!
(gdb) Executing on host: gcc  -fno-stack-protector /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c  -fdiagnostics-color=never -g  -lm   -o /home/user/build/binutils-gdb-master/gdb/testsuite/temp/54423/func_addr54423.x    (timeout = 300)
spawn -ignore SIGHUP gcc -fno-stack-protector /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c -fdiagnostics-color=never -g -lm -o /home/user/build/binutils-gdb-master/gdb/testsuite/temp/54423/func_addr54423.x
spawn /home/user/build/binutils-gdb-master/gdb/testsuite/../../gdb/gdb -nw -nx -data-directory /home/user/build/binutils-gdb-master/gdb/testsuite/../data-directory
GNU gdb (GDB) 10.0.50.20200319-git
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "aarch64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) set height 0
(gdb) set width 0
(gdb) kill
The program is not being run.
(gdb) file /home/user/build/binutils-gdb-master/gdb/testsuite/temp/54423/func_addr54423.x
Reading symbols from /home/user/build/binutils-gdb-master/gdb/testsuite/temp/54423/func_addr54423.x...
(gdb) p baz_label - baz
$1 = 0
(gdb) disassemble baz
Dump of assembler code for function baz:
   0x00000000000006e4 <+0>:	nop
   0x00000000000006e8 <+4>:	ret
End of assembler dump.
(gdb) x/2i baz+4
   0x6e8 <baz+4>:	ret
   0x6ec <foo_cold>:	stp	x29, x30, [sp, #-16]!
(gdb) Executing on host: gcc  -fno-stack-protector /home/user/build/binutils-gdb-master/gdb/testsuite/temp/54423/target_symbol_prefix-54423.c  -fdiagnostics-color=never -w -g  -lm   -o /home/user/build/binutils-gdb-master/gdb/testsuite/temp/54423/target_symbol_prefix-54423.x    (timeout = 300)
spawn -ignore SIGHUP gcc -fno-stack-protector /home/user/build/binutils-gdb-master/gdb/testsuite/temp/54423/target_symbol_prefix-54423.c -fdiagnostics-color=never -w -g -lm -o /home/user/build/binutils-gdb-master/gdb/testsuite/temp/54423/target_symbol_prefix-54423.x
Executing on host: gcc  -fno-stack-protector  -fdiagnostics-color=never -c  -o /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-lo-cold0.o /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c    (timeout = 300)
spawn -ignore SIGHUP gcc -fno-stack-protector -fdiagnostics-color=never -c -o /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-lo-cold0.o /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c
Executing on host: gcc  -fno-stack-protector  -fdiagnostics-color=never -c  -o /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-lo-cold1.o /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-lo-cold-dw2.S    (timeout = 300)
spawn -ignore SIGHUP gcc -fno-stack-protector -fdiagnostics-color=never -c -o /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-lo-cold1.o /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-lo-cold-dw2.S
Executing on host: gcc  -fno-stack-protector /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-lo-cold0.o /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-lo-cold1.o  -fdiagnostics-color=never  -lm   -o /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-lo-cold    (timeout = 300)
spawn -ignore SIGHUP gcc -fno-stack-protector /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-lo-cold0.o /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-lo-cold1.o -fdiagnostics-color=never -lm -o /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-lo-cold
spawn /home/user/build/binutils-gdb-master/gdb/testsuite/../../gdb/gdb -nw -nx -data-directory /home/user/build/binutils-gdb-master/gdb/testsuite/../data-directory
GNU gdb (GDB) 10.0.50.20200319-git
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "aarch64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) set height 0
(gdb) set width 0
(gdb) dir
Reinitialize source path to empty? (y or n) y
Source directories searched: $cdir:$cwd
(gdb) dir /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2
Source directories searched: /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2:$cdir:$cwd
(gdb) kill
The program is not being run.
(gdb) file /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-lo-cold
Reading symbols from /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-lo-cold...
(gdb) delete breakpoints
(gdb) info breakpoints
No breakpoints or watchpoints.
(gdb) break main
Breakpoint 1 at 0x744: file /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c, line 78.
(gdb) run 
Starting program: /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-lo-cold 

Breakpoint 1, main () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c:78
78	  foo ();					/* main foo call */
(gdb) info line main
Line 76 of "/home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c" starts at address 0xaaaaaaaaa73c <main> and ends at 0xaaaaaaaaa744 <main+8>.
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: info line main
break 68
Breakpoint 2 at 0xaaaaaaaaa714: file /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c, line 68.
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-1: break at call to bar
continue
Continuing.

Breakpoint 2, foo () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c:68
68	  bar ();					/* foo bar call */
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-1: continue to call of bar
step
bar () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c:62
62	}						/* bar end */
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-1: step into bar
step
foo () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c:70
70	  if (e) foo_cold ();				/* foo foo_cold call */
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-1: step out of bar, back into foo
spawn /home/user/build/binutils-gdb-master/gdb/testsuite/../../gdb/gdb -nw -nx -data-directory /home/user/build/binutils-gdb-master/gdb/testsuite/../data-directory
GNU gdb (GDB) 10.0.50.20200319-git
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "aarch64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) set height 0
(gdb) set width 0
(gdb) dir
Reinitialize source path to empty? (y or n) y
Source directories searched: $cdir:$cwd
(gdb) dir /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2
Source directories searched: /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2:$cdir:$cwd
(gdb) kill
The program is not being run.
(gdb) file /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-lo-cold
Reading symbols from /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-lo-cold...
(gdb) delete breakpoints
(gdb) info breakpoints
No breakpoints or watchpoints.
(gdb) break main
Breakpoint 1 at 0x744: file /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c, line 78.
(gdb) run 
Starting program: /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-lo-cold 

Breakpoint 1, main () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c:78
78	  foo ();					/* main foo call */
(gdb) break foo
Breakpoint 2 at 0xaaaaaaaaa714: file /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c, line 68.
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-2: break foo
continue
Continuing.

Breakpoint 2, foo () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c:68
68	  bar ();					/* foo bar call */
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-2: continue to foo
step
bar () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c:62
62	}						/* bar end */
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-2: step into bar
step
foo () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c:70
70	  if (e) foo_cold ();				/* foo foo_cold call */
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-2: step out of bar, back into foo
spawn /home/user/build/binutils-gdb-master/gdb/testsuite/../../gdb/gdb -nw -nx -data-directory /home/user/build/binutils-gdb-master/gdb/testsuite/../data-directory
GNU gdb (GDB) 10.0.50.20200319-git
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "aarch64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) set height 0
(gdb) set width 0
(gdb) dir
Reinitialize source path to empty? (y or n) y
Source directories searched: $cdir:$cwd
(gdb) dir /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2
Source directories searched: /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2:$cdir:$cwd
(gdb) kill
The program is not being run.
(gdb) file /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-lo-cold
Reading symbols from /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-lo-cold...
(gdb) delete breakpoints
(gdb) info breakpoints
No breakpoints or watchpoints.
(gdb) break main
Breakpoint 1 at 0x744: file /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c, line 78.
(gdb) run 
Starting program: /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-lo-cold 

Breakpoint 1, main () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c:78
78	  foo ();					/* main foo call */
(gdb) gdb_expect_list pattern: /Dump of assembler code for function foo:/
disassemble foo
Dump of assembler code for function foo:
Address range 0xaaaaaaaaa70c to 0xaaaaaaaaa73c:
   0x0000aaaaaaaaa70c <+0>:	stp	x29, x30, [sp, #-16]!
   0x0000aaaaaaaaa710 <+4>:	mov	x29, sp
   0x0000aaaaaaaaa714 <+8>:	bl	0xaaaaaaaaa704 <bar>
gdb_expect_list pattern: /Address range 0x[0-9A-Fa-f]+ to 0x[0-9A-Fa-f]+:/
gdb_expect_list pattern: /   0x[0-9A-Fa-f]+ <\+0>:/
gdb_expect_list pattern: /Address range 0x[0-9A-Fa-f]+ to 0x[0-9A-Fa-f]+:/
   0x0000aaaaaaaaa718 <+12>:	adrp	x0, 0xaaaaaaabb000
   0x0000aaaaaaaaa71c <+16>:	add	x0, x0, #0x14
   0x0000aaaaaaaaa720 <+20>:	ldr	w0, [x0]
   0x0000aaaaaaaaa724 <+24>:	cmp	w0, #0x0
   0x0000aaaaaaaaa728 <+28>:	b.eq	0xaaaaaaaaa730 <foo+36>  // b.none
   0x0000aaaaaaaaa72c <+32>:	bl	0xaaaaaaaaa6ec <foo_cold>
   0x0000aaaaaaaaa730 <+36>:	nop
   0x0000aaaaaaaaa734 <+40>:	ldp	x29, x30, [sp], #16
   0x0000aaaaaaaaa738 <+44>:	ret
Address range 0xaaaaaaaaa6ec to 0xaaaaaaaaa704:
   0x0000aaaaaaaaa6ec <-32>:	stp	x29, x30, [sp, #-16]!
   0x0000aaaaaaaaa6f0 <-28>:	mov	x29, sp
   0x0000aaaaaaaaa6f4 <-24>:	bl	0xaaaaaaaaa6e4 <baz>
   0x0000aaaaaaaaa6f8 <-20>:	nop
   0x0000aaaaaaaaa6fc <-16>:	ldp	x29, x30, [sp], #16
   0x0000aaaaaaaaa700 <-12>:	ret
End of assembler dump.
(gdb) gdb_expect_list pattern: /   0x[0-9A-Fa-f]+ <(.+?)>:/
gdb_expect_list pattern: /End of assembler dump\./
gdb_expect_list pattern: //
PASS: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: disassemble foo
x/i foo_cold
   0xaaaaaaaaa6ec <foo_cold>:	stp	x29, x30, [sp, #-16]!
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: x/i foo_cold
x/i foo
   0xaaaaaaaaa70c <foo>:	stp	x29, x30, [sp, #-16]!
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: x/i foo
PASS: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: foo and foo_cold are at different addresses
break foo
Breakpoint 2 at 0xaaaaaaaaa714: file /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c, line 68.
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: break foo
break baz
Breakpoint 3 at 0xaaaaaaaaa6e4: file /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c, line 48.
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: break baz
continue
Continuing.

Breakpoint 2, foo () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c:68
68	  bar ();					/* foo bar call */
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: continue to foo
set variable e=1
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: set variable e=1
continue
Continuing.

Breakpoint 3, baz () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c:48
48	}						/* baz end */
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: continue to baz
gdb_expect_list pattern: /[
]#0 .*? baz \(\) /
bt
#0  baz () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c:48
gdb_expect_list pattern: /[
]#1 .*? foo \(\) /
#1  0x0000aaaaaaaaa6f8 in foo () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c:54
#2  0x0000aaaaaaaaa730 in foo () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c:70
gdb_expect_list pattern: /[
]#2 .*? foo \(\) /
gdb_expect_list pattern: /[
]#3 .*? main \(\) /
#3  0x0000aaaaaaaaa748 in main () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c:78
gdb_expect_list pattern: //
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: no-cold-names: backtrace from baz
x/2i foo_cold
   0xaaaaaaaaa6ec <foo_cold>:	stp	x29, x30, [sp, #-16]!
   0xaaaaaaaaa6f0 <foo-28>:	mov	x29, sp
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: no-cold-names: x/2i foo_cold
PASS: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: no-cold-names: offset to foo_cold is not too large
info line *foo_cold
Line 52 of "/home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c" starts at address 0xaaaaaaaaa6ec <foo_cold> and ends at 0xaaaaaaaaa6f4 <foo-24>.
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: no-cold-names: info line *foo_cold
spawn /home/user/build/binutils-gdb-master/gdb/testsuite/../../gdb/gdb -nw -nx -data-directory /home/user/build/binutils-gdb-master/gdb/testsuite/../data-directory
GNU gdb (GDB) 10.0.50.20200319-git
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "aarch64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) set height 0
(gdb) set width 0
(gdb) dir
Reinitialize source path to empty? (y or n) y
Source directories searched: $cdir:$cwd
(gdb) dir /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2
Source directories searched: /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2:$cdir:$cwd
(gdb) kill
The program is not being run.
(gdb) file /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-lo-cold
Reading symbols from /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-lo-cold...
(gdb) delete breakpoints
(gdb) info breakpoints
No breakpoints or watchpoints.
(gdb) break main
Breakpoint 1 at 0x744: file /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c, line 78.
(gdb) run 
Starting program: /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-lo-cold 

Breakpoint 1, main () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c:78
78	  foo ();					/* main foo call */
(gdb) step
foo () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c:68
68	  bar ();					/* foo bar call */
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-3: step into foo from main
step
bar () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c:62
62	}						/* bar end */
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-3: step into bar from foo
step
foo () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c:70
70	  if (e) foo_cold ();				/* foo foo_cold call */
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-3: step out of bar to foo
set variable e=1
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-3: set variable e=1
step
foo () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c:54
54	  baz ();					/* foo_cold baz call */
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-3: step into foo_cold from foo
step
baz () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c:48
48	}						/* baz end */
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-3: step into baz from foo_cold
step
foo () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c:56
56	}						/* foo_cold end */
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-3: step out of baz to foo_cold
step
foo () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c:72
72	}						/* foo end */
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-3: step out of foo_cold to foo
step
main () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c:80
80	  return 0;					/* main return */
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-3: step out of foo to main
Executing on host: gcc  -fno-stack-protector  -fdiagnostics-color=never -c -g  -o /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-hi-cold0.o /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c    (timeout = 300)
spawn -ignore SIGHUP gcc -fno-stack-protector -fdiagnostics-color=never -c -g -o /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-hi-cold0.o /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c
Executing on host: gcc  -fno-stack-protector /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-hi-cold0.o  -fdiagnostics-color=never -g  -lm   -o /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-hi-cold    (timeout = 300)
spawn -ignore SIGHUP gcc -fno-stack-protector /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-hi-cold0.o -fdiagnostics-color=never -g -lm -o /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-hi-cold
spawn /home/user/build/binutils-gdb-master/gdb/testsuite/../../gdb/gdb -nw -nx -data-directory /home/user/build/binutils-gdb-master/gdb/testsuite/../data-directory
GNU gdb (GDB) 10.0.50.20200319-git
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "aarch64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) set height 0
(gdb) set width 0
(gdb) dir
Reinitialize source path to empty? (y or n) y
Source directories searched: $cdir:$cwd
(gdb) dir /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2
Source directories searched: /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2:$cdir:$cwd
(gdb) kill
The program is not being run.
(gdb) file /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-hi-cold
Reading symbols from /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-hi-cold...
(gdb) print /d sizeof (int)
$1 = 4
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: get integer valueof "sizeof (int)"
Executing on host: gcc  -fno-stack-protector /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c  -fdiagnostics-color=never -g  -lm   -o /home/user/build/binutils-gdb-master/gdb/testsuite/temp/54423/func_addr54423.x    (timeout = 300)
spawn -ignore SIGHUP gcc -fno-stack-protector /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c -fdiagnostics-color=never -g -lm -o /home/user/build/binutils-gdb-master/gdb/testsuite/temp/54423/func_addr54423.x
spawn /home/user/build/binutils-gdb-master/gdb/testsuite/../../gdb/gdb -nw -nx -data-directory /home/user/build/binutils-gdb-master/gdb/testsuite/../data-directory
GNU gdb (GDB) 10.0.50.20200319-git
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "aarch64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) set height 0
(gdb) set width 0
(gdb) kill
The program is not being run.
(gdb) file /home/user/build/binutils-gdb-master/gdb/testsuite/temp/54423/func_addr54423.x
Reading symbols from /home/user/build/binutils-gdb-master/gdb/testsuite/temp/54423/func_addr54423.x...
(gdb) p main_label - main
$1 = 8
(gdb) disassemble main
Dump of assembler code for function main:
   0x000000000000073c <+0>:	stp	x29, x30, [sp, #-16]!
   0x0000000000000740 <+4>:	mov	x29, sp
   0x0000000000000744 <+8>:	bl	0x6e4 <foo>
   0x0000000000000748 <+12>:	mov	w0, #0x0                   	// #0
   0x000000000000074c <+16>:	ldp	x29, x30, [sp], #16
   0x0000000000000750 <+20>:	ret
End of assembler dump.
(gdb) x/2i main+20
   0x750 <main+20>:	ret
   0x754 <main_label2+12>:	.inst	0x00000000 ; undefined
(gdb) Executing on host: gcc  -fno-stack-protector /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c  -fdiagnostics-color=never -g  -lm   -o /home/user/build/binutils-gdb-master/gdb/testsuite/temp/54423/func_addr54423.x    (timeout = 300)
spawn -ignore SIGHUP gcc -fno-stack-protector /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c -fdiagnostics-color=never -g -lm -o /home/user/build/binutils-gdb-master/gdb/testsuite/temp/54423/func_addr54423.x
spawn /home/user/build/binutils-gdb-master/gdb/testsuite/../../gdb/gdb -nw -nx -data-directory /home/user/build/binutils-gdb-master/gdb/testsuite/../data-directory
GNU gdb (GDB) 10.0.50.20200319-git
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "aarch64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) set height 0
(gdb) set width 0
(gdb) kill
The program is not being run.
(gdb) file /home/user/build/binutils-gdb-master/gdb/testsuite/temp/54423/func_addr54423.x
Reading symbols from /home/user/build/binutils-gdb-master/gdb/testsuite/temp/54423/func_addr54423.x...
(gdb) p foo_label - foo
$1 = 8
(gdb) disassemble foo
Dump of assembler code for function foo:
   0x00000000000006e4 <+0>:	stp	x29, x30, [sp, #-16]!
   0x00000000000006e8 <+4>:	mov	x29, sp
   0x00000000000006ec <+8>:	bl	0x714 <bar>
   0x00000000000006f0 <+12>:	adrp	x0, 0x11000
   0x00000000000006f4 <+16>:	add	x0, x0, #0x14
   0x00000000000006f8 <+20>:	ldr	w0, [x0]
   0x00000000000006fc <+24>:	cmp	w0, #0x0
   0x0000000000000700 <+28>:	b.eq	0x708 <foo+36>  // b.none
   0x0000000000000704 <+32>:	bl	0x71c <foo_cold>
   0x0000000000000708 <+36>:	nop
   0x000000000000070c <+40>:	ldp	x29, x30, [sp], #16
   0x0000000000000710 <+44>:	ret
End of assembler dump.
(gdb) x/2i foo+44
   0x710 <foo+44>:	ret
   0x714 <bar>:	nop
(gdb) Executing on host: gcc  -fno-stack-protector /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c  -fdiagnostics-color=never -g  -lm   -o /home/user/build/binutils-gdb-master/gdb/testsuite/temp/54423/func_addr54423.x    (timeout = 300)
spawn -ignore SIGHUP gcc -fno-stack-protector /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c -fdiagnostics-color=never -g -lm -o /home/user/build/binutils-gdb-master/gdb/testsuite/temp/54423/func_addr54423.x
spawn /home/user/build/binutils-gdb-master/gdb/testsuite/../../gdb/gdb -nw -nx -data-directory /home/user/build/binutils-gdb-master/gdb/testsuite/../data-directory
GNU gdb (GDB) 10.0.50.20200319-git
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "aarch64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) set height 0
(gdb) set width 0
(gdb) kill
The program is not being run.
(gdb) file /home/user/build/binutils-gdb-master/gdb/testsuite/temp/54423/func_addr54423.x
Reading symbols from /home/user/build/binutils-gdb-master/gdb/testsuite/temp/54423/func_addr54423.x...
(gdb) p foo_cold_label - foo_cold
$1 = 8
(gdb) disassemble foo_cold
Dump of assembler code for function foo_cold:
   0x000000000000071c <+0>:	stp	x29, x30, [sp, #-16]!
   0x0000000000000720 <+4>:	mov	x29, sp
   0x0000000000000724 <+8>:	bl	0x734 <baz>
   0x0000000000000728 <+12>:	nop
   0x000000000000072c <+16>:	ldp	x29, x30, [sp], #16
   0x0000000000000730 <+20>:	ret
End of assembler dump.
(gdb) x/2i foo_cold+20
   0x730 <foo_cold+20>:	ret
   0x734 <baz>:	nop
(gdb) Executing on host: gcc  -fno-stack-protector /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c  -fdiagnostics-color=never -g  -lm   -o /home/user/build/binutils-gdb-master/gdb/testsuite/temp/54423/func_addr54423.x    (timeout = 300)
spawn -ignore SIGHUP gcc -fno-stack-protector /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c -fdiagnostics-color=never -g -lm -o /home/user/build/binutils-gdb-master/gdb/testsuite/temp/54423/func_addr54423.x
spawn /home/user/build/binutils-gdb-master/gdb/testsuite/../../gdb/gdb -nw -nx -data-directory /home/user/build/binutils-gdb-master/gdb/testsuite/../data-directory
GNU gdb (GDB) 10.0.50.20200319-git
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "aarch64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) set height 0
(gdb) set width 0
(gdb) kill
The program is not being run.
(gdb) file /home/user/build/binutils-gdb-master/gdb/testsuite/temp/54423/func_addr54423.x
Reading symbols from /home/user/build/binutils-gdb-master/gdb/testsuite/temp/54423/func_addr54423.x...
(gdb) p bar_label - bar
$1 = 0
(gdb) disassemble bar
Dump of assembler code for function bar:
   0x0000000000000714 <+0>:	nop
   0x0000000000000718 <+4>:	ret
End of assembler dump.
(gdb) x/2i bar+4
   0x718 <bar+4>:	ret
   0x71c <foo_cold>:	stp	x29, x30, [sp, #-16]!
(gdb) Executing on host: gcc  -fno-stack-protector /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c  -fdiagnostics-color=never -g  -lm   -o /home/user/build/binutils-gdb-master/gdb/testsuite/temp/54423/func_addr54423.x    (timeout = 300)
spawn -ignore SIGHUP gcc -fno-stack-protector /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c -fdiagnostics-color=never -g -lm -o /home/user/build/binutils-gdb-master/gdb/testsuite/temp/54423/func_addr54423.x
spawn /home/user/build/binutils-gdb-master/gdb/testsuite/../../gdb/gdb -nw -nx -data-directory /home/user/build/binutils-gdb-master/gdb/testsuite/../data-directory
GNU gdb (GDB) 10.0.50.20200319-git
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "aarch64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) set height 0
(gdb) set width 0
(gdb) kill
The program is not being run.
(gdb) file /home/user/build/binutils-gdb-master/gdb/testsuite/temp/54423/func_addr54423.x
Reading symbols from /home/user/build/binutils-gdb-master/gdb/testsuite/temp/54423/func_addr54423.x...
(gdb) p baz_label - baz
$1 = 0
(gdb) disassemble baz
Dump of assembler code for function baz:
   0x0000000000000734 <+0>:	nop
   0x0000000000000738 <+4>:	ret
End of assembler dump.
(gdb) x/2i baz+4
   0x738 <baz+4>:	ret
   0x73c <main>:	stp	x29, x30, [sp, #-16]!
(gdb) Executing on host: gcc  -fno-stack-protector  -fdiagnostics-color=never -c  -o /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-hi-cold0.o /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c    (timeout = 300)
spawn -ignore SIGHUP gcc -fno-stack-protector -fdiagnostics-color=never -c -o /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-hi-cold0.o /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c
Executing on host: gcc  -fno-stack-protector  -fdiagnostics-color=never -c  -o /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-hi-cold1.o /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-hi-cold-dw2.S    (timeout = 300)
spawn -ignore SIGHUP gcc -fno-stack-protector -fdiagnostics-color=never -c -o /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-hi-cold1.o /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-hi-cold-dw2.S
Executing on host: gcc  -fno-stack-protector /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-hi-cold0.o /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-hi-cold1.o  -fdiagnostics-color=never  -lm   -o /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-hi-cold    (timeout = 300)
spawn -ignore SIGHUP gcc -fno-stack-protector /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-hi-cold0.o /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-hi-cold1.o -fdiagnostics-color=never -lm -o /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-hi-cold
spawn /home/user/build/binutils-gdb-master/gdb/testsuite/../../gdb/gdb -nw -nx -data-directory /home/user/build/binutils-gdb-master/gdb/testsuite/../data-directory
GNU gdb (GDB) 10.0.50.20200319-git
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "aarch64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) set height 0
(gdb) set width 0
(gdb) dir
Reinitialize source path to empty? (y or n) y
Source directories searched: $cdir:$cwd
(gdb) dir /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2
Source directories searched: /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2:$cdir:$cwd
(gdb) kill
The program is not being run.
(gdb) file /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-hi-cold
Reading symbols from /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-hi-cold...
(gdb) delete breakpoints
(gdb) info breakpoints
No breakpoints or watchpoints.
(gdb) break main
Breakpoint 1 at 0x744: file /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c, line 78.
(gdb) run 
Starting program: /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-hi-cold 

Breakpoint 1, main () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c:78
78	  foo ();					/* main foo call */
(gdb) info line main
Line 76 of "/home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c" starts at address 0xaaaaaaaaa73c <main> and ends at 0xaaaaaaaaa744 <main+8>.
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: info line main
break 48
Breakpoint 2 at 0xaaaaaaaaa6ec: file /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c, line 48.
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-1: break at call to bar
continue
Continuing.

Breakpoint 2, foo () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c:48
48	  bar ();					/* foo bar call */
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-1: continue to call of bar
step
bar () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c:58
58	}						/* bar end */
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-1: step into bar
step
foo () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c:50
50	  if (e) foo_cold ();				/* foo foo_cold call */
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-1: step out of bar, back into foo
spawn /home/user/build/binutils-gdb-master/gdb/testsuite/../../gdb/gdb -nw -nx -data-directory /home/user/build/binutils-gdb-master/gdb/testsuite/../data-directory
GNU gdb (GDB) 10.0.50.20200319-git
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "aarch64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) set height 0
(gdb) set width 0
(gdb) dir
Reinitialize source path to empty? (y or n) y
Source directories searched: $cdir:$cwd
(gdb) dir /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2
Source directories searched: /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2:$cdir:$cwd
(gdb) kill
The program is not being run.
(gdb) file /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-hi-cold
Reading symbols from /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-hi-cold...
(gdb) delete breakpoints
(gdb) info breakpoints
No breakpoints or watchpoints.
(gdb) break main
Breakpoint 1 at 0x744: file /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c, line 78.
(gdb) run 
Starting program: /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-hi-cold 

Breakpoint 1, main () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c:78
78	  foo ();					/* main foo call */
(gdb) break foo
Breakpoint 2 at 0xaaaaaaaaa6ec: file /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c, line 48.
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-2: break foo
continue
Continuing.

Breakpoint 2, foo () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c:48
48	  bar ();					/* foo bar call */
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-2: continue to foo
step
bar () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c:58
58	}						/* bar end */
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-2: step into bar
step
foo () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c:50
50	  if (e) foo_cold ();				/* foo foo_cold call */
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-2: step out of bar, back into foo
spawn /home/user/build/binutils-gdb-master/gdb/testsuite/../../gdb/gdb -nw -nx -data-directory /home/user/build/binutils-gdb-master/gdb/testsuite/../data-directory
GNU gdb (GDB) 10.0.50.20200319-git
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "aarch64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) set height 0
(gdb) set width 0
(gdb) dir
Reinitialize source path to empty? (y or n) y
Source directories searched: $cdir:$cwd
(gdb) dir /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2
Source directories searched: /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2:$cdir:$cwd
(gdb) kill
The program is not being run.
(gdb) file /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-hi-cold
Reading symbols from /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-hi-cold...
(gdb) delete breakpoints
(gdb) info breakpoints
No breakpoints or watchpoints.
(gdb) break main
Breakpoint 1 at 0x744: file /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c, line 78.
(gdb) run 
Starting program: /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-hi-cold 

Breakpoint 1, main () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c:78
78	  foo ();					/* main foo call */
(gdb) gdb_expect_list pattern: /Dump of assembler code for function foo:/
disassemble foo
Dump of assembler code for function foo:
Address range 0xaaaaaaaaa6e4 to 0xaaaaaaaaa714:
gdb_expect_list pattern: /Address range 0x[0-9A-Fa-f]+ to 0x[0-9A-Fa-f]+:/
gdb_expect_list pattern: /   0x[0-9A-Fa-f]+ <\+0>:/
   0x0000aaaaaaaaa6e4 <+0>:	stp	x29, x30, [sp, #-16]!
   0x0000aaaaaaaaa6e8 <+4>:	mov	x29, sp
   0x0000aaaaaaaaa6ec <+8>:	bl	0xaaaaaaaaa714 <bar>
   0x0000aaaaaaaaa6f0 <+12>:	adrp	x0, 0xaaaaaaabb000
   0x0000aaaaaaaaa6f4 <+16>:	add	x0, x0, #0x14
   0x0000aaaaaaaaa6f8 <+20>:	ldr	w0, [x0]
   0x0000aaaaaaaaa6fc <+24>:	cmp	w0, #0x0
   0x0000aaaaaaaaa700 <+28>:	b.eq	0xaaaaaaaaa708 <foo+36>  // b.none
   0x0000aaaaaaaaa704 <+32>:	bl	0xaaaaaaaaa71c <foo_cold>
   0x0000aaaaaaaaa708 <+36>:	nop
   0x0000aaaaaaaaa70c <+40>:	ldp	x29, x30, [sp], #16
   0x0000aaaaaaaaa710 <+44>:	ret
gdb_expect_list pattern: /Address range 0x[0-9A-Fa-f]+ to 0x[0-9A-Fa-f]+:/
Address range 0xaaaaaaaaa71c to 0xaaaaaaaaa734:
   0x0000aaaaaaaaa71c <+56>:	stp	x29, x30, [sp, #-16]!
   0x0000aaaaaaaaa720 <+60>:	mov	x29, sp
   0x0000aaaaaaaaa724 <+64>:	bl	0xaaaaaaaaa734 <baz>
   0x0000aaaaaaaaa728 <+68>:	nop
gdb_expect_list pattern: /   0x[0-9A-Fa-f]+ <(.+?)>:/
gdb_expect_list pattern: /End of assembler dump\./
   0x0000aaaaaaaaa72c <+72>:	ldp	x29, x30, [sp], #16
   0x0000aaaaaaaaa730 <+76>:	ret
End of assembler dump.
(gdb) gdb_expect_list pattern: //
PASS: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: disassemble foo
x/i foo_cold
   0xaaaaaaaaa71c <foo_cold>:	stp	x29, x30, [sp, #-16]!
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: x/i foo_cold
x/i foo
   0xaaaaaaaaa6e4 <foo>:	stp	x29, x30, [sp, #-16]!
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: x/i foo
PASS: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: foo and foo_cold are at different addresses
break foo
Breakpoint 2 at 0xaaaaaaaaa6ec: file /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c, line 48.
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: break foo
break baz
Breakpoint 3 at 0xaaaaaaaaa734: file /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c, line 72.
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: break baz
continue
Continuing.

Breakpoint 2, foo () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c:48
48	  bar ();					/* foo bar call */
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: continue to foo
set variable e=1
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: set variable e=1
continue
Continuing.

Breakpoint 3, baz () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c:72
72	}						/* baz end */
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: continue to baz
gdb_expect_list pattern: /[
]#0 .*? baz \(\) /
bt
#0  baz () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c:72
gdb_expect_list pattern: /[
]#1 .*? foo \(\) /
#1  0x0000aaaaaaaaa728 in foo () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c:64
#2  0x0000aaaaaaaaa708 in foo () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c:50
gdb_expect_list pattern: /[
]#2 .*? foo \(\) /
gdb_expect_list pattern: /[
]#3 .*? main \(\) /
#3  0x0000aaaaaaaaa748 in main () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c:78
(gdb) gdb_expect_list pattern: //
PASS: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: no-cold-names: backtrace from baz
x/2i foo_cold
   0xaaaaaaaaa71c <foo_cold>:	stp	x29, x30, [sp, #-16]!
   0xaaaaaaaaa720 <foo+60>:	mov	x29, sp
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: no-cold-names: x/2i foo_cold
PASS: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: no-cold-names: offset to foo_cold is not too large
info line *foo_cold
Line 62 of "/home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c" starts at address 0xaaaaaaaaa71c <foo_cold> and ends at 0xaaaaaaaaa724 <foo+64>.
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: no-cold-names: info line *foo_cold
spawn /home/user/build/binutils-gdb-master/gdb/testsuite/../../gdb/gdb -nw -nx -data-directory /home/user/build/binutils-gdb-master/gdb/testsuite/../data-directory
GNU gdb (GDB) 10.0.50.20200319-git
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "aarch64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) set height 0
(gdb) set width 0
(gdb) dir
Reinitialize source path to empty? (y or n) y
Source directories searched: $cdir:$cwd
(gdb) dir /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2
Source directories searched: /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2:$cdir:$cwd
(gdb) kill
The program is not being run.
(gdb) file /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-hi-cold
Reading symbols from /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-hi-cold...
(gdb) delete breakpoints
(gdb) info breakpoints
No breakpoints or watchpoints.
(gdb) break main
Breakpoint 1 at 0x744: file /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c, line 78.
(gdb) run 
Starting program: /home/user/build/binutils-gdb-master/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges-func/dw2-ranges-func-hi-cold 

Breakpoint 1, main () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c:78
78	  foo ();					/* main foo call */
(gdb) step
foo () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c:48
48	  bar ();					/* foo bar call */
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-3: step into foo from main
step
bar () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c:58
58	}						/* bar end */
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-3: step into bar from foo
step
foo () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c:50
50	  if (e) foo_cold ();				/* foo foo_cold call */
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-3: step out of bar to foo
set variable e=1
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-3: set variable e=1
step
foo () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c:64
64	  baz ();					/* foo_cold baz call */
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-3: step into foo_cold from foo
step
baz () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c:72
72	}						/* baz end */
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-3: step into baz from foo_cold
step
foo () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c:66
66	}						/* foo_cold end */
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-3: step out of baz to foo_cold
step
foo () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c:52
52	}						/* foo end */
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-3: step out of foo_cold to foo
step
main () at /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c:80
80	  return 0;					/* main return */
(gdb) PASS: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-3: step out of foo to main
testcase /home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-ranges-func.exp completed in 3 seconds

		=== gdb Summary ===

# of expected passes		64
Executing on host: /home/user/build/binutils-gdb-master/gdb/testsuite/../../gdb/gdb -nw -nx -data-directory /home/user/build/binutils-gdb-master/gdb/testsuite/../data-directory --version    (timeout = 300)
spawn -ignore SIGHUP /home/user/build/binutils-gdb-master/gdb/testsuite/../../gdb/gdb -nw -nx -data-directory /home/user/build/binutils-gdb-master/gdb/testsuite/../data-directory --version
GNU gdb (GDB) 10.0.50.20200319-git
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
/home/user/build/binutils-gdb-master/gdb/gdb version  10.0.50.20200319-git -nw -nx -data-directory /home/user/build/binutils-gdb-master/gdb/testsuite/../data-directory 

runtest completed at Sat Apr  4 13:41:36 2020

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v3 2/2] Fix an undefined behavior in record_line
  2020-04-04 13:56       ` Luis Machado
@ 2020-04-04 16:06         ` Bernd Edlinger
  2020-04-04 16:22           ` Luis Machado
  0 siblings, 1 reply; 18+ messages in thread
From: Bernd Edlinger @ 2020-04-04 16:06 UTC (permalink / raw)
  To: Luis Machado, gdb-patches, Andrew Burgess

Hi Luis,

the attachments seem to be twice the lo-cold.c linetables,
I wonder if the hi-cold.c linetable are missing, to somehow
make the picture complete?

Thanks
Bernd.

On 4/4/20 3:56 PM, Luis Machado wrote:
> Hi Bernd,
> 
> On 4/4/20 4:06 AM, Bernd Edlinger wrote:
>> On 4/4/20 6:21 AM, Bernd Edlinger wrote:
>>>
>>>
>>> On 4/4/20 12:53 AM, Luis Machado wrote:
>>>> Hi,
>>>>
>>>> This seems to have caused a few regressions for aarch64-linux. I'm seeing the following:
>>>>
>>>> FAIL: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-3: step into foo from main
>>>> FAIL: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-3: step into bar from foo
>>>> FAIL: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-3: step out of bar to foo
>>>> FAIL: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-3: step into foo_cold from foo
>>>> FAIL: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-3: step into baz from foo_cold
>>>> FAIL: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-3: step out of baz to foo_cold
>>>> FAIL: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-3: step out of foo_cold to foo
>>>> FAIL: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-3: step out of foo to main
>>>> FAIL: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-3: step into foo from main
>>>> FAIL: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-3: step into bar from foo
>>>> FAIL: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-3: step out of bar to foo
>>>> FAIL: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-3: step into foo_cold from foo
>>>> FAIL: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-3: step into baz from foo_cold
>>>> FAIL: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-3: step out of baz to foo_cold
>>>> FAIL: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-3: step out of foo_cold to foo
>>>> FAIL: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-3: step out of foo to main
>>>>
>>>> git bisect pointed at this commit:
>>>>
>>
>> Louis,
>>
>> So, I cannot do much, to debug aarch64 here.
>> I would however like to know what the output of the test result is,
>> when it fails, that is where the step does stop when it is not where it should.
> 
> On a quick look, we're stopping at the wrong location during an attempt to break at "main". I think things just derail from there.
> 
> For now, please find attached a couple logs, one without regressions and one with the failing tests.
> 
> Also, I've attached the decoded/raw line information for both binaries from this testcase. I can play with it further to get more information if you need. Hopefully this data is useful for now.
> 
> Let me know otherwise.
> 
>>
>> And how the line table looks in the test case when it is compiled on aarch64,
>> btw. which gcc version do you use?
> 
> The compiler version is gcc version 7.4.0 (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1).
> 
>>
>> Thanks
>> Bernd.
>>
>>>
>>> Oh, dear.
>>>
>>> Andrew, please watch out,
>>>
>>> your other patch is also about to
>>> change something in this area.
>>>
>>> I tested on x86_64 where everything looked good,
>>> (at least for me, but sime test cases are always faling
>>> or are unstable ...)
>>>
>>> It could be that your patch
>>>
>>> PATCH 2/2] gdb: Preserve is-stmt lines when switch between files
>>>
>>> I just saw in my inbox is also trying to address the same issue.
>>>
>>> I was not aware that you were working on the same issue.
>>>
>>>
>>> Thanks
>>> Bernd.
>>>
>>>> ---
>>>>
>>>> commit 64dc2d4bd24ff7119c913fff91184414f09b8042
>>>> Author: Bernd Edlinger <bernd.edlinger@hotmail.de>
>>>> Date:   Thu Mar 12 11:52:34 2020 +0100
>>>>
>>>>      Fix an undefined behavior in record_line
>>>>
>>>>      Additionally do not completely remove symbols
>>>>      at the same PC than the end marker, instead
>>>>      make them non-is-stmt breakpoints.
>>>>
>>>>      2020-04-01  Bernd Edlinger  <bernd.edlinger@hotmail.de>
>>>>
>>>>              * buildsym.c (record_line): Fix undefined behavior and preserve lines at eof.
>>>>
>>>> ---
>>>>
>>>> What i see in the log is stepping through lines not working as expected.
>>>>
>>>>
>>>> On 3/27/20 12:50 AM, Bernd Edlinger wrote:
>>>>> Additionally do not completely remove symbols
>>>>> at the same PC than the end marker, instead
>>>>> make them non-is-stmt breakpoints.
>>>>>
>>>>> 2020-03-27  Bernd Edlinger  <bernd.edlinger@hotmail.de>
>>>>>      * buildsym.c (record_line): Fix undefined behavior and preserve
>>>>>      lines at eof.
>>>>> ---
>>>>>    gdb/buildsym.c | 34 ++++++++++++++++++----------------
>>>>>    1 file changed, 18 insertions(+), 16 deletions(-)
>>>>>
>>>>> diff --git a/gdb/buildsym.c b/gdb/buildsym.c
>>>>> index 2d1e441..46c5bb1 100644
>>>>> --- a/gdb/buildsym.c
>>>>> +++ b/gdb/buildsym.c
>>>>> @@ -705,27 +705,29 @@ struct blockvector *
>>>>>                  * sizeof (struct linetable_entry))));
>>>>>        }
>>>>>    -  /* Normally, we treat lines as unsorted.  But the end of sequence
>>>>> -     marker is special.  We sort line markers at the same PC by line
>>>>> -     number, so end of sequence markers (which have line == 0) appear
>>>>> -     first.  This is right if the marker ends the previous function,
>>>>> -     and there is no padding before the next function.  But it is
>>>>> -     wrong if the previous line was empty and we are now marking a
>>>>> -     switch to a different subfile.  We must leave the end of sequence
>>>>> -     marker at the end of this group of lines, not sort the empty line
>>>>> -     to after the marker.  The easiest way to accomplish this is to
>>>>> -     delete any empty lines from our table, if they are followed by
>>>>> -     end of sequence markers.  All we lose is the ability to set
>>>>> -     breakpoints at some lines which contain no instructions
>>>>> -     anyway.  */
>>>>> +  /* The end of sequence marker is special.  We need to reset the
>>>>> +     is_stmt flag on previous lines at the same PC, otherwise these
>>>>> +     lines may cause problems since they might be at the same address
>>>>> +     as the following function.  For instance suppose a function calls
>>>>> +     abort there is no reason to emit a ret after that point (no joke).
>>>>> +     So the label may be at the same address where the following
>>>>> +     function begins.  A similar problem appears if a label is at the
>>>>> +     same address where an inline function ends we cannot reliably tell
>>>>> +     if this is considered part of the inline function or the calling
>>>>> +     program or even the next inline function, so stack traces may
>>>>> +     give surprising results.  Expect gdb.cp/step-and-next-inline.exp
>>>>> +     to fail if these lines are not modified here.  */
>>>>>      if (line == 0 && subfile->line_vector->nitems > 0)
>>>>>        {
>>>>> -      e = subfile->line_vector->item + subfile->line_vector->nitems - 1;
>>>>> -      while (subfile->line_vector->nitems > 0 && e->pc == pc)
>>>>> +      e = subfile->line_vector->item + subfile->line_vector->nitems;
>>>>> +      do
>>>>>        {
>>>>>          e--;
>>>>> -      subfile->line_vector->nitems--;
>>>>> +      if (e->pc != pc || e->line == 0)
>>>>> +        break;
>>>>> +      e->is_stmt = 0;
>>>>>        }
>>>>> +      while (e > subfile->line_vector->item);
>>>>>        }
>>>>>        e = subfile->line_vector->item + subfile->line_vector->nitems++;
>>>>>

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v3 2/2] Fix an undefined behavior in record_line
  2020-04-04 16:06         ` Bernd Edlinger
@ 2020-04-04 16:22           ` Luis Machado
  2020-04-04 16:34             ` Bernd Edlinger
  0 siblings, 1 reply; 18+ messages in thread
From: Luis Machado @ 2020-04-04 16:22 UTC (permalink / raw)
  To: Bernd Edlinger, gdb-patches, Andrew Burgess

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

Hi Bernd,

I messed it up, sorry. Here's the line table information again.

Regards,
Luis

On 4/4/20 1:06 PM, Bernd Edlinger wrote:
> Hi Luis,
> 
> the attachments seem to be twice the lo-cold.c linetables,
> I wonder if the hi-cold.c linetable are missing, to somehow
> make the picture complete?
> 
> Thanks
> Bernd.
> 
> On 4/4/20 3:56 PM, Luis Machado wrote:
>> Hi Bernd,
>>
>> On 4/4/20 4:06 AM, Bernd Edlinger wrote:
>>> On 4/4/20 6:21 AM, Bernd Edlinger wrote:
>>>>
>>>>
>>>> On 4/4/20 12:53 AM, Luis Machado wrote:
>>>>> Hi,
>>>>>
>>>>> This seems to have caused a few regressions for aarch64-linux. I'm seeing the following:
>>>>>
>>>>> FAIL: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-3: step into foo from main
>>>>> FAIL: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-3: step into bar from foo
>>>>> FAIL: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-3: step out of bar to foo
>>>>> FAIL: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-3: step into foo_cold from foo
>>>>> FAIL: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-3: step into baz from foo_cold
>>>>> FAIL: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-3: step out of baz to foo_cold
>>>>> FAIL: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-3: step out of foo_cold to foo
>>>>> FAIL: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: step-test-3: step out of foo to main
>>>>> FAIL: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-3: step into foo from main
>>>>> FAIL: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-3: step into bar from foo
>>>>> FAIL: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-3: step out of bar to foo
>>>>> FAIL: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-3: step into foo_cold from foo
>>>>> FAIL: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-3: step into baz from foo_cold
>>>>> FAIL: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-3: step out of baz to foo_cold
>>>>> FAIL: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-3: step out of foo_cold to foo
>>>>> FAIL: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: step-test-3: step out of foo to main
>>>>>
>>>>> git bisect pointed at this commit:
>>>>>
>>>
>>> Louis,
>>>
>>> So, I cannot do much, to debug aarch64 here.
>>> I would however like to know what the output of the test result is,
>>> when it fails, that is where the step does stop when it is not where it should.
>>
>> On a quick look, we're stopping at the wrong location during an attempt to break at "main". I think things just derail from there.
>>
>> For now, please find attached a couple logs, one without regressions and one with the failing tests.
>>
>> Also, I've attached the decoded/raw line information for both binaries from this testcase. I can play with it further to get more information if you need. Hopefully this data is useful for now.
>>
>> Let me know otherwise.
>>
>>>
>>> And how the line table looks in the test case when it is compiled on aarch64,
>>> btw. which gcc version do you use?
>>
>> The compiler version is gcc version 7.4.0 (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1).
>>
>>>
>>> Thanks
>>> Bernd.
>>>
>>>>
>>>> Oh, dear.
>>>>
>>>> Andrew, please watch out,
>>>>
>>>> your other patch is also about to
>>>> change something in this area.
>>>>
>>>> I tested on x86_64 where everything looked good,
>>>> (at least for me, but sime test cases are always faling
>>>> or are unstable ...)
>>>>
>>>> It could be that your patch
>>>>
>>>> PATCH 2/2] gdb: Preserve is-stmt lines when switch between files
>>>>
>>>> I just saw in my inbox is also trying to address the same issue.
>>>>
>>>> I was not aware that you were working on the same issue.
>>>>
>>>>
>>>> Thanks
>>>> Bernd.
>>>>
>>>>> ---
>>>>>
>>>>> commit 64dc2d4bd24ff7119c913fff91184414f09b8042
>>>>> Author: Bernd Edlinger <bernd.edlinger@hotmail.de>
>>>>> Date:   Thu Mar 12 11:52:34 2020 +0100
>>>>>
>>>>>       Fix an undefined behavior in record_line
>>>>>
>>>>>       Additionally do not completely remove symbols
>>>>>       at the same PC than the end marker, instead
>>>>>       make them non-is-stmt breakpoints.
>>>>>
>>>>>       2020-04-01  Bernd Edlinger  <bernd.edlinger@hotmail.de>
>>>>>
>>>>>               * buildsym.c (record_line): Fix undefined behavior and preserve lines at eof.
>>>>>
>>>>> ---
>>>>>
>>>>> What i see in the log is stepping through lines not working as expected.
>>>>>
>>>>>
>>>>> On 3/27/20 12:50 AM, Bernd Edlinger wrote:
>>>>>> Additionally do not completely remove symbols
>>>>>> at the same PC than the end marker, instead
>>>>>> make them non-is-stmt breakpoints.
>>>>>>
>>>>>> 2020-03-27  Bernd Edlinger  <bernd.edlinger@hotmail.de>
>>>>>>       * buildsym.c (record_line): Fix undefined behavior and preserve
>>>>>>       lines at eof.
>>>>>> ---
>>>>>>     gdb/buildsym.c | 34 ++++++++++++++++++----------------
>>>>>>     1 file changed, 18 insertions(+), 16 deletions(-)
>>>>>>
>>>>>> diff --git a/gdb/buildsym.c b/gdb/buildsym.c
>>>>>> index 2d1e441..46c5bb1 100644
>>>>>> --- a/gdb/buildsym.c
>>>>>> +++ b/gdb/buildsym.c
>>>>>> @@ -705,27 +705,29 @@ struct blockvector *
>>>>>>                   * sizeof (struct linetable_entry))));
>>>>>>         }
>>>>>>     -  /* Normally, we treat lines as unsorted.  But the end of sequence
>>>>>> -     marker is special.  We sort line markers at the same PC by line
>>>>>> -     number, so end of sequence markers (which have line == 0) appear
>>>>>> -     first.  This is right if the marker ends the previous function,
>>>>>> -     and there is no padding before the next function.  But it is
>>>>>> -     wrong if the previous line was empty and we are now marking a
>>>>>> -     switch to a different subfile.  We must leave the end of sequence
>>>>>> -     marker at the end of this group of lines, not sort the empty line
>>>>>> -     to after the marker.  The easiest way to accomplish this is to
>>>>>> -     delete any empty lines from our table, if they are followed by
>>>>>> -     end of sequence markers.  All we lose is the ability to set
>>>>>> -     breakpoints at some lines which contain no instructions
>>>>>> -     anyway.  */
>>>>>> +  /* The end of sequence marker is special.  We need to reset the
>>>>>> +     is_stmt flag on previous lines at the same PC, otherwise these
>>>>>> +     lines may cause problems since they might be at the same address
>>>>>> +     as the following function.  For instance suppose a function calls
>>>>>> +     abort there is no reason to emit a ret after that point (no joke).
>>>>>> +     So the label may be at the same address where the following
>>>>>> +     function begins.  A similar problem appears if a label is at the
>>>>>> +     same address where an inline function ends we cannot reliably tell
>>>>>> +     if this is considered part of the inline function or the calling
>>>>>> +     program or even the next inline function, so stack traces may
>>>>>> +     give surprising results.  Expect gdb.cp/step-and-next-inline.exp
>>>>>> +     to fail if these lines are not modified here.  */
>>>>>>       if (line == 0 && subfile->line_vector->nitems > 0)
>>>>>>         {
>>>>>> -      e = subfile->line_vector->item + subfile->line_vector->nitems - 1;
>>>>>> -      while (subfile->line_vector->nitems > 0 && e->pc == pc)
>>>>>> +      e = subfile->line_vector->item + subfile->line_vector->nitems;
>>>>>> +      do
>>>>>>         {
>>>>>>           e--;
>>>>>> -      subfile->line_vector->nitems--;
>>>>>> +      if (e->pc != pc || e->line == 0)
>>>>>> +        break;
>>>>>> +      e->is_stmt = 0;
>>>>>>         }
>>>>>> +      while (e > subfile->line_vector->item);
>>>>>>         }
>>>>>>         e = subfile->line_vector->item + subfile->line_vector->nitems++;
>>>>>>

[-- Attachment #2: dw2-ranges-func-hi-cold.l --]
[-- Type: text/plain, Size: 3059 bytes --]

Raw dump of debug contents of section .debug_line:

  Offset:                      0x0
  Length:                      413
  DWARF Version:               2
  Prologue Length:             170
  Minimum Instruction Length:  1
  Initial value of 'is_stmt':  1
  Line Base:                   1
  Line Range:                  1
  Opcode Base:                 10

 Opcodes:
  Opcode 1 has 0 args
  Opcode 2 has 1 arg
  Opcode 3 has 1 arg
  Opcode 4 has 1 arg
  Opcode 5 has 1 arg
  Opcode 6 has 0 args
  Opcode 7 has 0 args
  Opcode 8 has 0 args
  Opcode 9 has 1 arg

 The Directory Table (offset 0x18):
  1	/home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2

 The File Name Table (offset 0x96):
  Entry	Dir	Time	Size	Name
  1	1	0	0	dw2-ranges-func-hi-cold.c

 Line Number Statements:
  [0x000000b4]  Extended opcode 2: set Address to 0x73c
  [0x000000bf]  Advance Line by 75 to 76
  [0x000000c2]  Copy
  [0x000000c3]  Extended opcode 2: set Address to 0x744
  [0x000000ce]  Advance Line by 2 to 78
  [0x000000d0]  Copy
  [0x000000d1]  Extended opcode 2: set Address to 0x748
  [0x000000dc]  Advance Line by 2 to 80
  [0x000000de]  Copy
  [0x000000df]  Extended opcode 2: set Address to 0x754
  [0x000000ea]  Advance Line by 2 to 82
  [0x000000ec]  Copy
  [0x000000ed]  Extended opcode 1: End of Sequence

  [0x000000f0]  Extended opcode 2: set Address to 0x6e4
  [0x000000fb]  Advance Line by 45 to 46
  [0x000000fd]  Copy
  [0x000000fe]  Extended opcode 2: set Address to 0x6ec
  [0x00000109]  Advance Line by 2 to 48
  [0x0000010b]  Copy
  [0x0000010c]  Extended opcode 2: set Address to 0x6f0
  [0x00000117]  Advance Line by 2 to 50
  [0x00000119]  Copy
  [0x0000011a]  Extended opcode 2: set Address to 0x708
  [0x00000125]  Advance Line by 2 to 52
  [0x00000127]  Copy
  [0x00000128]  Extended opcode 2: set Address to 0x714
  [0x00000133]  Advance Line by 1 to 53
  [0x00000135]  Copy
  [0x00000136]  Extended opcode 1: End of Sequence

  [0x00000139]  Extended opcode 2: set Address to 0x714
  [0x00000144]  Advance Line by 57 to 58
  [0x00000146]  Copy
  [0x00000147]  Advance PC by 8 to 0x71c
  [0x00000149]  Advance Line by 1 to 59
  [0x0000014b]  Copy
  [0x0000014c]  Extended opcode 1: End of Sequence

  [0x0000014f]  Extended opcode 2: set Address to 0x734
  [0x0000015a]  Advance Line by 71 to 72
  [0x0000015d]  Copy
  [0x0000015e]  Advance PC by 8 to 0x73c
  [0x00000160]  Advance Line by 1 to 73
  [0x00000162]  Copy
  [0x00000163]  Extended opcode 1: End of Sequence

  [0x00000166]  Extended opcode 2: set Address to 0x71c
  [0x00000171]  Advance Line by 61 to 62
  [0x00000173]  Copy
  [0x00000174]  Extended opcode 2: set Address to 0x724
  [0x0000017f]  Advance Line by 2 to 64
  [0x00000181]  Copy
  [0x00000182]  Extended opcode 2: set Address to 0x728
  [0x0000018d]  Advance Line by 2 to 66
  [0x0000018f]  Copy
  [0x00000190]  Extended opcode 2: set Address to 0x734
  [0x0000019b]  Advance Line by 1 to 67
  [0x0000019d]  Copy
  [0x0000019e]  Extended opcode 1: End of Sequence



[-- Attachment #3: dw2-ranges-func-hi-cold.L --]
[-- Type: text/plain, Size: 1706 bytes --]

Contents of the .debug_line section:

dw2-ranges-func-hi-cold.c:
File name                            Line number    Starting address    View
dw2-ranges-func-hi-cold.c                     76               0x73c
dw2-ranges-func-hi-cold.c                     78               0x744
dw2-ranges-func-hi-cold.c                     80               0x748
dw2-ranges-func-hi-cold.c                     82               0x754
dw2-ranges-func-hi-cold.c                     82               0x754       1

dw2-ranges-func-hi-cold.c                     46               0x6e4
dw2-ranges-func-hi-cold.c                     48               0x6ec
dw2-ranges-func-hi-cold.c                     50               0x6f0
dw2-ranges-func-hi-cold.c                     52               0x708
dw2-ranges-func-hi-cold.c                     53               0x714
dw2-ranges-func-hi-cold.c                     53               0x714       1

dw2-ranges-func-hi-cold.c                     58               0x714
dw2-ranges-func-hi-cold.c                     59               0x71c
dw2-ranges-func-hi-cold.c                     59               0x71c       1

dw2-ranges-func-hi-cold.c                     72               0x734
dw2-ranges-func-hi-cold.c                     73               0x73c
dw2-ranges-func-hi-cold.c                     73               0x73c       1

dw2-ranges-func-hi-cold.c                     62               0x71c
dw2-ranges-func-hi-cold.c                     64               0x724
dw2-ranges-func-hi-cold.c                     66               0x728
dw2-ranges-func-hi-cold.c                     67               0x734
dw2-ranges-func-hi-cold.c                     67               0x734       1



[-- Attachment #4: dw2-ranges-func-lo-cold.l --]
[-- Type: text/plain, Size: 3059 bytes --]

Raw dump of debug contents of section .debug_line:

  Offset:                      0x0
  Length:                      413
  DWARF Version:               2
  Prologue Length:             170
  Minimum Instruction Length:  1
  Initial value of 'is_stmt':  1
  Line Base:                   1
  Line Range:                  1
  Opcode Base:                 10

 Opcodes:
  Opcode 1 has 0 args
  Opcode 2 has 1 arg
  Opcode 3 has 1 arg
  Opcode 4 has 1 arg
  Opcode 5 has 1 arg
  Opcode 6 has 0 args
  Opcode 7 has 0 args
  Opcode 8 has 0 args
  Opcode 9 has 1 arg

 The Directory Table (offset 0x18):
  1	/home/user/build/binutils-gdb-master/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.dwarf2

 The File Name Table (offset 0x96):
  Entry	Dir	Time	Size	Name
  1	1	0	0	dw2-ranges-func-lo-cold.c

 Line Number Statements:
  [0x000000b4]  Extended opcode 2: set Address to 0x73c
  [0x000000bf]  Advance Line by 75 to 76
  [0x000000c2]  Copy
  [0x000000c3]  Extended opcode 2: set Address to 0x744
  [0x000000ce]  Advance Line by 2 to 78
  [0x000000d0]  Copy
  [0x000000d1]  Extended opcode 2: set Address to 0x748
  [0x000000dc]  Advance Line by 2 to 80
  [0x000000de]  Copy
  [0x000000df]  Extended opcode 2: set Address to 0x754
  [0x000000ea]  Advance Line by 2 to 82
  [0x000000ec]  Copy
  [0x000000ed]  Extended opcode 1: End of Sequence

  [0x000000f0]  Extended opcode 2: set Address to 0x70c
  [0x000000fb]  Advance Line by 65 to 66
  [0x000000fe]  Copy
  [0x000000ff]  Extended opcode 2: set Address to 0x714
  [0x0000010a]  Advance Line by 2 to 68
  [0x0000010c]  Copy
  [0x0000010d]  Extended opcode 2: set Address to 0x718
  [0x00000118]  Advance Line by 2 to 70
  [0x0000011a]  Copy
  [0x0000011b]  Extended opcode 2: set Address to 0x730
  [0x00000126]  Advance Line by 2 to 72
  [0x00000128]  Copy
  [0x00000129]  Extended opcode 2: set Address to 0x73c
  [0x00000134]  Advance Line by 1 to 73
  [0x00000136]  Copy
  [0x00000137]  Extended opcode 1: End of Sequence

  [0x0000013a]  Extended opcode 2: set Address to 0x704
  [0x00000145]  Advance Line by 61 to 62
  [0x00000147]  Copy
  [0x00000148]  Advance PC by 8 to 0x70c
  [0x0000014a]  Advance Line by 1 to 63
  [0x0000014c]  Copy
  [0x0000014d]  Extended opcode 1: End of Sequence

  [0x00000150]  Extended opcode 2: set Address to 0x6e4
  [0x0000015b]  Advance Line by 47 to 48
  [0x0000015d]  Copy
  [0x0000015e]  Advance PC by 8 to 0x6ec
  [0x00000160]  Advance Line by 1 to 49
  [0x00000162]  Copy
  [0x00000163]  Extended opcode 1: End of Sequence

  [0x00000166]  Extended opcode 2: set Address to 0x6ec
  [0x00000171]  Advance Line by 51 to 52
  [0x00000173]  Copy
  [0x00000174]  Extended opcode 2: set Address to 0x6f4
  [0x0000017f]  Advance Line by 2 to 54
  [0x00000181]  Copy
  [0x00000182]  Extended opcode 2: set Address to 0x6f8
  [0x0000018d]  Advance Line by 2 to 56
  [0x0000018f]  Copy
  [0x00000190]  Extended opcode 2: set Address to 0x704
  [0x0000019b]  Advance Line by 1 to 57
  [0x0000019d]  Copy
  [0x0000019e]  Extended opcode 1: End of Sequence



[-- Attachment #5: dw2-ranges-func-lo-cold.L --]
[-- Type: text/plain, Size: 1706 bytes --]

Contents of the .debug_line section:

dw2-ranges-func-lo-cold.c:
File name                            Line number    Starting address    View
dw2-ranges-func-lo-cold.c                     76               0x73c
dw2-ranges-func-lo-cold.c                     78               0x744
dw2-ranges-func-lo-cold.c                     80               0x748
dw2-ranges-func-lo-cold.c                     82               0x754
dw2-ranges-func-lo-cold.c                     82               0x754       1

dw2-ranges-func-lo-cold.c                     66               0x70c
dw2-ranges-func-lo-cold.c                     68               0x714
dw2-ranges-func-lo-cold.c                     70               0x718
dw2-ranges-func-lo-cold.c                     72               0x730
dw2-ranges-func-lo-cold.c                     73               0x73c
dw2-ranges-func-lo-cold.c                     73               0x73c       1

dw2-ranges-func-lo-cold.c                     62               0x704
dw2-ranges-func-lo-cold.c                     63               0x70c
dw2-ranges-func-lo-cold.c                     63               0x70c       1

dw2-ranges-func-lo-cold.c                     48               0x6e4
dw2-ranges-func-lo-cold.c                     49               0x6ec
dw2-ranges-func-lo-cold.c                     49               0x6ec       1

dw2-ranges-func-lo-cold.c                     52               0x6ec
dw2-ranges-func-lo-cold.c                     54               0x6f4
dw2-ranges-func-lo-cold.c                     56               0x6f8
dw2-ranges-func-lo-cold.c                     57               0x704
dw2-ranges-func-lo-cold.c                     57               0x704       1



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v3 2/2] Fix an undefined behavior in record_line
  2020-04-04 16:22           ` Luis Machado
@ 2020-04-04 16:34             ` Bernd Edlinger
  2020-04-04 22:55               ` Andrew Burgess
  0 siblings, 1 reply; 18+ messages in thread
From: Bernd Edlinger @ 2020-04-04 16:34 UTC (permalink / raw)
  To: Luis Machado, gdb-patches, Andrew Burgess

Okay, I think I see what is wrong.

 Line Number Statements:
  [0x000000b4]  Extended opcode 2: set Address to 0x73c
  [0x000000bf]  Advance Line by 75 to 76
  [0x000000c2]  Copy

....

  [0x00000129]  Extended opcode 2: set Address to 0x73c
  [0x00000134]  Advance Line by 1 to 73
  [0x00000136]  Copy
  [0x00000137]  Extended opcode 1: End of Sequence

so the second line was previously deleted,
but now it is a non-is-stmt line.
The address is the same,

There was previously a discussion that two consecutive line-entries are a
rogue method to notify the debugger of where the end of header is.
I don't recall in the moment where this code is located.
But if someone could point out the place to me, I could
probably add code to ignore non-is-stmt lines,

Andrew, are you already on that target, with one of your patches from
yesterday? 


Thanks
Bernd.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v3 2/2] Fix an undefined behavior in record_line
  2020-04-04 16:34             ` Bernd Edlinger
@ 2020-04-04 22:55               ` Andrew Burgess
  2020-04-05  0:12                 ` Bernd Edlinger
  0 siblings, 1 reply; 18+ messages in thread
From: Andrew Burgess @ 2020-04-04 22:55 UTC (permalink / raw)
  To: Bernd Edlinger; +Cc: Luis Machado, gdb-patches

* Bernd Edlinger <bernd.edlinger@hotmail.de> [2020-04-04 18:34:07 +0200]:

> Okay, I think I see what is wrong.
> 
>  Line Number Statements:
>   [0x000000b4]  Extended opcode 2: set Address to 0x73c
>   [0x000000bf]  Advance Line by 75 to 76
>   [0x000000c2]  Copy
> 
> ....
> 
>   [0x00000129]  Extended opcode 2: set Address to 0x73c
>   [0x00000134]  Advance Line by 1 to 73
>   [0x00000136]  Copy
>   [0x00000137]  Extended opcode 1: End of Sequence
> 
> so the second line was previously deleted,
> but now it is a non-is-stmt line.
> The address is the same,
> 
> There was previously a discussion that two consecutive line-entries are a
> rogue method to notify the debugger of where the end of header is.
> I don't recall in the moment where this code is located.
> But if someone could point out the place to me, I could
> probably add code to ignore non-is-stmt lines,

It's in symtab.c:skip_prologue_using_sal.

> 
> Andrew, are you already on that target, with one of your patches from
> yesterday?

Not really.  The other aarch64 issue only required me to get a target
started, so I was using the gdbsim.  But this is known to be pretty
iffy, you'd probably have more luck building QEMU and running against
that.

Thanks,
Andrew

> 
> 
> Thanks
> Bernd.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v3 2/2] Fix an undefined behavior in record_line
  2020-03-27  3:50 [PATCH v3 2/2] Fix an undefined behavior in record_line Bernd Edlinger
  2020-04-01 16:23 ` Tom Tromey
  2020-04-03 22:53 ` Luis Machado
@ 2020-04-04 23:03 ` Andrew Burgess
  2020-04-06 17:44   ` Andrew Burgess
  2 siblings, 1 reply; 18+ messages in thread
From: Andrew Burgess @ 2020-04-04 23:03 UTC (permalink / raw)
  To: Bernd Edlinger; +Cc: gdb-patches

* Bernd Edlinger <bernd.edlinger@hotmail.de> [2020-03-27 04:50:29 +0100]:

> Additionally do not completely remove symbols
> at the same PC than the end marker, instead
> make them non-is-stmt breakpoints.
> 
> 2020-03-27  Bernd Edlinger  <bernd.edlinger@hotmail.de>
> 	* buildsym.c (record_line): Fix undefined behavior and preserve
> 	lines at eof.
> ---
>  gdb/buildsym.c | 34 ++++++++++++++++++----------------
>  1 file changed, 18 insertions(+), 16 deletions(-)
> 
> diff --git a/gdb/buildsym.c b/gdb/buildsym.c
> index 2d1e441..46c5bb1 100644
> --- a/gdb/buildsym.c
> +++ b/gdb/buildsym.c
> @@ -705,27 +705,29 @@ struct blockvector *
>  		      * sizeof (struct linetable_entry))));
>      }
>  
> -  /* Normally, we treat lines as unsorted.  But the end of sequence
> -     marker is special.  We sort line markers at the same PC by line
> -     number, so end of sequence markers (which have line == 0) appear
> -     first.  This is right if the marker ends the previous function,
> -     and there is no padding before the next function.  But it is
> -     wrong if the previous line was empty and we are now marking a
> -     switch to a different subfile.  We must leave the end of sequence
> -     marker at the end of this group of lines, not sort the empty line
> -     to after the marker.  The easiest way to accomplish this is to
> -     delete any empty lines from our table, if they are followed by
> -     end of sequence markers.  All we lose is the ability to set
> -     breakpoints at some lines which contain no instructions
> -     anyway.  */
> +  /* The end of sequence marker is special.  We need to reset the
> +     is_stmt flag on previous lines at the same PC, otherwise these
> +     lines may cause problems since they might be at the same address
> +     as the following function.  For instance suppose a function calls
> +     abort there is no reason to emit a ret after that point (no joke).
> +     So the label may be at the same address where the following
> +     function begins.  A similar problem appears if a label is at the
> +     same address where an inline function ends we cannot reliably tell
> +     if this is considered part of the inline function or the calling
> +     program or even the next inline function, so stack traces may
> +     give surprising results.  Expect gdb.cp/step-and-next-inline.exp
> +     to fail if these lines are not modified here.  */

Out of interest I tried reverting this patch and don't see any
failures in gdb.cp/step-and-next-inline.exp.  Could you expand on
which tests specifically you expect to see fail, and maybe which
version of GCC you're using?  I'm on 9.3.1.  It'll be Monday before I
can try my other machine which has a wider selection of compiler
versions.

I also don't understand what part of the previous behaviour was
undefined, could you help me to understand please.

Thanks,
Andrew



>    if (line == 0 && subfile->line_vector->nitems > 0)
>      {
> -      e = subfile->line_vector->item + subfile->line_vector->nitems - 1;
> -      while (subfile->line_vector->nitems > 0 && e->pc == pc)
> +      e = subfile->line_vector->item + subfile->line_vector->nitems;
> +      do
>  	{
>  	  e--;
> -	  subfile->line_vector->nitems--;
> +	  if (e->pc != pc || e->line == 0)
> +	    break;
> +	  e->is_stmt = 0;
>  	}
> +      while (e > subfile->line_vector->item);
>      }
>  
>    e = subfile->line_vector->item + subfile->line_vector->nitems++;
> -- 
> 1.9.1

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v3 2/2] Fix an undefined behavior in record_line
  2020-04-04 22:55               ` Andrew Burgess
@ 2020-04-05  0:12                 ` Bernd Edlinger
  0 siblings, 0 replies; 18+ messages in thread
From: Bernd Edlinger @ 2020-04-05  0:12 UTC (permalink / raw)
  To: Andrew Burgess; +Cc: Luis Machado, gdb-patches



On 4/5/20 12:55 AM, Andrew Burgess wrote:
> * Bernd Edlinger <bernd.edlinger@hotmail.de> [2020-04-04 18:34:07 +0200]:
> 
>> Okay, I think I see what is wrong.
>>
>>  Line Number Statements:
>>   [0x000000b4]  Extended opcode 2: set Address to 0x73c
>>   [0x000000bf]  Advance Line by 75 to 76
>>   [0x000000c2]  Copy
>>
>> ....
>>
>>   [0x00000129]  Extended opcode 2: set Address to 0x73c
>>   [0x00000134]  Advance Line by 1 to 73
>>   [0x00000136]  Copy
>>   [0x00000137]  Extended opcode 1: End of Sequence
>>
>> so the second line was previously deleted,
>> but now it is a non-is-stmt line.
>> The address is the same,
>>
>> There was previously a discussion that two consecutive line-entries are a
>> rogue method to notify the debugger of where the end of header is.
>> I don't recall in the moment where this code is located.
>> But if someone could point out the place to me, I could
>> probably add code to ignore non-is-stmt lines,
> 
> It's in symtab.c:skip_prologue_using_sal.
> 
>>
>> Andrew, are you already on that target, with one of your patches from
>> yesterday?
> 
> Not really.  The other aarch64 issue only required me to get a target
> started, so I was using the gdbsim.  But this is known to be pretty
> iffy, you'd probably have more luck building QEMU and running against
> that.
> 

Yeah, that is on my wish list since a while.

I have no idea how much work it is, I would also be
happy to have an aarch64 QEMU, for testing my openssl
patches, I heard they emulate the full instruction set.


Maybe not today, but what are the necessary steps?


Thanks
Bernd.

> Thanks,
> Andrew
> 
>>
>>
>> Thanks
>> Bernd.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v3 2/2] Fix an undefined behavior in record_line
  2020-04-04 23:03 ` Andrew Burgess
@ 2020-04-06 17:44   ` Andrew Burgess
  2020-04-06 18:48     ` Bernd Edlinger
  0 siblings, 1 reply; 18+ messages in thread
From: Andrew Burgess @ 2020-04-06 17:44 UTC (permalink / raw)
  To: Bernd Edlinger; +Cc: gdb-patches

* Andrew Burgess <andrew.burgess@embecosm.com> [2020-04-05 00:03:27 +0100]:

> * Bernd Edlinger <bernd.edlinger@hotmail.de> [2020-03-27 04:50:29 +0100]:
> 
> > Additionally do not completely remove symbols
> > at the same PC than the end marker, instead
> > make them non-is-stmt breakpoints.
> > 
> > 2020-03-27  Bernd Edlinger  <bernd.edlinger@hotmail.de>
> > 	* buildsym.c (record_line): Fix undefined behavior and preserve
> > 	lines at eof.
> > ---
> >  gdb/buildsym.c | 34 ++++++++++++++++++----------------
> >  1 file changed, 18 insertions(+), 16 deletions(-)
> > 
> > diff --git a/gdb/buildsym.c b/gdb/buildsym.c
> > index 2d1e441..46c5bb1 100644
> > --- a/gdb/buildsym.c
> > +++ b/gdb/buildsym.c
> > @@ -705,27 +705,29 @@ struct blockvector *
> >  		      * sizeof (struct linetable_entry))));
> >      }
> >  
> > -  /* Normally, we treat lines as unsorted.  But the end of sequence
> > -     marker is special.  We sort line markers at the same PC by line
> > -     number, so end of sequence markers (which have line == 0) appear
> > -     first.  This is right if the marker ends the previous function,
> > -     and there is no padding before the next function.  But it is
> > -     wrong if the previous line was empty and we are now marking a
> > -     switch to a different subfile.  We must leave the end of sequence
> > -     marker at the end of this group of lines, not sort the empty line
> > -     to after the marker.  The easiest way to accomplish this is to
> > -     delete any empty lines from our table, if they are followed by
> > -     end of sequence markers.  All we lose is the ability to set
> > -     breakpoints at some lines which contain no instructions
> > -     anyway.  */
> > +  /* The end of sequence marker is special.  We need to reset the
> > +     is_stmt flag on previous lines at the same PC, otherwise these
> > +     lines may cause problems since they might be at the same address
> > +     as the following function.  For instance suppose a function calls
> > +     abort there is no reason to emit a ret after that point (no joke).
> > +     So the label may be at the same address where the following
> > +     function begins.  A similar problem appears if a label is at the
> > +     same address where an inline function ends we cannot reliably tell
> > +     if this is considered part of the inline function or the calling
> > +     program or even the next inline function, so stack traces may
> > +     give surprising results.  Expect gdb.cp/step-and-next-inline.exp
> > +     to fail if these lines are not modified here.  */
> 
> Out of interest I tried reverting this patch and don't see any
> failures in gdb.cp/step-and-next-inline.exp.  Could you expand on
> which tests specifically you expect to see fail, and maybe which
> version of GCC you're using?  I'm on 9.3.1.  It'll be Monday before I
> can try my other machine which has a wider selection of compiler
> versions.
> 
> I also don't understand what part of the previous behaviour was
> undefined, could you help me to understand please.

I reverted this patch and tested with GCC versions:

  10.x - from 2020-02-05 - no regressions,
  9.3.1 - (from previous) - no regressions,
  9.2.0 - no regressions,
  8.3.0 - no regressions,
  7.4.0 - doesn't compile as the compiler doesn't support
          '-gstatement-frontiers.'.

The 7.4.0 result seems to indicate that the test doesn't apply for
compilers before then.

So, what exactly does this patch fix?  Or what new functionality does
it bring to GDB?  Or what version of GCC should I use and expect to
see a difference in the test results?

Thanks,
Andrew




> 
> Thanks,
> Andrew
> 
> 
> 
> >    if (line == 0 && subfile->line_vector->nitems > 0)
> >      {
> > -      e = subfile->line_vector->item + subfile->line_vector->nitems - 1;
> > -      while (subfile->line_vector->nitems > 0 && e->pc == pc)
> > +      e = subfile->line_vector->item + subfile->line_vector->nitems;
> > +      do
> >  	{
> >  	  e--;
> > -	  subfile->line_vector->nitems--;
> > +	  if (e->pc != pc || e->line == 0)
> > +	    break;
> > +	  e->is_stmt = 0;
> >  	}
> > +      while (e > subfile->line_vector->item);
> >      }
> >  
> >    e = subfile->line_vector->item + subfile->line_vector->nitems++;
> > -- 
> > 1.9.1

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v3 2/2] Fix an undefined behavior in record_line
  2020-04-06 17:44   ` Andrew Burgess
@ 2020-04-06 18:48     ` Bernd Edlinger
  0 siblings, 0 replies; 18+ messages in thread
From: Bernd Edlinger @ 2020-04-06 18:48 UTC (permalink / raw)
  To: Andrew Burgess; +Cc: gdb-patches

Hi Andrew,

On 4/6/20 7:44 PM, Andrew Burgess wrote:
> * Andrew Burgess <andrew.burgess@embecosm.com> [2020-04-05 00:03:27 +0100]:
> 

Hmm, I overlooked this mail in my inbox.  Sorry, I had a very
difficul discussion with Linus Torvalds at that weekend.  So I was not
able to look at all messages, and this one dropped. Sorry for that.

>> * Bernd Edlinger <bernd.edlinger@hotmail.de> [2020-03-27 04:50:29 +0100]:
>>
>>> Additionally do not completely remove symbols
>>> at the same PC than the end marker, instead
>>> make them non-is-stmt breakpoints.
>>>
>>> 2020-03-27  Bernd Edlinger  <bernd.edlinger@hotmail.de>
>>> 	* buildsym.c (record_line): Fix undefined behavior and preserve
>>> 	lines at eof.
>>> ---
>>>  gdb/buildsym.c | 34 ++++++++++++++++++----------------
>>>  1 file changed, 18 insertions(+), 16 deletions(-)
>>>
>>> diff --git a/gdb/buildsym.c b/gdb/buildsym.c
>>> index 2d1e441..46c5bb1 100644
>>> --- a/gdb/buildsym.c
>>> +++ b/gdb/buildsym.c
>>> @@ -705,27 +705,29 @@ struct blockvector *
>>>  		      * sizeof (struct linetable_entry))));
>>>      }
>>>  
>>> -  /* Normally, we treat lines as unsorted.  But the end of sequence
>>> -     marker is special.  We sort line markers at the same PC by line
>>> -     number, so end of sequence markers (which have line == 0) appear
>>> -     first.  This is right if the marker ends the previous function,
>>> -     and there is no padding before the next function.  But it is
>>> -     wrong if the previous line was empty and we are now marking a
>>> -     switch to a different subfile.  We must leave the end of sequence
>>> -     marker at the end of this group of lines, not sort the empty line
>>> -     to after the marker.  The easiest way to accomplish this is to
>>> -     delete any empty lines from our table, if they are followed by
>>> -     end of sequence markers.  All we lose is the ability to set
>>> -     breakpoints at some lines which contain no instructions
>>> -     anyway.  */
>>> +  /* The end of sequence marker is special.  We need to reset the
>>> +     is_stmt flag on previous lines at the same PC, otherwise these
>>> +     lines may cause problems since they might be at the same address
>>> +     as the following function.  For instance suppose a function calls
>>> +     abort there is no reason to emit a ret after that point (no joke).
>>> +     So the label may be at the same address where the following
>>> +     function begins.  A similar problem appears if a label is at the
>>> +     same address where an inline function ends we cannot reliably tell
>>> +     if this is considered part of the inline function or the calling
>>> +     program or even the next inline function, so stack traces may
>>> +     give surprising results.  Expect gdb.cp/step-and-next-inline.exp
>>> +     to fail if these lines are not modified here.  */
>>
>> Out of interest I tried reverting this patch and don't see any
>> failures in gdb.cp/step-and-next-inline.exp.  Could you expand on
>> which tests specifically you expect to see fail, and maybe which
>> version of GCC you're using?  I'm on 9.3.1.  It'll be Monday before I
>> can try my other machine which has a wider selection of compiler
>> versions.
>>
>> I also don't understand what part of the previous behaviour was
>> undefined, could you help me to understand please.

Sorry, as I said, I overlooked this mail, I am rather under stress,
since I have to take precautions for my safety and my family all the time,
you know we have a corona pandemic out there.

It is decrementing e before the beginning of the array, that is undefined.

The code before, with the undefined behavior was this:

      e = subfile->line_vector->item + subfile->line_vector->nitems - 1;
      while (subfile->line_vector->nitems > 0 && e->pc == pc)
        {
          e--;
          subfile->line_vector->nitems--;
        }

So when you start e = pointer + nitems - 1;
decrement each time e and nitems by one.
and the exit condition is nitems > 0 or e -> pc == pc.
What happens when there is no element with pc == pc,
then the exit condition is when nitems = 0 and e = pointer - 1;
since e is now before the beginning of the array, gcc can
assume you guarantee that this undefined behavior is not happening
so you guarantee the e-> pc == pc is the only exit condition where
no undefined behavior happens.

so gcc can and will transform that loop to:

      e = subfile->line_vector->item + subfile->line_vector->nitems - 1;
      while (e->pc == pc)
        {
          e--;
          subfile->line_vector->nitems--;
        }

That has already happened, in the gmp test suite if I remember correctly.

> 
> I reverted this patch and tested with GCC versions:
> 

That part of the patch was a gratuitous fix, I have been testing it twice
before committing, but since Luis notified me of the regression in aarch64
I became aware that changing the is-stmt bits causes real problems and I
wanted to fix that with the other patch, but I can also make that an extra
patch, if that is necessary.

>   10.x - from 2020-02-05 - no regressions,
>   9.3.1 - (from previous) - no regressions,
>   9.2.0 - no regressions,
>   8.3.0 - no regressions,
>   7.4.0 - doesn't compile as the compiler doesn't support
>           '-gstatement-frontiers.'.
> 
> The 7.4.0 result seems to indicate that the test doesn't apply for
> compilers before then.
> 
> So, what exactly does this patch fix?  Or what new functionality does
> it bring to GDB?  Or what version of GCC should I use and expect to
> see a difference in the test results?
> 

Undefined behavior, and I need to really remove the lines at the
end of the function.  That behavior we need to restore.

I would like to not do the destructive step when the cu changes,
that is probably wrong, and causes the missing lines that your other
patch is trying to fix.


Thanks,
Bernd.


PS: what is T-J-Teru ?

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2020-04-06 18:48 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-27  3:50 [PATCH v3 2/2] Fix an undefined behavior in record_line Bernd Edlinger
2020-04-01 16:23 ` Tom Tromey
2020-04-01 16:52   ` Bernd Edlinger
2020-04-01 18:40     ` Bernd Edlinger
2020-04-01 18:53       ` Tom Tromey
2020-04-01 19:01         ` Bernd Edlinger
2020-04-03 22:53 ` Luis Machado
2020-04-04  4:21   ` Bernd Edlinger
2020-04-04  7:06     ` Bernd Edlinger
2020-04-04 13:56       ` Luis Machado
2020-04-04 16:06         ` Bernd Edlinger
2020-04-04 16:22           ` Luis Machado
2020-04-04 16:34             ` Bernd Edlinger
2020-04-04 22:55               ` Andrew Burgess
2020-04-05  0:12                 ` Bernd Edlinger
2020-04-04 23:03 ` Andrew Burgess
2020-04-06 17:44   ` Andrew Burgess
2020-04-06 18:48     ` Bernd Edlinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).