This is the mail archive of the
gdb-prs@sources.redhat.com
mailing list for the GDB project.
cli/1621: "edit" command for unknown source file
- From: kraftche at cae dot wisc dot edu
- To: gdb-gnats at sources dot redhat dot com
- Date: 23 Apr 2004 14:47:26 -0000
- Subject: cli/1621: "edit" command for unknown source file
- Reply-to: kraftche at cae dot wisc dot edu
>Number: 1621
>Category: cli
>Synopsis: "edit" command for unknown source file
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: unassigned
>State: open
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Fri Apr 23 14:48:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator: kraftche@cae.wisc.edu
>Release: 6.1
>Organization:
>Environment:
Debian GNU/Linux testing/unstable
>Description:
It would be nice if the "edit" command behaved a little more intelligently when there is no source file for the current stack frame (frex inside libc or some other library without debug symbols.) The current behavior seems to be to show the last stack frame for which there was a known source file, which may not have anything to do with the current stack or even the current run of the application. Making the edit command a no-op in this case would be nice. Even better would be to step up the call stack until a frame with a known source file is found. For example, if execution stops because of an assert, display the source file and line of the assert call.
>How-To-Repeat:
#!/bin/sh
cat > assert.c <<END_assert_c
void foo(void);
int main()
{
foo();
return 0;
}
END_assert_c
cat > assert2.c << END_assert2_c
#include <assert.h>
void foo( void )
{
assert( 0 /*failed assertion*/ );
}
END_assert2_c
gcc -g -c assert.c
gcc -g -c assert2.c
gcc assert.o assert2.o -o assert
gdb -n assert << END_GDB
run
edit
END_GDB
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: