projects
/
deliverable
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Constify get_exec_file
[deliverable/binutils-gdb.git]
/
gdb
/
bsd-kvm.c
diff --git
a/gdb/bsd-kvm.c
b/gdb/bsd-kvm.c
index 434c1928b79c87eb97fca9f3091e31410c04de76..74c044f6c734f2f2256ff650a633155c3942257c 100644
(file)
--- a/
gdb/bsd-kvm.c
+++ b/
gdb/bsd-kvm.c
@@
-1,6
+1,6
@@
/* BSD Kernel Data Access Library (libkvm) interface.
/* BSD Kernel Data Access Library (libkvm) interface.
- Copyright (C) 2004-201
8
Free Software Foundation, Inc.
+ Copyright (C) 2004-201
9
Free Software Foundation, Inc.
This file is part of GDB.
This file is part of GDB.
@@
-24,8
+24,10
@@
#include "frame.h"
#include "regcache.h"
#include "target.h"
#include "frame.h"
#include "regcache.h"
#include "target.h"
+#include "process-stratum-target.h"
#include "value.h"
#include "value.h"
-#include "gdbcore.h" /* for get_exec_file */
+#include "gdbcore.h"
+#include "inferior.h" /* for get_exec_file */
#include "gdbthread.h"
#include <fcntl.h>
#include "gdbthread.h"
#include <fcntl.h>
@@
-70,11
+72,10
@@
static const target_info bsd_kvm_target_info = {
Optionally specify the filename of a core dump.")
};
Optionally specify the filename of a core dump.")
};
-class bsd_kvm_target final : public
target_ops
+class bsd_kvm_target final : public
process_stratum_target
{
public:
{
public:
- bsd_kvm_target ()
- { this->to_stratum = process_stratum; }
+ bsd_kvm_target () = default;
const target_info &info () const override
{ return bsd_kvm_target_info; }
const target_info &info () const override
{ return bsd_kvm_target_info; }
@@
-91,7
+92,7
@@
public:
void files_info () override;
bool thread_alive (ptid_t ptid) override;
void files_info () override;
bool thread_alive (ptid_t ptid) override;
-
const char *
pid_to_str (ptid_t) override;
+
std::string
pid_to_str (ptid_t) override;
bool has_memory () override { return true; }
bool has_stack () override { return true; }
bool has_memory () override { return true; }
bool has_stack () override { return true; }
@@
-105,7
+106,7
@@
static void
bsd_kvm_target_open (const char *arg, int from_tty)
{
char errbuf[_POSIX2_LINE_MAX];
bsd_kvm_target_open (const char *arg, int from_tty)
{
char errbuf[_POSIX2_LINE_MAX];
- char *execfile = NULL;
+ c
onst c
har *execfile = NULL;
kvm_t *temp_kd;
char *filename = NULL;
kvm_t *temp_kd;
char *filename = NULL;
@@
-113,14
+114,13
@@
bsd_kvm_target_open (const char *arg, int from_tty)
if (arg)
{
if (arg)
{
- char *temp;
-
filename = tilde_expand (arg);
if (filename[0] != '/')
{
filename = tilde_expand (arg);
if (filename[0] != '/')
{
- temp = concat (current_directory, "/", filename, (char *)NULL);
+ gdb::unique_xmalloc_ptr<char> temp (gdb_abspath (filename));
+
xfree (filename);
xfree (filename);
- filename = temp;
+ filename = temp
.release ()
;
}
}
}
}
@@
-367,12
+367,10
@@
bsd_kvm_target::thread_alive (ptid_t ptid)
return true;
}
return true;
}
-const char *
+std::string
bsd_kvm_target::pid_to_str (ptid_t ptid)
{
bsd_kvm_target::pid_to_str (ptid_t ptid)
{
- static char buf[64];
- xsnprintf (buf, sizeof buf, "<kvm>");
- return buf;
+ return "<kvm>";
}
/* Add the libkvm interface to the list of all possible targets and
}
/* Add the libkvm interface to the list of all possible targets and
@@
-413,5
+411,5
@@
Generic command for manipulating the kernel memory interface."),
ptid (1, 1, 2) -> kvm inferior 1, process 2
ptid (1, 1, n) -> kvm inferior 1, process n */
ptid (1, 1, 2) -> kvm inferior 1, process 2
ptid (1, 1, n) -> kvm inferior 1, process n */
- bsd_kvm_ptid = ptid_
build
(1, 1, 0);
+ bsd_kvm_ptid = ptid_
t
(1, 1, 0);
}
}
This page took
0.026287 seconds
and
4
git commands to generate.