From: Tom de Vries <tdevries@suse.de>
To: Simon Marchi <simon.marchi@efficios.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH v2 00/42] Share DWARF partial symtabs between objfiles
Date: Wed, 13 May 2020 12:17:52 +0200 [thread overview]
Message-ID: <d57e3873-1b94-4bf6-dac1-6fa6a5d1d75e@suse.de> (raw)
In-Reply-To: <20200512210913.5593-1-simon.marchi@efficios.com>
On 12-05-2020 23:08, Simon Marchi via Gdb-patches wrote:
> This is version 2 of this patchset originally written by Tom:
>
> https://sourceware.org/legacy-ml/gdb-patches/2020-02/msg00594.html
>
> The current patchset therefore contains a mix of Tom's patches that I modified,
> plus a few new patches. I won't repeat everything that is said in the cover
> letter of that patchset, please read that to understand the motivation behind
> this change..
>
> The big difference between v1 and v2 is how the split is done. In v1, the
> object structure looks like this:
>
> objfile -> dwarf2_per_objfile -> dwarf2_unshareable
>
> where `dwarf2_per_objfile` is actually shared between objfiles (there is one
> copy per BFD), and `dwarf2_unshareable` is not (there is one copy per objfile).
> The dwarf2_per_objfile -> dwarf2_unshareable link is updated at all entry
> points of the DWARF code based on what is the current objfile.
>
> The current patchset (v2) proposes this structure instead, which in my opinion
> is more natural:
>
> objfile -> dwarf2_per_objfile -> dwarf2_per_bfd
>
> Where `dwarf2_per_objfile` is really per-objfile (there is one copy per
> objfile) and `dwarf2_per_bfd` is per-bfd (there is one copy per-bfd). There is
> no link to update, whatever is shared between objfiles is put in
> `dwarf2_per_bfd` and each `dwarf2_per_objfile` always points to one
> `dwarf2_per_bfd`.
>
> Since there were performance numbers with the original patchset, I made my own
> here to see if the speedups were still there. Like in the original patchset, I
> set "maintenance time 1" and did "add-inferior -exec ./gdb" after "./gdb gdb".
> I disabled any auto-loading to avoid loading gdb-gdb.{gdb,py}. GDB is built
> with -O2 and gcc 9, and it is running on an AMD EPYC 7351P.
>
> Before: Command execution time: 1.213480 (cpu), 1.214268 (wall)
> After: Command execution time: 0.001697 (cpu), 0.001694 (wall)
>
> These are the times of one run, but all runs I did are very close. The "after"
> time is surpringly low compared to the original numbers, I hope it doesn't mean
> I messed up something and we are skipping something important...
>
> At some point I tested with all these boards and did not see any regression
> (they helped very much to find some issues in the process though):
>
> unix cc-with-debug-names cc-with-dwz cc-with-dwz-m cc-with-gdb-index dwarf4-gdb-index fission-dwp fission readnow
>
> I have since rebased the patchset and resolved conflicts, it's therefore
> possible I messed something up.
>
Hi, I applied the patch series on top of commit 90d00bbd9c "Sync config
and libiberty with GCC", and ran into the following:
...
(gdb) PASS: gdb.ada/variant.exp: scenario=minimal: print nav1
print nav2^M
ERROR: GDB process no longer exists
GDB process exited with wait status 8901 exp9 0 0 CHILDKILLED SIGABRT
SIGABRT
UNRESOLVED: gdb.ada/variant.exp: scenario=minimal: print nav2
...
Reproduced on command line using:
...
$ gdb -batch ./outputs/gdb.ada/variant/pkg \
-ex 'break pkg.adb:40' \
-ex run \
-ex 'print nav2'
Breakpoint 1 at 0x403047: file gdb/testsuite/gdb.ada/variant/pkg.adb,
line 40.
Breakpoint 1, pkg () at gdb/testsuite/gdb.ada/variant/pkg.adb:40
40 null; -- STOP
Aborted (core dumped)
...
Using gdb, we get more info:
...
Thread 1 "gdb" received signal SIGSEGV, Segmentation fault.
0x00000000005b9d02 in dwarf2_locexpr_baton_eval (dlbaton=0x7fffffffc608,
frame=0x15c75f0,
addr_stack=0x7fffffffc790, valp=0x7fffffffc638, push_initial_value=true)
at /data/gdb_versions/devel/src/gdb/dwarf2/loc.c:2490
2490 ctx.gdbarch = per_objfile->objfile->arch ();
...
The problem seems to be:
...
(gdb) p per_objfile
$1 = (dwarf2_per_objfile *) 0xffffffffffffffff
...
Backtrace:
...
(gdb) bt
#0 0x00000000005b9d02 in dwarf2_locexpr_baton_eval
(dlbaton=0x7fffffffc608, frame=0x15c75f0,
addr_stack=0x7fffffffc790, valp=0x7fffffffc638, push_initial_value=true)
at /data/gdb_versions/devel/src/gdb/dwarf2/loc.c:2490
#1 0x00000000005ba007 in dwarf2_evaluate_property (prop=0x7fffffffc640,
frame=0x15c75f0,
addr_stack=0x7fffffffc790, value=0x7fffffffc638,
push_initial_value=true)
at /data/gdb_versions/devel/src/gdb/dwarf2/loc.c:2562
#2 0x0000000000672aff in resolve_dynamic_struct (type=0x1b25660,
addr_stack=0x7fffffffc790)
at /data/gdb_versions/devel/src/gdb/gdbtypes.c:2480
#3 0x000000000067309c in resolve_dynamic_type_internal (type=0x1b25660,
addr_stack=0x7fffffffc790, top_level=1)
at /data/gdb_versions/devel/src/gdb/gdbtypes.c:2613
#4 0x0000000000673225 in resolve_dynamic_type (type=0x1b25660,
valaddr=..., addr=4255376)
at /data/gdb_versions/devel/src/gdb/gdbtypes.c:2649
#5 0x00000000009b1918 in value_from_contents_and_address
(type=0x1b25660, valaddr=0x0, address=4255376)
at /data/gdb_versions/devel/src/gdb/value.c:3483
#6 0x0000000000999f9c in get_value_at (type=0x1b25660, addr=4255376,
lazy=1)
at /data/gdb_versions/devel/src/gdb/valops.c:899
#7 0x000000000099a00a in value_at_lazy (type=0x1b25660, addr=4255376)
at /data/gdb_versions/devel/src/gdb/valops.c:936
#8 0x000000000064dc01 in default_read_var_value (var=0x1b256c0,
var_block=0x1b25760, frame=0x0)
at /data/gdb_versions/devel/src/gdb/findvar.c:800
#9 0x000000000043a2f2 in ada_read_var_value (var=0x1b256c0,
var_block=0x1b25760, frame=0x0)
at /data/gdb_versions/devel/src/gdb/ada-lang.c:14061
#10 0x000000000064dccd in read_var_value (var=0x1b256c0,
var_block=0x1b25760, frame=0x0)
at /data/gdb_versions/devel/src/gdb/findvar.c:815
#11 0x000000000099acf3 in value_of_variable (var=0x1b256c0, b=0x1b25760)
--Type <RET> for more, q to quit, c to continue without paging--
at /data/gdb_versions/devel/src/gdb/valops.c:1293
#12 0x000000000062ddd8 in evaluate_var_value
(noside=EVAL_AVOID_SIDE_EFFECTS, blk=0x1b25760, var=0x1b256c0)
at /data/gdb_versions/devel/src/gdb/eval.c:716
#13 0x000000000062f4e3 in evaluate_subexp_standard (expect_type=0x0,
exp=0x1bcf8c0, pos=0x7fffffffd1c4,
noside=EVAL_AVOID_SIDE_EFFECTS) at
/data/gdb_versions/devel/src/gdb/eval.c:1319
#14 0x000000000043232e in ada_evaluate_subexp (expect_type=0x0,
exp=0x1bcf8c0, pos=0x7fffffffd1c4,
noside=EVAL_AVOID_SIDE_EFFECTS) at
/data/gdb_versions/devel/src/gdb/ada-lang.c:10656
#15 0x000000000062ca12 in evaluate_subexp (expect_type=0x0,
exp=0x1bcf8c0, pos=0x7fffffffd1c4,
noside=EVAL_AVOID_SIDE_EFFECTS) at
/data/gdb_versions/devel/src/gdb/eval.c:77
#16 0x000000000042f787 in evaluate_subexp_type (exp=0x1bcf8c0,
pos=0x7fffffffd1c4)
at /data/gdb_versions/devel/src/gdb/ada-lang.c:9417
#17 0x0000000000423e80 in resolve_subexp (expp=0x7fffffffd418,
pos=0x7fffffffd1c4, deprocedure_p=1,
context_type=0x0, parse_completion=0, tracker=0x7fffffffd2f0)
at /data/gdb_versions/devel/src/gdb/ada-lang.c:3826
#18 0x0000000000422fd2 in resolve (expp=0x7fffffffd418,
void_context_p=0, parse_completion=0,
tracker=0x7fffffffd2f0) at
/data/gdb_versions/devel/src/gdb/ada-lang.c:3463
#19 0x00000000007bd06c in parse_exp_in_context
(stringptr=0x7fffffffd3d0, pc=0, block=0x0, comma=0,
void_context_p=0, out_subexp=0x0, tracker=0x7fffffffd2f0, cstate=0x0)
at /data/gdb_versions/devel/src/gdb/parse.c:1149
#20 0x00000000007bcd28 in parse_exp_1 (stringptr=0x7fffffffd3d0, pc=0,
block=0x0, comma=0, tracker=0x0)
at /data/gdb_versions/devel/src/gdb/parse.c:1031
#21 0x00000000007bd1cf in parse_expression (string=0x7fffffffe0fb
"nav2", tracker=0x0)
at /data/gdb_versions/devel/src/gdb/parse.c:1167
#22 0x00000000007c04b6 in print_command_1 (args=0x7fffffffe0fb "nav2",
voidprint=1)
at /data/gdb_versions/devel/src/gdb/printcmd.c:1214
--Type <RET> for more, q to quit, c to continue without paging--
#23 0x00000000007c062c in print_command (exp=0x7fffffffe0fb "nav2",
from_tty=0)
at /data/gdb_versions/devel/src/gdb/printcmd.c:1244
#24 0x00000000004fdf16 in do_const_cfunc (c=0x19cca60,
args=0x7fffffffe0fb "nav2", from_tty=0)
at /data/gdb_versions/devel/src/gdb/cli/cli-decode.c:107
#25 0x000000000050103f in cmd_func (cmd=0x19cca60, args=0x7fffffffe0fb
"nav2", from_tty=0)
at /data/gdb_versions/devel/src/gdb/cli/cli-decode.c:2004
#26 0x000000000091bcf5 in execute_command (p=0x7fffffffe0fe "2", from_tty=0)
at /data/gdb_versions/devel/src/gdb/top.c:655
#27 0x0000000000746633 in catch_command_errors (command=0x91b889
<execute_command(char const*, int)>,
arg=0x7fffffffe0f5 "print nav2", from_tty=0) at
/data/gdb_versions/devel/src/gdb/main.c:457
#28 0x0000000000747a1b in captured_main_1 (context=0x7fffffffd9e0)
at /data/gdb_versions/devel/src/gdb/main.c:1219
#29 0x0000000000747c10 in captured_main (data=0x7fffffffd9e0) at
/data/gdb_versions/devel/src/gdb/main.c:1244
#30 0x0000000000747c7b in gdb_main (args=0x7fffffffd9e0) at
/data/gdb_versions/devel/src/gdb/main.c:1269
#31 0x000000000041520e in main (argc=14, argv=0x7fffffffdae8) at
/data/gdb_versions/devel/src/gdb/gdb.c:32
...
Thanks,
- Tom
next prev parent reply other threads:[~2020-05-13 10:17 UTC|newest]
Thread overview: 92+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-12 21:08 Simon Marchi
2020-05-12 21:08 ` [PATCH v2 01/42] Introduce dwarf2_per_objfile::obstack Simon Marchi
2020-05-12 21:08 ` [PATCH v2 02/42] Add "objfile" parameter to two partial_symtab methods Simon Marchi
2020-05-12 21:08 ` [PATCH v2 03/42] Add dwarf2_per_cu_data::index Simon Marchi
2020-05-12 21:08 ` [PATCH v2 04/42] Add dwarf2_per_objfile member to DWARF batons Simon Marchi
2020-05-12 21:08 ` [PATCH v2 05/42] Split dwarf2_per_objfile into dwarf2_per_objfile and dwarf2_per_bfd Simon Marchi
2020-05-12 21:08 ` [PATCH v2 06/42] Remove symtab links from dwarf2_psymtab and dwarf2_per_cu_quick_data Simon Marchi
2020-05-12 21:08 ` [PATCH v2 07/42] Move die_type_hash to dwarf2_per_objfile Simon Marchi
2020-05-12 21:08 ` [PATCH v2 08/42] Add dwarf2_per_objfile field to dwarf2_cu Simon Marchi
2020-05-12 21:08 ` [PATCH v2 09/42] Remove reference to dwarf2_per_cu_data::dwarf2_per_objfile in dw2_do_instantiate_symtab Simon Marchi
2020-05-12 21:11 ` [PATCH v2 10/42] Remove dwarf2_cu->per_cu->dwarf2_per_objfile references Simon Marchi
2020-05-12 21:11 ` [PATCH v2 11/42] Add dwarf2_per_bfd field to dwarf2_per_cu_data Simon Marchi
2020-05-12 21:11 ` [PATCH v2 12/42] Make dwarf2_get_dwz_file take a dwarf2_per_bfd Simon Marchi
2020-05-12 21:11 ` [PATCH v2 13/42] Use bfd_get_filename instead of objfile_name in lookup_dwo_unit Simon Marchi
2020-05-12 21:11 ` [PATCH v2 14/42] Add dwarf2_per_objfile parameter to cutu_reader's constructors Simon Marchi
2020-05-12 21:11 ` [PATCH v2 15/42] Make queue_and_load_dwo_tu receive a dwarf2_cu Simon Marchi
2020-05-22 20:45 ` Tom Tromey
2020-05-25 19:10 ` Simon Marchi
2020-05-12 21:11 ` [PATCH v2 16/42] Remove dwarf2_per_cu_data::dwarf2_per_objfile reference in cutu_reader::keep Simon Marchi
2020-05-12 21:11 ` [PATCH v2 17/42] Add dwarf2_per_objfile parameter to create_partial_symtab Simon Marchi
2020-05-12 21:11 ` [PATCH v2 18/42] Add dwarf2_per_objfile parameter to recursively_compute_inclusions Simon Marchi
2020-05-12 21:11 ` [PATCH v2 19/42] Add dwarf2_per_objfile parameter to process_full_{comp, type}_unit Simon Marchi
2020-05-12 21:12 ` [PATCH v2 20/42] Pass dwarf2_cu objects to dwo-related functions, instead of dwarf2_per_cu_data Simon Marchi
2020-05-12 21:12 ` [PATCH v2 21/42] Remove reference to dwarf2_per_cu_data::dwarf2_per_objfile in queue_and_load_all_dwo_tus Simon Marchi
2020-05-12 21:12 ` [PATCH v2 22/42] Move int type methods out of dwarf2_per_cu_data Simon Marchi
2020-05-12 21:12 ` [PATCH v2 23/42] Add dwarf2_per_objfile to dwarf_expr_context and dwarf2_frame_cache Simon Marchi
2020-05-22 21:04 ` Tom Tromey
2020-05-25 19:50 ` Simon Marchi
2020-05-28 1:44 ` Simon Marchi
2020-05-12 21:12 ` [PATCH v2 24/42] Remove dwarf2_per_cu_data::text_offset Simon Marchi
2020-05-12 21:12 ` [PATCH v2 25/42] Add dwarf2_per_objfile parameter to dwarf2_read_addr_index Simon Marchi
2020-05-12 21:12 ` [PATCH v2 26/42] Add dwarf2_per_objfile parameter to allocate_piece_closure Simon Marchi
2020-05-12 21:12 ` [PATCH v2 27/42] Add dwarf2_per_objfile parameters to dwarf2_fetch_* functions Simon Marchi
2020-05-12 21:12 ` [PATCH v2 28/42] Remove dwarf2_per_cu_data::objfile () Simon Marchi
2020-05-27 16:27 ` Tom de Vries
2020-05-27 16:52 ` Tom de Vries
2020-05-27 20:03 ` Simon Marchi
2020-05-27 21:08 ` Tom de Vries
2020-05-27 21:55 ` Simon Marchi
2020-05-27 22:16 ` Simon Marchi
2020-05-28 2:00 ` Simon Marchi
2020-05-28 13:05 ` Tom de Vries
2020-05-28 15:33 ` Simon Marchi
2020-05-28 16:24 ` Christian Biesinger
2020-05-28 16:52 ` Simon Marchi
2020-05-28 19:49 ` Simon Marchi
2020-05-12 21:12 ` [PATCH v2 29/42] Add dwarf2_per_objfile parameter to free_one_cached_comp_unit Simon Marchi
2020-05-12 21:17 ` [PATCH v2 30/42] Add dwarf2_per_objfile parameter to get_die_type_at_offset Simon Marchi
2020-05-12 21:17 ` [PATCH v2 31/42] Remove leftover references to dwarf2_per_cu_data::dwarf2_per_objfile Simon Marchi
2020-05-12 21:17 ` [PATCH v2 32/42] Remove dwarf2_per_cu_data::dwarf2_per_objfile Simon Marchi
2020-05-12 21:17 ` [PATCH v2 33/42] Split type_unit_group Simon Marchi
2020-05-13 9:54 ` Tom de Vries
2020-05-13 15:06 ` Simon Marchi
2020-05-12 21:17 ` [PATCH v2 34/42] Move signatured_type::type to unshareable object Simon Marchi
2020-05-12 21:17 ` [PATCH v2 35/42] Pass dwarf2_per_bfd instead of dwarf2_per_objfile to some index-related functions Simon Marchi
2020-05-12 21:17 ` [PATCH v2 36/42] Pass dwarf2_cu to process_full_{comp,type}_unit Simon Marchi
2020-05-12 21:17 ` [PATCH v2 37/42] Make load_cu return the loaded dwarf2_cu Simon Marchi
2020-05-12 21:17 ` [PATCH v2 38/42] Add comp_unit_head to dwarf2_per_cu_data Simon Marchi
2020-05-12 21:17 ` [PATCH v2 39/42] Pass existing_cu object to cutu_reader Simon Marchi
2020-05-22 20:57 ` Tom Tromey
2020-05-25 19:10 ` Simon Marchi
2020-05-12 21:18 ` [PATCH v2 40/42] Replace dwarf2_per_cu_data::cu backlink with per-objfile map Simon Marchi
2020-05-12 21:18 ` [PATCH v2 41/42] Make mapped_debug_names independent of objfile Simon Marchi
2020-05-22 21:01 ` Tom Tromey
2020-05-25 19:53 ` Simon Marchi
2020-05-12 21:18 ` [PATCH v2 42/42] Share DWARF partial symtabs Simon Marchi
2020-05-13 10:17 ` Tom de Vries [this message]
2020-05-13 15:46 ` [PATCH v2 00/42] Share DWARF partial symtabs between objfiles Simon Marchi
2020-05-22 21:02 ` Tom Tromey
2020-05-25 19:53 ` Simon Marchi
2020-05-13 14:52 ` Simon Marchi
2020-05-22 21:07 ` Tom Tromey
2020-05-23 12:24 ` Pedro Alves
2020-05-25 19:56 ` Simon Marchi
2020-05-26 11:17 ` Pedro Alves
2020-05-26 15:35 ` Simon Marchi
2020-05-26 21:34 ` Simon Marchi
2020-05-27 5:08 ` Simon Marchi
2020-05-27 14:53 ` Simon Marchi
2020-05-27 15:51 ` Simon Marchi
2020-05-29 10:23 ` Tom de Vries
2020-05-29 12:55 ` Tom de Vries
2020-05-31 4:16 ` Simon Marchi
2020-05-31 14:22 ` Tom de Vries
2020-06-02 21:27 ` Simon Marchi
2020-06-04 17:55 ` Tom de Vries
2020-06-04 18:04 ` Simon Marchi
2020-06-10 3:43 ` Simon Marchi
2020-06-12 3:25 ` Tom Tromey
2020-05-27 14:50 ` [PATCH v2 41.5/42] Move line_header_hash to dwarf2_per_objfile Simon Marchi
2020-05-27 15:07 ` Tom Tromey
2020-05-27 15:10 ` Simon Marchi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d57e3873-1b94-4bf6-dac1-6fa6a5d1d75e@suse.de \
--to=tdevries@suse.de \
--cc=gdb-patches@sourceware.org \
--cc=simon.marchi@efficios.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox