• R/O
  • HTTP
  • SSH
  • HTTPS

提交列表

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


users/qiyao/regcache-split-4
RSS
Rev. 时间 作者
df80910 users/qiyao/regcache-split-4 2018-01-19 02:06:18 Yao Qi

Move register_dump to regcache-dump.c

gdb:

2017-11-30 Yao Qi <yao.qi@linaro.org>

* Makefile.in (SFILES): Add regcache-dump.c
(COMMON_OBS): Add regcache-dump.o.
* regcache-dump.c: New file.
* regcache.c: Move register_dump to regcache-dump.c.
(maintenance_print_registers): Likewise.
(maintenance_print_raw_registers): Likewise.
(maintenance_print_cooked_registers): Likewise.
(maintenance_print_register_groups): Likewise.
(maintenance_print_remote_registers): Likewise.
(_initialize_regcache): Likewise.
* regcache.h (register_dump): Moved from regcache.c.

38116b5 2018-01-19 02:06:18 Yao Qi

Remove regcache::m_readonly_p

Now, m_readonly_p is always false, so we can remove it, and regcache no
longer includes pseudo registers. Some regcache methods are lift up to
its parent class, like reg_buffer or reg_buffer_rw.

gdb:

2017-11-07 Yao Qi <yao.qi@linaro.org>

* regcache.c (regcache::regcache): Update.
(regcache::invalidate): Move it to reg_buffer_rw::invalidate.
(get_thread_arch_aspace_regcache): Update.
(regcache::raw_update): Update.
(regcache::cooked_read): Remove some code.
(regcache::cooked_read_value): Likewise.
(regcache::raw_write): Remove assert on m_readonly_p.
(regcache::raw_supply_integer): Move it to
reg_buffer_rw::raw_supply_integer.
(regcache::raw_supply_zeroed): Likewise.
* regcache.h (reg_buffer_rw) <raw_supply_integer>: New declaration.
<raw_supply_zeroed, invalidate>: Likewise.
(regcache) <raw_supply_integer, raw_supply_zeroed>: Removed.
<invalidate>: Likewise.
<m_readonly_p>: Removed.

7cc3a97 2018-01-19 02:06:18 Yao Qi

No longer create readonly regcache

Nowadays, we create a readonly regcache in get_return_value, and pass it
to gdbarch_return_value to get the return value. In theory, we can pass a
regcache_readonly instance and get the return value, because we don't need
to modify the regcache. Unfortunately, gdbarch_return_value is designed
to multiplex regcache, according to READBUF and WRITEBUF.

# If READBUF is not NULL, extract the return value and save it in this
# buffer.
#
# If WRITEBUF is not NULL, it contains a return value which will be
# stored into the appropriate register.

In fact, gdbarch_return_value should be split to three functions, 1) only
return return_value_convention, 2) pass regcache_readonly and readbuf, 3)
pass regcache and writebuf. These changes are out of the scope of this
patch series, so I pass regcache to gdbarch_return_value even for read,
and trust each gdbarch backend doesn't modify regcache.

gdb:

2017-11-02 Yao Qi <yao.qi@linaro.org>

* infcmd.c (get_return_value): Let stop_regs point to
get_current_regcache.
* regcache.c (regcache::regcache): Remove.
(register_dump_reg_buffer): New class.
(regcache_print): Adjust.
* regcache.h (regcache): Remove constructors.

84cf4fb 2018-01-19 02:06:18 Yao Qi

Replace regcache::dump with class register_dump

Nowadays, we need to dump registers contents from "readwrite" regcache and
"readonly" regcache,

if (target_has_registers)
get_current_regcache ()->dump (out, what_to_dump);
else
{
/* For the benefit of "maint print registers" & co when
debugging an executable, allow dumping a regcache even when
there is no thread selected / no registers. */
regcache dummy_regs (target_gdbarch ());
dummy_regs.dump (out, what_to_dump);
}

