diff options
| author | Joerg Wunsch <joerg@FreeBSD.org> | 1995-04-19 22:59:33 +0000 |
|---|---|---|
| committer | Joerg Wunsch <joerg@FreeBSD.org> | 1995-04-19 22:59:33 +0000 |
| commit | e6073fb7f6111484db466a0a6e2e177172e62213 (patch) | |
| tree | 6fe5bbec343439ec0b672b7a39aaabbc5ab77909 /gnu/usr.bin | |
| parent | 954f5fffa2b36ba0056e30400698718f675bf6ee (diff) | |
Notes
Diffstat (limited to 'gnu/usr.bin')
| -rw-r--r-- | gnu/usr.bin/gdb/gdb/kcorelow.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/gnu/usr.bin/gdb/gdb/kcorelow.c b/gnu/usr.bin/gdb/gdb/kcorelow.c index d97c5940f552..debd7d6114b2 100644 --- a/gnu/usr.bin/gdb/gdb/kcorelow.c +++ b/gnu/usr.bin/gdb/gdb/kcorelow.c @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id: kcorelow.c,v 1.2 1994/05/18 12:42:15 pk Exp $ + $Id: kcorelow.c,v 1.1 1994/12/30 23:32:56 jkh Exp $ */ #include "defs.h" @@ -170,8 +170,18 @@ kcore_open (filename, from_tty) old_chain = make_cleanup (free, filename); + /* + * gdb doesn't really do anything if the exec-file couldn't + * be opened (in that case exec_bfd is NULL). Usually that's + * no big deal, but kvm_open needs the exec-file's name, + * which results in dereferencing a NULL pointer, a real NO-NO ! + * So, check here if the open of the exec-file succeeded. + */ + if (exec_bfd == NULL) /* the open failed */ + error ("kgdb could not open the exec-file, please check the name you used !"); + core_kd = kvm_open (exec_bfd->filename, filename, NULL, - write_files? O_RDWR: O_RDONLY, 0); + write_files? O_RDWR: O_RDONLY, "kgdb: "); if (core_kd < 0) perror_with_name (filename); |
