This is the mail archive of the gdb-prs@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

cli/1621: "edit" command for unknown source file


>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:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]