This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] gdb: Catch exceptions if the source file is not found
- From: Shahab Vahedi <shahab dot vahedi at gmail dot com>
- To: Andrew Burgess <andrew dot burgess at embecosm dot com>
- Cc: gdb-patches at sourceware dot org, Shahab Vahedi <shahab at synopsys dot com>, Tom Tromey <tom at tromey dot com>, Claudiu Zissulescu <claziss at synopsys dot com>, Francois Bedard <fbedard at synopsys dot com>
- Date: Wed, 22 Jan 2020 17:32:17 +0100
- Subject: Re: [PATCH] gdb: Catch exceptions if the source file is not found
- References: <20200122140818.84308-1-shahab.vahedi@gmail.com> <20200122154901.GK3865@embecosm.com>
On Wed, Jan 22, 2020 at 03:49:01PM +0000, Andrew Burgess wrote:
>
> Would it be possible to create a version of this test (or similar)
> within gdb.tui/ so this fix would be protected in the future?
>
This is reproducible on an x86_64 host/target as well. These are
the necessary step that I have to automate by a test:
$ cat > file1.c <<EOF
extern int func2(int);
int main()
{
int a = 4;
return func2(a);
}
EOF
$ cat > file2.c <<EOF
int func2(int x)
{
x <<= 1;
return x+5;
}
EOF
$ gcc -g file1.c file2.c -o test
$ mv file1.c file1.c.moved
$ gdb -tui test.c
(gdb) start
(gdb) next
(gdb) step
at this point we should see func2 in source window.
It is just a matter of time for me to write my _first_ test.
If the changes are OK, I will submit the test in a separate
patch if you don't mind. I just don't want this fix fall
through the cracks as apparently it did once according to
Tom.
Cheers,
Shahab