* RFA: test macro expansion in presence of #line directives
@ 2002-11-06 9:35 Jim Blandy
2002-11-06 9:42 ` Daniel Jacobowitz
2002-11-06 12:31 ` Jim Blandy
0 siblings, 2 replies; 5+ messages in thread
From: Jim Blandy @ 2002-11-06 9:35 UTC (permalink / raw)
To: gdb-patches
gdb/testsuite/ChangeLog:
2002-11-01 Jim Blandy <jimb@redhat.com>
* gdb.base/step-line.exp: Check that GDB can handle filenames that
appear in the line number info, but not in the preprocessor macro
info.
Index: gdb/testsuite/gdb.base/step-line.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/step-line.exp,v
retrieving revision 1.1
diff -c -r1.1 step-line.exp
*** gdb/testsuite/gdb.base/step-line.exp 27 Mar 2001 01:32:45 -0000 1.1
--- gdb/testsuite/gdb.base/step-line.exp 1 Nov 2002 20:30:25 -0000
***************
*** 53,58 ****
--- 53,94 ----
gdb_test "next" \
".*i = f2 \\(i\\);.*" \
"next over dummy 1"
+
+ # As of Oct 2002, GCC does record the effect of #line directives in
+ # the source line info, but not in macro info. This means that GDB's
+ # symtabs (built from the former, among other things) may mention
+ # filenames that GDB's macro tables (built from the latter) don't have
+ # any record of. Make sure GDB can handle this by trying to evaluate
+ # an expression, which will do a macro expansion.
+ send_gdb "print i\n"
+ gdb_expect {
+ -re ".* = 4.*$gdb_prompt $" {
+ pass "macro-expand expression after #line directive"
+ }
+ -re ".*A problem internal to GDB has been detected.*Quit this debugging session\\? \\(y or n\\) $" {
+ send_gdb "n\n"
+ gdb_expect {
+ -re "Create a core file of GDB\\? \\(y or n\\) $" {
+ }
+ timeout {
+ fail "resync after #line failure (timeout)"
+ }
+ }
+ send_gdb "n\n"
+ gdb_expect {
+ -re "$gdb_prompt $" {
+ }
+ timeout {
+ fail "resync after #line failure (timeout)"
+ }
+ }
+ fail "macro-expand expression after #line directive"
+ }
+ timeout {
+ fail "macro-expand expression after #line directive (timeout)"
+ }
+ }
+
gdb_test "next" \
".*dummy \\(2, i\\);.*" \
"next to dummy 2"
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: RFA: test macro expansion in presence of #line directives
2002-11-06 9:35 RFA: test macro expansion in presence of #line directives Jim Blandy
@ 2002-11-06 9:42 ` Daniel Jacobowitz
2002-11-06 9:48 ` Jim Blandy
2002-11-06 12:31 ` Jim Blandy
1 sibling, 1 reply; 5+ messages in thread
From: Daniel Jacobowitz @ 2002-11-06 9:42 UTC (permalink / raw)
To: Jim Blandy; +Cc: gdb-patches
On Wed, Nov 06, 2002 at 12:20:54PM -0500, Jim Blandy wrote:
>
> gdb/testsuite/ChangeLog:
> 2002-11-01 Jim Blandy <jimb@redhat.com>
>
> * gdb.base/step-line.exp: Check that GDB can handle filenames that
> appear in the line number info, but not in the preprocessor macro
> info.
Can I suggest adding the internal-error handling to gdb_test instead?
It would be useful elsewhere.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: RFA: test macro expansion in presence of #line directives
2002-11-06 9:42 ` Daniel Jacobowitz
@ 2002-11-06 9:48 ` Jim Blandy
0 siblings, 0 replies; 5+ messages in thread
From: Jim Blandy @ 2002-11-06 9:48 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: gdb-patches
Daniel Jacobowitz <drow@mvista.com> writes:
> On Wed, Nov 06, 2002 at 12:20:54PM -0500, Jim Blandy wrote:
> >
> > gdb/testsuite/ChangeLog:
> > 2002-11-01 Jim Blandy <jimb@redhat.com>
> >
> > * gdb.base/step-line.exp: Check that GDB can handle filenames that
> > appear in the line number info, but not in the preprocessor macro
> > info.
>
> Can I suggest adding the internal-error handling to gdb_test instead?
> It would be useful elsewhere.
Yes, that's a good suggestion.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: RFA: test macro expansion in presence of #line directives
2002-11-06 9:35 RFA: test macro expansion in presence of #line directives Jim Blandy
2002-11-06 9:42 ` Daniel Jacobowitz
@ 2002-11-06 12:31 ` Jim Blandy
2002-11-21 23:01 ` Jim Blandy
1 sibling, 1 reply; 5+ messages in thread
From: Jim Blandy @ 2002-11-06 12:31 UTC (permalink / raw)
To: gdb-patches
Here's a revision of this test, which depends on the addition of the
gdb_internal_error_resync function and its use in gdb_test, done in
the previous patch.
gdb/testsuite/ChangeLog:
2002-11-01 Jim Blandy <jimb@redhat.com>
* gdb.base/step-line.exp: Check that GDB can handle filenames that
appear in the line number info, but not in the preprocessor macro
info.
Index: gdb/testsuite/gdb.base/step-line.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/step-line.exp,v
retrieving revision 1.1
diff -c -r1.1 step-line.exp
*** gdb/testsuite/gdb.base/step-line.exp 27 Mar 2001 01:32:45 -0000 1.1
--- gdb/testsuite/gdb.base/step-line.exp 6 Nov 2002 20:23:19 -0000
***************
*** 53,58 ****
--- 53,67 ----
gdb_test "next" \
".*i = f2 \\(i\\);.*" \
"next over dummy 1"
+
+ # As of Oct 2002, GCC does record the effect of #line directives in
+ # the source line info, but not in macro info. This means that GDB's
+ # symtabs (built from the former, among other things) may mention
+ # filenames that GDB's macro tables (built from the latter) don't have
+ # any record of. Make sure GDB can handle this by trying to evaluate
+ # an expression, which will do a macro expansion.
+ gdb_test "print i" ".* = 4.*"
+
gdb_test "next" \
".*dummy \\(2, i\\);.*" \
"next to dummy 2"
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: RFA: test macro expansion in presence of #line directives
2002-11-06 12:31 ` Jim Blandy
@ 2002-11-21 23:01 ` Jim Blandy
0 siblings, 0 replies; 5+ messages in thread
From: Jim Blandy @ 2002-11-21 23:01 UTC (permalink / raw)
To: gdb-patches
I've committed this.
Jim Blandy <jimb@redhat.com> writes:
> Here's a revision of this test, which depends on the addition of the
> gdb_internal_error_resync function and its use in gdb_test, done in
> the previous patch.
>
> gdb/testsuite/ChangeLog:
> 2002-11-01 Jim Blandy <jimb@redhat.com>
>
> * gdb.base/step-line.exp: Check that GDB can handle filenames that
> appear in the line number info, but not in the preprocessor macro
> info.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2002-11-22 7:01 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-06 9:35 RFA: test macro expansion in presence of #line directives Jim Blandy
2002-11-06 9:42 ` Daniel Jacobowitz
2002-11-06 9:48 ` Jim Blandy
2002-11-06 12:31 ` Jim Blandy
2002-11-21 23:01 ` Jim Blandy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox