* RFA: fix start symbol matching again
@ 2001-12-18 23:09 Jim Blandy
2001-12-19 9:50 ` Michael Snyder
2002-01-17 16:18 ` Jim Blandy
0 siblings, 2 replies; 3+ messages in thread
From: Jim Blandy @ 2001-12-18 23:09 UTC (permalink / raw)
To: gdb-patches
If the comment isn't clear, let me know. It's a little late, and I'm
not writing very well.
2001-12-19 Jim Blandy <jimb@redhat.com>
* gdb.asm/asm-source.exp (info symbol): Take another shot at
anchoring the pattern matching the entry point symbol's name.
Index: gdb/testsuite/gdb.asm/asm-source.exp
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/testsuite/gdb.asm/asm-source.exp,v
retrieving revision 1.24
diff -c -r1.24 asm-source.exp
*** gdb/testsuite/gdb.asm/asm-source.exp 2001/12/17 14:57:49 1.24
--- gdb/testsuite/gdb.asm/asm-source.exp 2001/12/19 07:06:11
***************
*** 159,171 ****
set entry_symbol ""
send_gdb "info symbol 0x$entry_point\n"
gdb_expect {
! -re "info symbol 0x$entry_point\[\r\n\]*" {
! exp_continue
! }
! -re "^(.*) in section .*$gdb_prompt $" {
! # It's important to anchor the pattern above at the beginning
! # of the line. Without that carat, the (.*) may end up
! # matching the empty string.
set entry_symbol $expect_out(1,string)
pass "info symbol"
}
--- 159,172 ----
set entry_symbol ""
send_gdb "info symbol 0x$entry_point\n"
gdb_expect {
! -re "info symbol 0x$entry_point\[\r\n\]+(\[^\r\n\]*) in section .*$gdb_prompt $" {
! # We match the echoed `info symbol' command here, to help us
! # reliably identify the beginning of the start symbol in its
! # output. We have to start matching exactly at the beginning
! # of the line, no earlier or later. You might think we could
! # just use '^', but unfortunately, in expect, '^' matches the
! # beginning of the unmatched input, not necessarily the
! # beginning of a line.
set entry_symbol $expect_out(1,string)
pass "info symbol"
}
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: RFA: fix start symbol matching again
2001-12-18 23:09 RFA: fix start symbol matching again Jim Blandy
@ 2001-12-19 9:50 ` Michael Snyder
2002-01-17 16:18 ` Jim Blandy
1 sibling, 0 replies; 3+ messages in thread
From: Michael Snyder @ 2001-12-19 9:50 UTC (permalink / raw)
To: Jim Blandy; +Cc: gdb-patches
Jim Blandy wrote:
>
> If the comment isn't clear, let me know. It's a little late, and I'm
> not writing very well.
At this point, I'm kinda unclear on what problem you're fixing;
but if it's this difficult, we could just make the $START symbol
a configurable variable. Default it to "_start" but allow it to
be set to "start" by such target architectures as need to do so.
>
> 2001-12-19 Jim Blandy <jimb@redhat.com>
>
> * gdb.asm/asm-source.exp (info symbol): Take another shot at
> anchoring the pattern matching the entry point symbol's name.
>
> Index: gdb/testsuite/gdb.asm/asm-source.exp
> ===================================================================
> RCS file: /cvs/cvsfiles/devo/gdb/testsuite/gdb.asm/asm-source.exp,v
> retrieving revision 1.24
> diff -c -r1.24 asm-source.exp
> *** gdb/testsuite/gdb.asm/asm-source.exp 2001/12/17 14:57:49 1.24
> --- gdb/testsuite/gdb.asm/asm-source.exp 2001/12/19 07:06:11
> ***************
> *** 159,171 ****
> set entry_symbol ""
> send_gdb "info symbol 0x$entry_point\n"
> gdb_expect {
> ! -re "info symbol 0x$entry_point\[\r\n\]*" {
> ! exp_continue
> ! }
> ! -re "^(.*) in section .*$gdb_prompt $" {
> ! # It's important to anchor the pattern above at the beginning
> ! # of the line. Without that carat, the (.*) may end up
> ! # matching the empty string.
> set entry_symbol $expect_out(1,string)
> pass "info symbol"
> }
> --- 159,172 ----
> set entry_symbol ""
> send_gdb "info symbol 0x$entry_point\n"
> gdb_expect {
> ! -re "info symbol 0x$entry_point\[\r\n\]+(\[^\r\n\]*) in section .*$gdb_prompt $" {
> ! # We match the echoed `info symbol' command here, to help us
> ! # reliably identify the beginning of the start symbol in its
> ! # output. We have to start matching exactly at the beginning
> ! # of the line, no earlier or later. You might think we could
> ! # just use '^', but unfortunately, in expect, '^' matches the
> ! # beginning of the unmatched input, not necessarily the
> ! # beginning of a line.
> set entry_symbol $expect_out(1,string)
> pass "info symbol"
> }
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: RFA: fix start symbol matching again
2001-12-18 23:09 RFA: fix start symbol matching again Jim Blandy
2001-12-19 9:50 ` Michael Snyder
@ 2002-01-17 16:18 ` Jim Blandy
1 sibling, 0 replies; 3+ messages in thread
From: Jim Blandy @ 2002-01-17 16:18 UTC (permalink / raw)
To: gdb-patches
I've committed this change, with a comment that explains what the
issue is. Expect can be made to behave predictably; the old code just
doesn't do that.
Jim Blandy <jimb@cygnus.com> writes:
> If the comment isn't clear, let me know. It's a little late, and I'm
> not writing very well.
>
> 2001-12-19 Jim Blandy <jimb@redhat.com>
>
> * gdb.asm/asm-source.exp (info symbol): Take another shot at
> anchoring the pattern matching the entry point symbol's name.
>
> Index: gdb/testsuite/gdb.asm/asm-source.exp
> ===================================================================
> RCS file: /cvs/cvsfiles/devo/gdb/testsuite/gdb.asm/asm-source.exp,v
> retrieving revision 1.24
> diff -c -r1.24 asm-source.exp
> *** gdb/testsuite/gdb.asm/asm-source.exp 2001/12/17 14:57:49 1.24
> --- gdb/testsuite/gdb.asm/asm-source.exp 2001/12/19 07:06:11
> ***************
> *** 159,171 ****
> set entry_symbol ""
> send_gdb "info symbol 0x$entry_point\n"
> gdb_expect {
> ! -re "info symbol 0x$entry_point\[\r\n\]*" {
> ! exp_continue
> ! }
> ! -re "^(.*) in section .*$gdb_prompt $" {
> ! # It's important to anchor the pattern above at the beginning
> ! # of the line. Without that carat, the (.*) may end up
> ! # matching the empty string.
> set entry_symbol $expect_out(1,string)
> pass "info symbol"
> }
> --- 159,172 ----
> set entry_symbol ""
> send_gdb "info symbol 0x$entry_point\n"
> gdb_expect {
> ! -re "info symbol 0x$entry_point\[\r\n\]+(\[^\r\n\]*) in section .*$gdb_prompt $" {
> ! # We match the echoed `info symbol' command here, to help us
> ! # reliably identify the beginning of the start symbol in its
> ! # output. We have to start matching exactly at the beginning
> ! # of the line, no earlier or later. You might think we could
> ! # just use '^', but unfortunately, in expect, '^' matches the
> ! # beginning of the unmatched input, not necessarily the
> ! # beginning of a line.
> set entry_symbol $expect_out(1,string)
> pass "info symbol"
> }
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2002-01-18 0:18 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-12-18 23:09 RFA: fix start symbol matching again Jim Blandy
2001-12-19 9:50 ` Michael Snyder
2002-01-17 16:18 ` Jim Blandy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox