projects
/
external
/
binutils.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove some defines from tui-data.h
[external/binutils.git]
/
gdb
/
corelow.c
diff --git
a/gdb/corelow.c
b/gdb/corelow.c
index
ab32e09
..
5e9634e
100644
(file)
--- a/
gdb/corelow.c
+++ b/
gdb/corelow.c
@@
-21,9
+21,6
@@
#include "arch-utils.h"
#include <signal.h>
#include <fcntl.h>
#include "arch-utils.h"
#include <signal.h>
#include <fcntl.h>
-#ifdef HAVE_SYS_FILE_H
-#include <sys/file.h> /* needed for F_OK and friends */
-#endif
#include "frame.h" /* required by inferior.h */
#include "inferior.h"
#include "infrun.h"
#include "frame.h" /* required by inferior.h */
#include "inferior.h"
#include "infrun.h"
@@
-45,7
+42,7
@@
#include "objfiles.h"
#include "gdb_bfd.h"
#include "completer.h"
#include "objfiles.h"
#include "gdb_bfd.h"
#include "completer.h"
-#include "filestuff.h"
+#include "
gdbsupport/
filestuff.h"
#ifndef O_LARGEFILE
#define O_LARGEFILE 0
#ifndef O_LARGEFILE
#define O_LARGEFILE 0
@@
-59,7
+56,8
@@
static core_fns *sniff_core_bfd (gdbarch *core_gdbarch,
static const target_info core_target_info = {
"core",
N_("Local core dump file"),
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
};
class core_target final : public process_stratum_target
@@
-86,7
+84,7
@@
public:
bool thread_alive (ptid_t ptid) override;
const struct target_desc *read_description () override;
bool thread_alive (ptid_t ptid) override;
const struct target_desc *read_description () override;
-
const char *
pid_to_str (ptid_t) override;
+
std::string
pid_to_str (ptid_t) override;
const char *thread_name (struct thread_info *) override;
const char *thread_name (struct thread_info *) override;
@@
-288,7
+286,7
@@
add_to_thread_list (bfd *abfd, asection *asect, void *reg_sect_arg)
int core_tid;
int pid, lwpid;
asection *reg_sect = (asection *) reg_sect_arg;
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/"))
struct inferior *inf;
if (!startswith (bfd_section_name (abfd, asect), ".reg/"))
@@
-299,7
+297,7
@@
add_to_thread_list (bfd *abfd, asection *asect, void *reg_sect_arg)
pid = bfd_core_file_pid (core_bfd);
if (pid == 0)
{
pid = bfd_core_file_pid (core_bfd);
if (pid == 0)
{
- fake_pid_p =
1
;
+ fake_pid_p =
true
;
pid = CORELOW_PID;
}
pid = CORELOW_PID;
}
@@
-420,8
+418,7
@@
core_target_open (const char *arg, int from_tty)
if (!exec_bfd)
set_gdbarch_from_file (core_bfd);
if (!exec_bfd)
set_gdbarch_from_file (core_bfd);
- push_target (target);
- target_holder.release ();
+ push_target (std::move (target_holder));
inferior_ptid = null_ptid;
inferior_ptid = null_ptid;
@@
-465,16
+462,15
@@
core_target_open (const char *arg, int from_tty)
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. */
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 ();
}
{
target_update_thread_list ();
}
-
CATCH (except, RETURN_MASK_ERROR
)
+
catch (const gdb_exception_error &except
)
{
exception_print (gdb_stderr, except);
}
{
exception_print (gdb_stderr, except);
}
- END_CATCH
p = bfd_core_file_failing_command (core_bfd);
if (p)
p = bfd_core_file_failing_command (core_bfd);
if (p)
@@
-521,15
+517,14
@@
core_target_open (const char *arg, int from_tty)
anything about threads. That is why the test is >= 2. */
if (thread_count () >= 2)
{
anything about threads. That is why the test is >= 2. */
if (thread_count () >= 2)
{
- TRY
+ try
{
thread_command (NULL, from_tty);
}
{
thread_command (NULL, from_tty);
}
-
CATCH (except, RETURN_MASK_ERROR
)
+
catch (const gdb_exception_error &except
)
{
exception_print (gdb_stderr, except);
}
{
exception_print (gdb_stderr, except);
}
- END_CATCH
}
}
}
}
@@
-541,6
+536,8
@@
core_target::detach (inferior *inf, int from_tty)
'this'. */
unpush_target (this);
'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);
}
reinit_frame_cache ();
maybe_say_no_core_file_now (from_tty);
}
@@
-989,10
+986,9
@@
core_target::read_description ()
return this->beneath ()->read_description ();
}
return this->beneath ()->read_description ();
}
-const char *
+std::string
core_target::pid_to_str (ptid_t ptid)
{
core_target::pid_to_str (ptid_t ptid)
{
- static char buf[64];
struct inferior *inf;
int pid;
struct inferior *inf;
int pid;
@@
-1017,8
+1013,7
@@
core_target::pid_to_str (ptid_t ptid)
return normal_pid_to_str (ptid);
/* No luck. We simply don't have a valid PID to print. */
return normal_pid_to_str (ptid);
/* No luck. We simply don't have a valid PID to print. */
- xsnprintf (buf, sizeof buf, "<main task>");
- return buf;
+ return "<main task>";
}
const char *
}
const char *