projects
/
deliverable
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
oops - toplevel changelog entry for previous delta.
[deliverable/binutils-gdb.git]
/
gdb
/
dtrace-probe.c
diff --git
a/gdb/dtrace-probe.c
b/gdb/dtrace-probe.c
index a51f35800ab7ab388b90eb0375b97f8f5efcef9e..85f6c01b6ab09b0fd36a5085968640f6193adfe3 100644
(file)
--- a/
gdb/dtrace-probe.c
+++ b/
gdb/dtrace-probe.c
@@
-1,6
+1,6
@@
/* DTrace probe support for GDB.
/* DTrace probe support for GDB.
- Copyright (C) 2014-20
19
Free Software Foundation, Inc.
+ Copyright (C) 2014-20
20
Free Software Foundation, Inc.
Contributed by Oracle, Inc.
Contributed by Oracle, Inc.
@@
-21,7
+21,6
@@
#include "defs.h"
#include "probe.h"
#include "defs.h"
#include "probe.h"
-#include "common/vec.h"
#include "elf-bfd.h"
#include "gdbtypes.h"
#include "obstack.h"
#include "elf-bfd.h"
#include "gdbtypes.h"
#include "obstack.h"
@@
-81,7
+80,7
@@
public:
bool is_linespec (const char **linespecp) const override;
/* See probe.h. */
bool is_linespec (const char **linespecp) const override;
/* See probe.h. */
- void get_probes (std::vector<
probe *
> *probesp,
+ void get_probes (std::vector<
std::unique_ptr<probe>
> *probesp,
struct objfile *objfile) const override;
/* See probe.h. */
struct objfile *objfile) const override;
/* See probe.h. */
@@
-122,7
+121,7
@@
public:
CORE_ADDR get_relocated_address (struct objfile *objfile) override;
/* See probe.h. */
CORE_ADDR get_relocated_address (struct objfile *objfile) override;
/* See probe.h. */
- unsigned get_argument_count (struct
frame_info *frame
) override;
+ unsigned get_argument_count (struct
gdbarch *gdbarch
) override;
/* See probe.h. */
bool can_evaluate_arguments () const override;
/* See probe.h. */
bool can_evaluate_arguments () const override;
@@
-152,7
+151,7
@@
public:
struct dtrace_probe_arg *get_arg_by_number (unsigned n,
struct gdbarch *gdbarch);
struct dtrace_probe_arg *get_arg_by_number (unsigned n,
struct gdbarch *gdbarch);
- /* Build the GDB internal expressio
s
n that, once evaluated, will
+ /* Build the GDB internal expression that, once evaluated, will
calculate the values of the arguments of the probe. */
void build_arg_exprs (struct gdbarch *gdbarch);
calculate the values of the arguments of the probe. */
void build_arg_exprs (struct gdbarch *gdbarch);
@@
-380,7
+379,7
@@
struct dtrace_dof_probe
static void
dtrace_process_dof_probe (struct objfile *objfile,
struct gdbarch *gdbarch,
static void
dtrace_process_dof_probe (struct objfile *objfile,
struct gdbarch *gdbarch,
- std::vector<
probe *
> *probesp,
+ std::vector<
std::unique_ptr<probe>
> *probesp,
struct dtrace_dof_hdr *dof,
struct dtrace_dof_probe *probe,
struct dtrace_dof_provider *provider,
struct dtrace_dof_hdr *dof,
struct dtrace_dof_probe *probe,
struct dtrace_dof_provider *provider,
@@
-507,7
+506,7
@@
dtrace_process_dof_probe (struct objfile *objfile,
std::move (enablers_copy));
/* Successfully created probe. */
std::move (enablers_copy));
/* Successfully created probe. */
- probesp->
push
_back (ret);
+ probesp->
emplace
_back (ret);
}
}
}
}
@@
-518,7
+517,8
@@
dtrace_process_dof_probe (struct objfile *objfile,
static void
dtrace_process_dof (asection *sect, struct objfile *objfile,
static void
dtrace_process_dof (asection *sect, struct objfile *objfile,
- std::vector<probe *> *probesp, struct dtrace_dof_hdr *dof)
+ std::vector<std::unique_ptr<probe>> *probesp,
+ struct dtrace_dof_hdr *dof)
{
struct gdbarch *gdbarch = get_objfile_arch (objfile);
struct dtrace_dof_sect *section;
{
struct gdbarch *gdbarch = get_objfile_arch (objfile);
struct dtrace_dof_sect *section;
@@
-685,14
+685,14
@@
dtrace_probe::is_enabled () const
CORE_ADDR
dtrace_probe::get_relocated_address (struct objfile *objfile)
{
CORE_ADDR
dtrace_probe::get_relocated_address (struct objfile *objfile)
{
- return
this->get_address () + ANOFFSET (objfile->section_offsets,
-
SECT_OFF_DATA (objfile)
);
+ return
(this->get_address ()
+
+ objfile->section_offsets[SECT_OFF_DATA (objfile)]
);
}
/* Implementation of the get_argument_count method. */
unsigned
}
/* Implementation of the get_argument_count method. */
unsigned
-dtrace_probe::get_argument_count (struct
frame_info *frame
)
+dtrace_probe::get_argument_count (struct
gdbarch *gdbarch
)
{
return m_args.size ();
}
{
return m_args.size ();
}
@@
-833,8
+833,9
@@
dtrace_static_probe_ops::is_linespec (const char **linespecp) const
/* Implementation of the get_probes method. */
void
/* Implementation of the get_probes method. */
void
-dtrace_static_probe_ops::get_probes (std::vector<probe *> *probesp,
- struct objfile *objfile) const
+dtrace_static_probe_ops::get_probes
+ (std::vector<std::unique_ptr<probe>> *probesp,
+ struct objfile *objfile) const
{
bfd *abfd = objfile->obfd;
asection *sect = NULL;
{
bfd *abfd = objfile->obfd;
asection *sect = NULL;
@@
-854,13
+855,14
@@
dtrace_static_probe_ops::get_probes (std::vector<probe *> *probesp,
/* Read the contents of the DOF section and then process it to
extract the information of any probe defined into it. */
/* Read the contents of the DOF section and then process it to
extract the information of any probe defined into it. */
- if (!bfd_malloc_and_get_section (abfd, sect, &dof))
+ if (bfd_malloc_and_get_section (abfd, sect, &dof) && dof != NULL)
+ dtrace_process_dof (sect, objfile, probesp,
+ (struct dtrace_dof_hdr *) dof);
+ else
complaint (_("could not obtain the contents of"
"section '%s' in objfile `%s'."),
sect->name, abfd->filename);
complaint (_("could not obtain the contents of"
"section '%s' in objfile `%s'."),
sect->name, abfd->filename);
-
- dtrace_process_dof (sect, objfile, probesp,
- (struct dtrace_dof_hdr *) dof);
+
xfree (dof);
}
}
xfree (dof);
}
}
This page took
0.025217 seconds
and
4
git commands to generate.