1 /* OBSOLETE /* umax host stuff. */
2 /* OBSOLETE Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1995, 1999, 2000, 2001 */
3 /* OBSOLETE Free Software Foundation, Inc. */
5 /* OBSOLETE This file is part of GDB. */
7 /* OBSOLETE This program is free software; you can redistribute it and/or modify */
8 /* OBSOLETE it under the terms of the GNU General Public License as published by */
9 /* OBSOLETE the Free Software Foundation; either version 2 of the License, or */
10 /* OBSOLETE (at your option) any later version. */
12 /* OBSOLETE This program is distributed in the hope that it will be useful, */
13 /* OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of */
14 /* OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
15 /* OBSOLETE GNU General Public License for more details. */
17 /* OBSOLETE You should have received a copy of the GNU General Public License */
18 /* OBSOLETE along with this program; if not, write to the Free Software */
19 /* OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, */
20 /* OBSOLETE Boston, MA 02111-1307, USA. */ */
22 /* OBSOLETE #include "defs.h" */
23 /* OBSOLETE #include "frame.h" */
24 /* OBSOLETE #include "inferior.h" */
25 /* OBSOLETE #include "regcache.h" */
27 /* OBSOLETE #include <sys/param.h> */
28 /* OBSOLETE #include <sys/dir.h> */
29 /* OBSOLETE #include <signal.h> */
30 /* OBSOLETE #include <sys/ioctl.h> */
31 /* OBSOLETE #include <fcntl.h> */
33 /* OBSOLETE #include "gdbcore.h" */
34 /* OBSOLETE #include <sys/ptrace.h> */
35 /* OBSOLETE #define PTRACE_ATTACH PT_ATTACH */
36 /* OBSOLETE #define PTRACE_DETACH PT_FREEPROC */
38 /* OBSOLETE #include <sys/file.h> */
39 /* OBSOLETE #include "gdb_stat.h" */
41 /* OBSOLETE /* Work with core dump and executable files, for GDB. */
42 /* OBSOLETE This code would be in corefile.c if it weren't machine-dependent. */ */
45 /* OBSOLETE core_file_command (char *filename, int from_tty) */
47 /* OBSOLETE int val; */
49 /* OBSOLETE /* Discard all vestiges of any previous core file */
50 /* OBSOLETE and mark data and stack spaces as empty. */ */
52 /* OBSOLETE if (corefile) */
53 /* OBSOLETE xfree (corefile); */
54 /* OBSOLETE corefile = 0; */
56 /* OBSOLETE if (corechan >= 0) */
57 /* OBSOLETE close (corechan); */
58 /* OBSOLETE corechan = -1; */
60 /* OBSOLETE data_start = 0; */
61 /* OBSOLETE data_end = 0; */
62 /* OBSOLETE stack_start = STACK_END_ADDR; */
63 /* OBSOLETE stack_end = STACK_END_ADDR; */
65 /* OBSOLETE /* Now, if a new core file was specified, open it and digest it. */ */
67 /* OBSOLETE if (filename) */
69 /* OBSOLETE filename = tilde_expand (filename); */
70 /* OBSOLETE make_cleanup (xfree, filename); */
72 /* OBSOLETE if (have_inferior_p ()) */
73 /* OBSOLETE error ("To look at a core file, you must kill the program with \"kill\"."); */
74 /* OBSOLETE corechan = open (filename, O_RDONLY, 0); */
75 /* OBSOLETE if (corechan < 0) */
76 /* OBSOLETE perror_with_name (filename); */
77 /* OBSOLETE /* 4.2-style (and perhaps also sysV-style) core dump file. */ */
79 /* OBSOLETE struct ptrace_user u; */
80 /* OBSOLETE int reg_offset; */
82 /* OBSOLETE val = myread (corechan, &u, sizeof u); */
83 /* OBSOLETE if (val < 0) */
84 /* OBSOLETE perror_with_name (filename); */
85 /* OBSOLETE data_start = exec_data_start; */
87 /* OBSOLETE data_end = data_start + u.pt_dsize; */
88 /* OBSOLETE stack_start = stack_end - u.pt_ssize; */
89 /* OBSOLETE data_offset = sizeof u; */
90 /* OBSOLETE stack_offset = data_offset + u.pt_dsize; */
91 /* OBSOLETE reg_offset = 0; */
93 /* OBSOLETE memcpy (&core_aouthdr, &u.pt_aouthdr, sizeof (AOUTHDR)); */
94 /* OBSOLETE printf_unfiltered ("Core file is from \"%s\".\n", u.pt_comm); */
95 /* OBSOLETE if (u.pt_signal > 0) */
96 /* OBSOLETE printf_unfiltered ("Program terminated with signal %d, %s.\n", */
97 /* OBSOLETE u.pt_signal, safe_strsignal (u.pt_signal)); */
99 /* OBSOLETE /* Read the register values out of the core file and store */
100 /* OBSOLETE them where `read_register' will find them. */ */
103 /* OBSOLETE register int regno; */
105 /* OBSOLETE for (regno = 0; regno < NUM_REGS; regno++) */
107 /* OBSOLETE char buf[MAX_REGISTER_RAW_SIZE]; */
109 /* OBSOLETE val = lseek (corechan, register_addr (regno, reg_offset), 0); */
110 /* OBSOLETE if (val < 0) */
111 /* OBSOLETE perror_with_name (filename); */
113 /* OBSOLETE val = myread (corechan, buf, sizeof buf); */
114 /* OBSOLETE if (val < 0) */
115 /* OBSOLETE perror_with_name (filename); */
116 /* OBSOLETE supply_register (regno, buf); */
120 /* OBSOLETE if (filename[0] == '/') */
121 /* OBSOLETE corefile = savestring (filename, strlen (filename)); */
124 /* OBSOLETE corefile = concat (current_directory, "/", filename, NULL); */
127 /* OBSOLETE flush_cached_frames (); */
128 /* OBSOLETE select_frame (get_current_frame (), 0); */
129 /* OBSOLETE validate_files (); */
131 /* OBSOLETE else if (from_tty) */
132 /* OBSOLETE printf_unfiltered ("No core file now.\n"); */
This page took 0.031625 seconds and 4 git commands to generate.