Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA] testsuite gdb.base/expand-psymtabs: ensure code is generated  for the expected source line
@ 2008-12-08 15:25 Christophe LYON
  2008-12-10 17:29 ` Carlos Eduardo Seo
  2008-12-16  6:29 ` Joel Brobecker
  0 siblings, 2 replies; 7+ messages in thread
From: Christophe LYON @ 2008-12-08 15:25 UTC (permalink / raw)
  To: gdb-patches

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

Hi all,

I propose the attached small patch to expand-psymtabs.c. The goal is to 
make sure the compiler actually generates code and debug information for 
the expected line. Currently, our compiler attaches code only to the 
opening brace, hence causing the test to fail.

Christophe.

[-- Attachment #2: ChangeLog --]
[-- Type: text/plain, Size: 179 bytes --]

2008-12-08  Christophe Lyon  <christophe.lyon@st.com>

	* gdb.base/expand-psymtabs.c: Insert code in foo so that the
	compiler actually generate code at the expected line number.

[-- Attachment #3: patch --]
[-- Type: text/plain, Size: 409 bytes --]

Index: src/gdb/testsuite/gdb.base/expand-psymtabs.c
===================================================================
--- src/gdb/testsuite/gdb.base/expand-psymtabs.c	(revision 308)
+++ src/gdb/testsuite/gdb.base/expand-psymtabs.c	(working copy)
@@ -27,9 +27,14 @@ main (void)
 
 #else
 void
+bar (void)
+  {
+  }
+
+void
 foo (void)
   {
-    /* Break here  */
+    bar(); /* Break here  */
   }
 
 #endif

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

* Re: [RFA] testsuite gdb.base/expand-psymtabs: ensure code is generated  for the expected source line
  2008-12-08 15:25 [RFA] testsuite gdb.base/expand-psymtabs: ensure code is generated for the expected source line Christophe LYON
@ 2008-12-10 17:29 ` Carlos Eduardo Seo
  2008-12-11  8:50   ` Christophe LYON
  2008-12-15 12:02   ` Christophe LYON
  2008-12-16  6:29 ` Joel Brobecker
  1 sibling, 2 replies; 7+ messages in thread
From: Carlos Eduardo Seo @ 2008-12-10 17:29 UTC (permalink / raw)
  To: Christophe LYON; +Cc: gdb-patches

Christophe LYON wrote:
> I propose the attached small patch to expand-psymtabs.c. The goal is to
> make sure the compiler actually generates code and debug information for
> the expected line. Currently, our compiler attaches code only to the
> opening brace, hence causing the test to fail.
> 

Just curious... which compiler are you using?

gcc generates the right code for the purpose of the test using both
(patched and unpatched) testcases. So, if everyone else agrees, I'm fine
with your modification.

Regards,

-- 
Carlos Eduardo Seo
Software Engineer
IBM Linux Technology Center


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

* Re: [RFA] testsuite gdb.base/expand-psymtabs: ensure code is generated  for the expected source line
  2008-12-10 17:29 ` Carlos Eduardo Seo
@ 2008-12-11  8:50   ` Christophe LYON
  2008-12-15 12:02   ` Christophe LYON
  1 sibling, 0 replies; 7+ messages in thread
From: Christophe LYON @ 2008-12-11  8:50 UTC (permalink / raw)
  To: Carlos Eduardo Seo; +Cc: gdb-patches

On 10.12.2008 18:28, Carlos Eduardo Seo wrote:
> Christophe LYON wrote:
>> I propose the attached small patch to expand-psymtabs.c. The goal is to
>> make sure the compiler actually generates code and debug information for
>> the expected line. Currently, our compiler attaches code only to the
>> opening brace, hence causing the test to fail.
>>
> 
> Just curious... which compiler are you using?
> 
> gcc generates the right code for the purpose of the test using both
> (patched and unpatched) testcases. So, if everyone else agrees, I'm fine
> with your modification.
> 
> Regards,
> 

We are using Open64. Its front-end is based on GCC but the "trees" are 
converted into Whirl (Open64 Internal Representation) rather early.

We have ported it to internal targets, and on a few occasions, I already 
submitted this kind of small patches.

Christophe.


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

* Re: [RFA] testsuite gdb.base/expand-psymtabs: ensure code is generated  for the expected source line
  2008-12-10 17:29 ` Carlos Eduardo Seo
  2008-12-11  8:50   ` Christophe LYON
@ 2008-12-15 12:02   ` Christophe LYON
  1 sibling, 0 replies; 7+ messages in thread
From: Christophe LYON @ 2008-12-15 12:02 UTC (permalink / raw)
  To: Carlos Eduardo Seo; +Cc: gdb-patches

Hi all,

On 10.12.2008 18:28, Carlos Eduardo Seo wrote:
> 
> gcc generates the right code for the purpose of the test using both
> (patched and unpatched) testcases. So, if everyone else agrees, I'm fine
> with your modification.
> 

So, can I consider silence as an approval and commit this small fix?

Thanks

Christophe.


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

* Re: [RFA] testsuite gdb.base/expand-psymtabs: ensure code is generated  for the expected source line
  2008-12-08 15:25 [RFA] testsuite gdb.base/expand-psymtabs: ensure code is generated for the expected source line Christophe LYON
  2008-12-10 17:29 ` Carlos Eduardo Seo
@ 2008-12-16  6:29 ` Joel Brobecker
  2008-12-16 10:28   ` Christophe LYON
  1 sibling, 1 reply; 7+ messages in thread
From: Joel Brobecker @ 2008-12-16  6:29 UTC (permalink / raw)
  To: Christophe LYON; +Cc: gdb-patches

> I propose the attached small patch to expand-psymtabs.c. The goal is to 
> make sure the compiler actually generates code and debug information for 
> the expected line. Currently, our compiler attaches code only to the 
> opening brace, hence causing the test to fail.

Does you compiler also attach the epilogue code to the opening brace
as well.  With GCC, the epilogue is attached to the closing brace,
and so breaking on the empty line causes the breakpoint to be inserted
at the beginning of the epilogue.

> 2008-12-08  Christophe Lyon  <christophe.lyon@st.com>
> 
> 	* gdb.base/expand-psymtabs.c: Insert code in foo so that the
> 	compiler actually generate code at the expected line number.

Seems harmless in any case, and in fact, the original version of
the testcase when submitted included a function call at this location.
The reason why it was removed was that it was calling an IO function,
which is a no-no if we can avoid it (so that the testcase can be run
on targets that do not provide these routines).

OK to check in.

-- 
Joel


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

* Re: [RFA] testsuite gdb.base/expand-psymtabs: ensure code is generated   for the expected source line
  2008-12-16  6:29 ` Joel Brobecker
@ 2008-12-16 10:28   ` Christophe LYON
  2008-12-16 13:19     ` Denis PILAT
  0 siblings, 1 reply; 7+ messages in thread
From: Christophe LYON @ 2008-12-16 10:28 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: gdb-patches

On 16.12.2008 07:28, Joel Brobecker wrote:
>> I propose the attached small patch to expand-psymtabs.c. The goal is to 
>> make sure the compiler actually generates code and debug information for 
>> the expected line. Currently, our compiler attaches code only to the 
>> opening brace, hence causing the test to fail.
> 
> Does you compiler also attach the epilogue code to the opening brace
> as well.  With GCC, the epilogue is attached to the closing brace,
> and so breaking on the empty line causes the breakpoint to be inserted
> at the beginning of the epilogue.
> 

Yes, with an empty function, all the code is attached to the opening brace.

>> 2008-12-08  Christophe Lyon  <christophe.lyon@st.com>
>>
>> 	* gdb.base/expand-psymtabs.c: Insert code in foo so that the
>> 	compiler actually generate code at the expected line number.
> 
> Seems harmless in any case, and in fact, the original version of
> the testcase when submitted included a function call at this location.
> The reason why it was removed was that it was calling an IO function,
> which is a no-no if we can avoid it (so that the testcase can be run
> on targets that do not provide these routines).
> 
> OK to check in.
> 

Thanks. I'll ask Denis Pilat to check it in on my behalf.

Christophe.


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

* Re: [RFA] testsuite gdb.base/expand-psymtabs: ensure code is generated    for the expected source line
  2008-12-16 10:28   ` Christophe LYON
@ 2008-12-16 13:19     ` Denis PILAT
  0 siblings, 0 replies; 7+ messages in thread
From: Denis PILAT @ 2008-12-16 13:19 UTC (permalink / raw)
  To: Christophe LYON; +Cc: Joel Brobecker, gdb-patches


>>
>>
>> OK to check in.
>>
>
> Thanks. I'll ask Denis Pilat to check it in on my behalf.
>
> Christophe.
>
Just done !
-- 
Denis


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

end of thread, other threads:[~2008-12-16 13:19 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-08 15:25 [RFA] testsuite gdb.base/expand-psymtabs: ensure code is generated for the expected source line Christophe LYON
2008-12-10 17:29 ` Carlos Eduardo Seo
2008-12-11  8:50   ` Christophe LYON
2008-12-15 12:02   ` Christophe LYON
2008-12-16  6:29 ` Joel Brobecker
2008-12-16 10:28   ` Christophe LYON
2008-12-16 13:19     ` Denis PILAT

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox