gdb: use gdb::byte_vector instead of std::vector<char> in core_target::get_core_register_section
Since the data held by the `contents` variable is arbitrary binary data, it should have gdb_byte elements, not char elements. Also, using gdb::byte_vector is preferable, since it doesn't unnecessarily zero-initialize the values. Instead of adding a cast in the call to m_core_vec->core_read_registers, I have changed core_read_registers' argument to be a gdb_byte* instead of a char*. gdb/ChangeLog: * gdbcore.h (struct core_fns) <core_read_registers>: Change core_reg_sect type to gdb_byte *. * arm-nbsd-nat.c (fetch_elfcore_registers): Likewise. * cris-tdep.c (fetch_core_registers): Likewise. * corelow.c (core_target::get_core_register_section): Change type of `contents` to gdb::byte_vector.
This commit is contained in:
parent
9a6d629ccf
commit
0cac9354bf
@ -1,3 +1,12 @@
|
||||
2020-01-13 Simon Marchi <simon.marchi@efficios.com>
|
||||
|
||||
* gdbcore.h (struct core_fns) <core_read_registers>: Change
|
||||
core_reg_sect type to gdb_byte *.
|
||||
* arm-nbsd-nat.c (fetch_elfcore_registers): Likewise.
|
||||
* cris-tdep.c (fetch_core_registers): Likewise.
|
||||
* corelow.c (core_target::get_core_register_section): Change
|
||||
type of `contents` to gdb::byte_vector.
|
||||
|
||||
2020-01-13 Andrew Burgess <andrew.burgess@embecosm.com>
|
||||
|
||||
* tui/tui-wingeneral.c (box_win): Position the title in the center
|
||||
|
@ -397,7 +397,7 @@ arm_nbsd_nat_target::store_registers (struct regcache *regcache, int regno)
|
||||
|
||||
static void
|
||||
fetch_elfcore_registers (struct regcache *regcache,
|
||||
char *core_reg_sect, unsigned core_reg_size,
|
||||
gdb_byte *core_reg_sect, unsigned core_reg_size,
|
||||
int which, CORE_ADDR ignore)
|
||||
{
|
||||
struct reg gregset;
|
||||
|
@ -621,7 +621,7 @@ core_target::get_core_register_section (struct regcache *regcache,
|
||||
section_name.c_str ());
|
||||
}
|
||||
|
||||
std::vector<char> contents (size);
|
||||
gdb::byte_vector contents (size);
|
||||
if (!bfd_get_section_contents (core_bfd, section, contents.data (),
|
||||
(file_ptr) 0, size))
|
||||
{
|
||||
|
@ -3793,7 +3793,7 @@ cris_supply_gregset (struct regcache *regcache, cris_elf_gregset_t *gregsetp)
|
||||
|
||||
static void
|
||||
fetch_core_registers (struct regcache *regcache,
|
||||
char *core_reg_sect, unsigned core_reg_size,
|
||||
gdb_byte *core_reg_sect, unsigned core_reg_size,
|
||||
int which, CORE_ADDR reg_addr)
|
||||
{
|
||||
cris_elf_gregset_t gregset;
|
||||
|
@ -213,7 +213,7 @@ struct core_fns
|
||||
address X is at location core_reg_sect+x+reg_addr. */
|
||||
|
||||
void (*core_read_registers) (struct regcache *regcache,
|
||||
char *core_reg_sect,
|
||||
gdb_byte *core_reg_sect,
|
||||
unsigned core_reg_size,
|
||||
int which, CORE_ADDR reg_addr);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user