along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-
-/* Standard C includes. */
-#include <fcntl.h>
-#include <signal.h>
-
-/* Local non-gdb includes. */
#include "arch-utils.h"
-#include "bfd.h"
-#include "command.h"
-#include "common/filestuff.h"
-#include "completer.h"
-#include "exec.h"
-#include "filenames.h"
-#include "frame.h"
-#include "gdb_bfd.h"
-#include "gdbcore.h"
-#include "gdbthread.h"
+#include <signal.h>
+#include <fcntl.h>
+#include "frame.h" /* required by inferior.h */
#include "inferior.h"
#include "infrun.h"
-#include "objfiles.h"
+#include "symtab.h"
+#include "command.h"
+#include "bfd.h"
+#include "target.h"
#include "process-stratum-target.h"
-#include "progspace.h"
-#include "readline/readline.h"
+#include "gdbcore.h"
+#include "gdbthread.h"
#include "regcache.h"
#include "regset.h"
-#include "solib.h"
#include "symfile.h"
-#include "symtab.h"
-#include "target.h"
+#include "exec.h"
+#include "readline/readline.h"
+#include "solib.h"
+#include "filenames.h"
+#include "progspace.h"
+#include "objfiles.h"
+#include "gdb_bfd.h"
+#include "completer.h"
+#include "gdbsupport/filestuff.h"
#ifndef O_LARGEFILE
#define O_LARGEFILE 0
static const target_info core_target_info = {
"core",
N_("Local core dump file"),
- N_("Use a core file as a target. Specify the filename of the core file.")
+ N_("Use a core file as a target.\n\
+Specify the filename of the core file.")
};
class core_target final : public process_stratum_target
int core_tid;
int pid, lwpid;
asection *reg_sect = (asection *) reg_sect_arg;
- int fake_pid_p = 0;
+ bool fake_pid_p = false;
struct inferior *inf;
if (!startswith (bfd_section_name (abfd, asect), ".reg/"))
pid = bfd_core_file_pid (core_bfd);
if (pid == 0)
{
- fake_pid_p = 1;
+ fake_pid_p = true;
pid = CORELOW_PID;
}
may be a thread_stratum target loaded on top of target core by
now. The layer above should claim threads found in the BFD
sections. */
- TRY
+ try
{
target_update_thread_list ();
}
- CATCH (except, RETURN_MASK_ERROR)
+ catch (const gdb_exception_error &except)
{
exception_print (gdb_stderr, except);
}
- END_CATCH
p = bfd_core_file_failing_command (core_bfd);
if (p)
anything about threads. That is why the test is >= 2. */
if (thread_count () >= 2)
{
- TRY
+ try
{
thread_command (NULL, from_tty);
}
- CATCH (except, RETURN_MASK_ERROR)
+ catch (const gdb_exception_error &except)
{
exception_print (gdb_stderr, except);
}
- END_CATCH
}
}
'this'. */
unpush_target (this);
+ /* Clear the register cache and the frame cache. */
+ registers_changed ();
reinit_frame_cache ();
maybe_say_no_core_file_now (from_tty);
}