since we'll have two different types/classes for "readwrite" regcache and
"readonly" regcache, we have to move dump method to their parent class,
reg_buffer. However, the functionality of "dump" looks unnecessary to
reg_buffer (because some dump modes like regcache_dump_none,
regcache_dump_remote and regcache_dump_groups don't need reg_buffer at
all, they need gdbarch to do the dump), so I decide to move "dump" into a
separate classes, and each sub-class is about each mode of dump.

gdb:

2017-11-28 Yao Qi <yao.qi@linaro.org>

* regcache.c (class register_dump): New class.
(register_dump_regcache, register_dump_none): New class.
(register_dump_remote, register_dump_groups): New class.
(regcache_print): Update.
* regcache.h (regcache_dump_what): Move it to regcache.c.
(regcache) <dump>: Remove.

ef317ed 2018-01-19 02:06:17 Yao Qi

Class reg_buffer_rw

jit.c uses the regcache in a slightly different way, the regcache dosn't
write through to target, but it has read and write methods. If I apply
regcache in record-full.c, it has the similar use pattern. This patch
adds a new class reg_buffer_rw, which is a register buffer, but can be
red and written.

Since jit.c doesn't want to write registers through to target, it uses
regcache as a readonly regcache (because only readonly regcache
disconnects from the target), but it adds a hole in regcache
(raw_set_cached_value) in order to modify a readonly regcache. This patch
fixes this hole completely.

regcache inherits reg_buffer_rw, and reg_buffer_rw inherits regcache_read.
The ideal design is that both reg_buffer_rw and regcache_read inherit
reg_buffer, and regcache inherit reg_buffer_rw and regcache_read (virtual
inheritance). I concern about the performance overhead of virtual
inheritance, so I don't do it in the patch.

gdb:

2017-11-28 Yao Qi <yao.qi@linaro.org>

* jit.c (struct jit_unwind_private) <regcache>: Change its type to
reg_buffer_rw *.
(jit_unwind_reg_set_impl): Call raw_supply.
(jit_frame_sniffer): Use reg_buffer_rw.
* record-full.c (record_full_core_regbuf): Change its type.
(record_full_core_open_1): Use reg_buffer_rw.
(record_full_close): Likewise.
(record_full_core_fetch_registers): Use regcache->raw_supply.
(record_full_core_store_registers): Likewise.
* regcache.c (regcache::get_register_status): Move it to
reg_buffer.
(regcache_raw_set_cached_value): Remove.
(regcache::raw_set_cached_value): Remove.
(regcache::raw_write): Call raw_supply.
(regcache::raw_supply): Move it to reg_buffer_rw.
* regcache.h (regcache_raw_set_cached_value): Remove.
(reg_buffer_rw): New class.

5d5133d 2018-01-19 02:06:17 Yao Qi

Class regcache_readonly

This patch adds a new class (type) for readonly regcache, which is
created via regcache::save. regcache_readonly inherts from
regcache_read.

gdb:

2017-11-28 Yao Qi <yao.qi@linaro.org>

* dummy-frame.c (dummy_frame_cache) <prev_regcache>: Use
regcache_readonly.
(dummy_frame_prev_register): Use regcache->cooked_read.
* frame.c (frame_save_as_regcache): Change return type.
(frame_pop): Update.
* frame.h (frame_save_as_regcache): Update declaration.
* inferior.h (get_infcall_suspend_state_regcache): Update
declaration.
* infrun.c (infcall_suspend_state) <registers>: use
regcache_readonly.
(save_infcall_suspend_state): Don't use regcache_dup.
(get_infcall_suspend_state_regcache): Change return type.
* linux-fork.c (struct fork_info) <savedregs>: Change to
regcache_readonly.
<pc>: New field.
(fork_save_infrun_state): Don't use regcache_dup.
(info_checkpoints_command): Adjust.
* mi/mi-main.c (register_changed_p): Update declaration.
(mi_cmd_data_list_changed_registers): Use regcache_readonly.
(register_changed_p): Change parameter type to regcache_readonly.
* ppc-linux-tdep.c (ppu2spu_cache) <regcache>: Use
regcache_readonly.
(ppu2spu_sniffer): Construct a new regcache_readonly.
* regcache.c (regcache_readonly::regcache_readonly): New.
(regcache::save): Move it to reg_buffer.
(regcache::restore): Change parameter type.
(regcache_dup): Remove.
* regcache.h (reg_buffer) <save>: New method.
(regcache_readonly): New class.
* spu-tdep.c (spu2ppu_cache) <regcache>: Use regcache_readonly.
(spu2ppu_sniffer): Construct a new regcache_readonly.

0d8008d 2018-01-19 02:06:17 Yao Qi

Remove regcache_save and regcache_cpy

... instead we start to use regcache methods save and restore. It is
quite straightforward to replace regcache_save with regcache->save.

regcache_cpy has some asserts, some of them not necessary, like

gdb_assert (src != dst);

because we already assert !m_readonly_p and src->m_readonly_p, so
src isn't dst. Some of the asserts are moved to ::restore.

gdb:

2017-10-30 Yao Qi <yao.qi@linaro.org>

* frame.c (frame_save_as_regcache): Use regcache method save.
(frame_pop): Use regcache method restore.
* infrun.c (restore_infcall_suspend_state): Likewise.
* linux-fork.c (fork_load_infrun_state): Likewise.
* ppc-linux-tdep.c (ppu2spu_sniffer): User regcache method
save.
* regcache.c (regcache_save): Remove.
(regcache::restore): More asserts.
(regcache_cpy): Remove.
* regcache.h (regcache_save): Remove the declaration.
(regcache::restore): Move from private to public.
Remove the friend declaration of regcache_cpy.
(regcache_cpy): Remove declaration.

b0ae557 2018-01-19 02:06:16 Yao Qi

class regcache_read and Pass regcache_read to gdbarch methods

pseudo registers are either from raw registers or memory, so
gdbarch methods pseudo_register_read and pseudo_register_read_value
should have regcache object which only have read methods. In other
words, we should disallow writing to regcache in these two gdbarch
methods. In order to apply this restriction, this patch adds a new
class regcache_read, derived from reg_buffer, and it only has
raw_read and cooked_read methods. regcache is derived from
regcache_read. This patch also passes regcache_read instead of
regcache to gdbarch methods pseudo_register_read and
pseudo_register_read_value.

This patch moves raw_read* and cooked_read* methods to regcache_read,
which is straightforward. One thing not straightforward is that I split
regcache::xfer_part to regcache_read::read_part and regcache::write_part,
because regcache_read can only have methods to read.

regcache_read is an abstract base class, and it has a pure virtual
function raw_update, because I don't want regcache_read know where these
raw registers are from. They can be from either the target (readwrite
regcache) or the regcache itself (readonly regcache).

gdb:

2017-11-29 Yao Qi <yao.qi@linaro.org>

* aarch64-tdep.c (aarch64_pseudo_register_read_value): Change
parameter type to 'regcache_read *'.
* amd64-tdep.c (amd64_pseudo_register_read_value): Likewise.
* arm-tdep.c (arm_neon_quad_read): Likewise.
(arm_pseudo_read): Likewise.
* avr-tdep.c (avr_pseudo_register_read): Likewise.
* bfin-tdep.c (bfin_pseudo_register_read): Likewise.
* frv-tdep.c (frv_pseudo_register_read): Likewise.
* gdbarch.c: Re-generated.
* gdbarch.h: Re-generated.
* gdbarch.sh (pseudo_register_read): Change parameter type to
'regcache_read *'.
(pseudo_register_read_value): Likewise.
* h8300-tdep.c (pseudo_from_raw_register): Likewise.
(h8300_pseudo_register_read): Likewise.
* hppa-tdep.c (hppa_pseudo_register_read): Likewise.
* i386-tdep.c (i386_mmx_regnum_to_fp_regnum): Likewise.
(i386_pseudo_register_read_into_value): Likewise.
(i386_pseudo_register_read_value): Likewise.
* i386-tdep.h (i386_pseudo_register_read_into_value): Update
declaration.
* ia64-tdep.c (ia64_pseudo_register_read): Likewise.
* m32c-tdep.c (m32c_raw_read): Likewise.
(m32c_read_flg): Likewise.
(m32c_banked_register): Likewise.
(m32c_banked_read): Likewise.
(m32c_sb_read): Likewise.
(m32c_part_read): Likewise.
(m32c_cat_read): Likewise.
(m32c_r3r2r1r0_read): Likewise.
(m32c_pseudo_register_read): Likewise.
* m68hc11-tdep.c (m68hc11_pseudo_register_read): Likewise.
* mep-tdep.c (mep_pseudo_cr32_read): Likewise.
(mep_pseudo_cr64_read): Likewise.
(mep_pseudo_register_read): Likewise.
* mips-tdep.c (mips_pseudo_register_read): Likewise.
* msp430-tdep.c (msp430_pseudo_register_read): Likewise.
* nds32-tdep.c (nds32_pseudo_register_read): Likewise.
* regcache.c (regcache::raw_read): Move it to regcache_read.
(regcache::cooked_read): Likewise.
(regcache::cooked_read_value): Likewise.
(regcache_cooked_read_signed):
(regcache::cooked_read): Likewise.
* regcache.h (regcache_read): New class.
(regcache): Inherit regcache_read. Move some methods to
regcache_read.
* rl78-tdep.c (rl78_pseudo_register_read): Change
parameter type to 'regcache_read *'.
* rs6000-tdep.c (do_regcache_raw_read): Remove.
(e500_pseudo_register_read): Change parameter type to
'regcache_read *'.
(dfp_pseudo_register_read): Likewise.
(vsx_pseudo_register_read): Likewise.
(efpr_pseudo_register_read): Likewise.
* s390-linux-tdep.c (s390_pseudo_register_read): Likewise.
* sh-tdep.c (sh_pseudo_register_read): Likewise.
* sh64-tdep.c (pseudo_register_read_portions): Likewise.
(sh64_pseudo_register_read): Likewise.
* sparc-tdep.c (sparc32_pseudo_register_read): Likewise.
* sparc64-tdep.c (sparc64_pseudo_register_read): Likewise.
* spu-tdep.c (spu_pseudo_register_read_spu): Likewise.
(spu_pseudo_register_read): Likewise.
* xtensa-tdep.c (xtensa_register_read_masked): Likewise.
(xtensa_pseudo_register_read): Likewise.

dbf869c 2018-01-19 02:06:16 Yao Qi

Class reg_buffer

This patch adds a new class reg_buffer, and regcache inherits it. Class
reg_buffer is a very simple class, which has the buffer for register
contents and status only. It doesn't have any methods to set contents and
status, and it is expected that its children classes can inherit it and
add different access methods.

Another reason I keep class reg_buffer so simple is that I think
reg_buffer can be even reused in other classes which need to record the
registers contents and status, like frame cache for example.

gdb:

2017-11-27 Yao Qi <yao.qi@linaro.org>

* regcache.c (regcache::regcache): Call reg_buffer ctor.
(regcache::arch): Move it to reg_buffer::arch.
(regcache::register_buffer): Likewise.
(regcache::assert_regnum): Likewise.
(regcache::num_raw_registers): Likewise.
* regcache.h (reg_buffer): New class.
(regcache): Inherit reg_buffer.

426147a 2018-01-19 02:06:16 Yao Qi

regcache::cooked_write test

Since my following patches will change how each gdbarch read and write
pseudo registers, it's better to write a unit test to
regcache::cooked_write, to make sure my following changes don't cause
any regressions. See the comments on cooked_write_test.

gdb:

2017-11-27 Yao Qi <yao.qi@linaro.org>

* regcache.c (cooked_write_test): New function.
(_initialize_regcache): Register the test.

3c7ed66 2018-01-19 02:06:16 Yao Qi

regcache_cooked_read -> regcache->cooked_read

Similarly, this patch replaces regcache_cooked_read with
regcache->cooked_read.

gdb:

2017-11-29 Yao Qi <yao.qi@linaro.org>

* ia64-tdep.c (ia64_pseudo_register_read): Call
regcache->cooked_read instead of regcache_cooked_read_unsigned.
* m32c-tdep.c (m32c_cat_read): Likewise.
(m32c_r3r2r1r0_read): Likewise.
* m68hc11-tdep.c (m68hc11_pseudo_register_read): Likewise.
* xtensa-tdep.c (xtensa_register_read_masked): Likewise.

51e0d72 2018-01-19 02:06:15 Yao Qi

Replace regcache_raw_read with regcache->raw_read

The patch later in this series will move regcache's raw_read and
cooked_read methods to a new class regcache_read, and regcache is
dervied from it. Also pass regcache_read instead of regcache to gdbarch
methods pseudo_register_read and pseudo_register_read_value. In order
to prepare for this change, this patch changes regcache_raw_read to
regcache->raw_read. On the other hand, since we are in C++, I prefer
using class method (regcache->raw_read).

gdb:

2017-11-14 Yao Qi <yao.qi@linaro.org>

* aarch64-tdep.c (aarch64_pseudo_read_value): Call regcache
method raw_read instead of regcache_raw_read.
* amd64-tdep.c (amd64_pseudo_register_read_value): Likewise.
* arm-tdep.c (arm_neon_quad_read): Likewise.
* avr-tdep.c (avr_pseudo_register_read): Likewise.
* bfin-tdep.c (bfin_pseudo_register_read): Likewise.
* frv-tdep.c (frv_pseudo_register_read): Likewise.
* h8300-tdep.c (h8300_pseudo_register_read): Likewise.
* i386-tdep.c (i386_mmx_regnum_to_fp_regnum): Likewise.
(i386_pseudo_register_read_into_value): Likewise.
* mep-tdep.c (mep_pseudo_cr32_read): Likewise.
* msp430-tdep.c (msp430_pseudo_register_read): Likewise.
* nds32-tdep.c (nds32_pseudo_register_read): Likewise.
* rl78-tdep.c (rl78_pseudo_register_read): Likewise.
* s390-linux-tdep.c (s390_pseudo_register_read): Likewise.
* sparc-tdep.c (sparc32_pseudo_register_read): Likewise.
* sparc64-tdep.c (sparc64_pseudo_register_read): Likewise.
* spu-tdep.c (spu_pseudo_register_read_spu): Likewise.
* xtensa-tdep.c (xtensa_pseudo_register_read): Likewise.

c986167 2018-01-19 02:06:15 Yao Qi

Remove mt port

This patch removes the MT port. The removal was annoucned
https://sourceware.org/ml/gdb-announce/2017/msg00006.html
I'll remove MT from the top-level configure later.

gdb:

2017-11-27 Yao Qi <yao.qi@linaro.org>

* Makefile.in (ALL_TARGET_OBS): Remove mt-tdep.o.
* configure.tgt: Remove target mt.
* mt-tdep.c: Remove.
* regcache.c (cooked_read_test): Remove the check for mt.

0194994 2018-01-19 02:06:15 Yao Qi

Don't call gdbarch_pseudo_register_read_value in jit.c

gdbarch_pseudo_register_read_value is not implemented in every gdbarch, so
the predicate gdbarch_pseudo_register_read_value_p is needed before
calling it. However, there is no such guard in jit_frame_prev_register, I
am wondering how does jit work on the arch without having gdbarch method
pseudo_register_read_value.

The proper way to get register value is to call cooked_read, and then
create the value object from the buffer.

gdb:

2017-11-01 Yao Qi <yao.qi@linaro.org>

* jit.c (jit_frame_prev_register): Call regcache::cooked_read
instead of gdbarch_pseudo_register_read_value.

4a17f76 2018-01-19 00:29:31 Yao Qi

Make abbrev_table::abbrevs private

abbrev_table::abbrevs is only access within abbrev_table's methods, so
it can be private. Add "m_" prefix.

gdb:

2018-01-18 Yao Qi <yao.qi@linaro.org>

* dwarf2read.c (abbrev_table) <abbrevs>: Rename it to
m_abbrevs.
(abbrev_table::add_abbrev): Update.
(abbrev_table::lookup_abbrev): Update.

d679c21 2018-01-18 21:21:01 Yao Qi

Call cooked_read in ppu2spu_prev_register

The code in ppu2spu_prev_register is in fact regcache_cooked_read,
because spu doesn't have gdbarch method pseudo_register_read_value.

gdb:

2018-01-18 Yao Qi <yao.qi@linaro.org>

* ppc-linux-tdep.c (ppu2spu_prev_register): Call cooked_read.

691d2e9 2018-01-18 20:55:21 Alan Modra

PowerPC PLT stub alignment fixes

Asking for ppc32 plt call stubs to be aligned at 32 byte boundaries
didn't quite work. For ld.bfd they were spaced 32 bytes apart, but
only started on a 16 byte boundary. ld.gold also didn't get it right.

Finding that bug made me check over the ppc64 plt stub alignment,
where I found that negative values for alignment (meaning align to
minimize boundary crossing) were not accepted. Since no one has
complained about that, I guess I could have removed the feature from
ld.bfd documentation, but I've opted instead to correct the code.

I've also added an optional alignment paramenter for ppc32
--plt-align, for some consistency with gold and ppc64 ld.bfd.

bfd/
* elf32-ppc.c (ppc_elf_create_glink): Correct alignment of .glink.
* elf64-ppc.c (ppc64_elf_size_stubs): Handle negative plt_stub_align.
(ppc64_elf_build_stubs): Likewise.
gold/
* powerpc.cc (param_plt_align): New function supplying default
--plt-align values. Use it..
(Stub_table::plt_call_align): ..here, and..
(Output_data_glink::global_entry_align): ..here.
(Stub_table::stub_align): Correct 32-bit minimum alignment.
ld/
* emultempl/ppc32elf.em: Support optional --plt-align arg.
* emultempl/ppc64elf.em: Support negative --plt-align arg.

7ab8203 2018-01-18 18:38:59 Nick Clifton

Update Bulgarian translation of the binutils sub-directory

2f89d95 2018-01-18 09:00:24 GDB Administrator

Automatic date update in version.in

7d937ca 2018-01-18 08:05:42 Sergio Durigan Junior

Fix warning on gdb/compile/compile.c (C++-ify "triplet_rx")

This fixes a GCC warning that happens when compiling
gdb/compile/compile.c on some GCC versions (e.g., "gcc (GCC) 7.2.1
20180104 (Red Hat 7.2.1-6)"):

../../gdb/compile/compile.c: In function 'void eval_compile_command(command_line*, const char*, compile_i_scope_types, void*)':
../../gdb/compile/compile.c:548:19: warning: 'triplet_rx' may be used uninitialized in this function [-Wmaybe-uninitialized]
error_message = compiler->fe->ops->set_arguments_v0 (compiler->fe, triplet_rx,
~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
argc, argv);
~~~~~~~~~~~
../../gdb/compile/compile.c:466:9: note: 'triplet_rx' was declared here
char *triplet_rx;
^~~~~~~~~~

It's a simple patch that converts "triplet_rx" from "char *" to
"std::string", thus guaranteeing that it will be always initialized.

I've regtested this patch and did not find any regressions. OK to
apply on both master and 8.1 (after creating a bug for it)?

gdb/ChangeLog:
2018-01-17 Sergio Durigan Junior <sergiodj@redhat.com>

* compile/compile.c (compile_to_object): Convert "triplet_rx"
to "std::string".

e925c83 2018-01-18 07:04:16 Jim Wilson

RISC-V: Fix bug in prior addi/c.nop patch.

gas/
* config/tc-riscv.c (validate_riscv_insn) <'z'>: New.
(riscv_ip) <'z'>: New.
opcodes/
* riscv-opc.c (riscv_opcodes) <addi>: Use z instead of 0.

9e14690 2018-01-18 03:28:44 Tom Tromey

Remove symbolp typedef

This removes the symbolp typedef from dwarf2read.c. It is no longer
used.

2018-01-17 Tom Tromey <tom@tromey.com>

* dwarf2read.c (symbolp): Remove typedef. Don't instantiate VEC.

50a8204 2018-01-18 03:28:44 Tom Tromey

Remove objfile argument from add_dyn_prop

The objfile argument to add_dyn_prop is redundant, so this patch
removes it.

2018-01-17 Tom Tromey <tom@tromey.com>

* gdbtypes.h (add_dyn_prop): Remove objfile parameter.
* gdbtypes.c (add_dyn_prop): Remove objfile parameter.
(create_array_type_with_stride): Update.
* dwarf2read.c (set_die_type): Update.

c89b44c 2018-01-18 03:28:44 Tom Tromey

Change dwarf2_cu::method_info to be a std::vector

This changes the type of dwarf2_cu::method_info and fixes up the uses.
In order to remove cleanups from process_full_comp_unit and
process_full_type_unit, psymtab_include_file_name also had to be
changed to avoid leaving dangling cleanups.

2018-01-17 Tom Tromey <tom@tromey.com>

* dwarf2read.c (delayed_method_info): Remove typedef.
(dwarf2_cu::method_info): Now a std::vector.
(add_to_method_list): Update.
(free_delayed_list): Remove.
(compute_delayed_physnames): Update.
(process_full_comp_unit, process_full_type_unit): Clear the method
list. Remove cleanups.
(psymtab_include_file_name): Add name_holder parameter. Use
unique_xmalloc_ptr.
(dwarf_decode_lines): Update.

fcd3b13 2018-01-18 03:28:44 Simon Marchi

Allocate dwarf2_cu with new

This changes dwarf2_cu to be allocated with new, and fixes up the
users.

2018-01-17 Tom Tromey <tom@tromey.com>
Simon Marchi <simon.marchi@ericsson.com>

* dwarf2read.c (struct dwarf2_cu): Add constructor, destructor.
(dwarf2_per_objfile::free_cached_comp_units)
(init_tu_and_read_dwo_dies, init_cutu_and_read_dies)
(init_cutu_and_read_dies_no_follow): Update.
(dwarf2_cu::dwarf2_cu): Rename from init_one_comp_unit.
(dwarf2_cu::~dwarf2_cu): New.
(free_heap_comp_unit, free_stack_comp_unit): Remove.
(age_cached_comp_units, free_one_cached_comp_unit): Update.

685af9c 2018-01-18 03:28:44 Tom Tromey

Allocate abbrev_table with new

This changes dwarf2read.c to allocate abbrev tables using "new", and
then updates the users.

This version of the patch incorporates the changes that Simon
implemented. These changes simplify the ownership rules for abbrev
tables.

2018-01-17 Tom Tromey <tom@tromey.com>
Simon Marchi <simon.marchi@ericsson.com>

* dwarf2read.c (struct dwarf2_cu) <abbrev_table>: Remove.
(struct die_reader_specs) <abbrev_table>: New member.
(struct abbrev_table): Add constructor.
<alloc_abbrev, add_abbrev, lookup_abbrev>: Declare.
<abbrev_obstack>: Now an auto_obstack.
(abbrev_table_up): New typedef.
(init_cu_die_reader): Add abbrev_table parameter.
(read_cutu_die_from_dwo): Remove abbrev_table_provided parameter.
Add result_dwo_abbrev_table.
(init_tu_and_read_dwo_dies, init_cutu_and_read_dies)
(init_cutu_and_read_dies_no_follow, build_type_psymtabs_1):
Update.
(peek_die_abbrev): Take die_reader_specs, not dwarf_cu as
parameter.
(skip_children): Update.
(abbrev_table::alloc_abbrev): Rename from
abbrev_table_alloc_abbrev.
(abbrev_table::add_abbrev): Rename from abbrev_table_add_abbrev.
(abbrev_table::lookup_abbrev): Rename from
abbrev_table_lookup_abbrev.
(abbrev_table_read_table): Return abbrev_table_up.
(abbrev_table_free, abbrev_table_free_cleanup)
(dwarf2_read_abbrevs, dwarf2_free_abbrev_table): Remove.
(load_partial_dies): Update.

5e2db40 2018-01-18 03:28:44 Tom Tromey

Unify new_symbol and new_symbol_full

This patch unifies new_symbol with new_symbol_full, replacing a
wrapper function with a default parameter.

2018-01-17 Tom Tromey <tom@tromey.com>

* dwarf2read.c (dwarf2_compute_name): Update comment.
(read_func_scope, read_variable): Update.
(new_symbol): Remove.
(new_symbol_full): Rename to new_symbol.

ee7f689 2018-01-18 02:59:51 Simon Marchi

Fix ChangeLog dates of previous commit

4166753 2018-01-18 02:54:59 Mike Gulick

Fix gdb segv when objfile can't be opened

This fixes PR 16577.

This patch changes gdb_bfd_map_section to issue a warning rather than an error
if it is unable to read the object file, and sets the size of the section/frame
that it attempted to read to 0 on error.

The description of gdb_bfd_map_section states that it will try to read or map
the contents of the section SECT, and if successful, the section data is
returned and *SIZE is set to the size of the section data. This function was
throwing an error and leaving *SIZE as-is. Setting the section size to 0
indicates to dwarf2_build_frame_info that there is no data to read, otherwise
it will try to read from an invalid frame pointer.

Changing the error to a warning allows this to be handled gracefully.
Additionally, the error was clobbering the breakpoint output indicating the
current frame (function name, arguments, source file, and line number). E.g.

Thread 3 "foo" hit Breakpoint 1, BFD: reopening /tmp/jna-1013829440/jna2973250704389291330.tmp: No such file or directory
BFD: reopening /tmp/jna-1013829440/jna2973250704389291330.tmp: No such file or directory
(gdb)

While the "BFD: reopening ..." messages will still appear interspersed in the
breakpoint output, the current frame info is now displayed:

Thread 3 "foo" hit Breakpoint 1, BFD: reopening /tmp/jna-1013829440/jna1875755897659885075.tmp: No such file or directory
BFD: reopening /tmp/jna-1013829440/jna1875755897659885075.tmp: No such file or directory
warning: Can't read data for section '.eh_frame' in file '/tmp/jna-1013829440/jna1875755897659885075.tmp'
do_something () at file.cpp:80
80 {
(gdb)

4d9b86e 2018-01-18 02:34:50 Simon Marchi

Make linux_ptrace_attach_fail_reason return an std::string

This patch makes linux_ptrace_attach_fail_reason and
linux_ptrace_attach_fail_reason_string return std::string. It also
replaces usages of struct buffer with std::string. This allows getting
rid of a cleanup in in linux_ptrace_attach_fail_reason_string and
simplifies the code in general.

Something that looks odd to me is that in
linux_ptrace_attach_fail_reason, if the two messages are appended, there
is no separating space or \n, so the result won't be very nice. I left
it as-is for now though.

gdb/ChangeLog:

* nat/linux-ptrace.h (linux_ptrace_attach_fail_reason): Return
std::string.
(linux_ptrace_attach_fail_reason_string): Likewise.
* nat/linux-ptrace.c (linux_ptrace_attach_fail_reason):
Likewise.
(linux_ptrace_attach_fail_reason_string): Likewise.
* linux-nat.c (attach_proc_task_lwp_callback): Adjust.

gdb/gdbserver/ChangeLog:

* linux-low.c (attach_proc_task_lwp_callback): Adjust to
linux_ptrace_attach_fail_reason_string now returning an
std::string.
(linux_attach): Likewise.
* thread-db.c (attach_thread): Likewise.