Discussion:
[binutils-gdb] dwarf: Make sect_offset 64-bits
(too old to reply)
sergiodj+
2018-02-23 18:26:25 UTC
Permalink
*** TEST RESULTS FOR COMMIT 9d8780f0d0f53d9d326a9d64b7919fe1a628b767 ***

Author: Simon Marchi <***@polymtl.ca>
Branch: master
Commit: 9d8780f0d0f53d9d326a9d64b7919fe1a628b767

dwarf: Make sect_offset 64-bits

Does anybody have an opinion about this? It would be nice to unbreak
the "default" build with clang (i.e. without passing special -Wno-error=
flags).

Here's a version rebased on today's master.
From 47d28075117fa2ddb93584ec50881e33777a85e5 Mon Sep 17 00:00:00 2001
From: Simon Marchi <***@ericsson.com>
Date: Sat, 30 Dec 2017 22:48:18 -0500
Subject: [PATCH] dwarf: Make sect_offset 64-bits

Compiling with Clang 6 shows these errors:

/home/emaisin/src/binutils-gdb/gdb/dwarf2read.c:26610:43: error: result of comparison of constant 4294967296 with expression of type 'typename std::underlying_type<sect_offset>::type' (a
ka 'unsigned int') is always false [-Werror,-Wtautological-constant-out-of-range-compare]
if (to_underlying (per_cu.sect_off) >= (static_cast<uint64_t> (1) << 32))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/emaisin/src/binutils-gdb/gdb/dwarf2read.c:26618:43: error: result of comparison of constant 4294967296 with expression of type 'typename std::underlying_type<sect_offset>::type' (a
ka 'unsigned int') is always false [-Werror,-Wtautological-constant-out-of-range-compare]
if (to_underlying (per_cu.sect_off) >= (static_cast<uint64_t> (1) << 32))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The code in question checks if there is any offset exceeding 32 bits,
and therefore if we need to use the 64-bit DWARF format when writing the
.debug_names section. The type we use currently to represent section
offsets is an unsigned int (32-bits), which means a value of this type
will never exceed 32 bits, hence the errors above.

There are many signs that we want to support 64-bits DWARF (although I
haven't tested), such as:

- We correctly read initial length fields (read_initial_length)
- We take that into account when reading offsets (read_offset_1)
- The check_dwarf64_offsets function

However, I don't see how it can work if sect_offset is a 32-bits type.
Every time we record a section offset, we risk truncating the value.
And if a file uses the 64-bit DWARF format, it's most likely because
there are such offset values that overflow 32 bits.

Because of this, I think the way forward is to change sect_offset to be
a uint64_t. It will be able to represent any offset, regardless of the
bitness of the DWARF info.

This patch was regtested on the buildbot.

gdb/ChangeLog:

* gdbtypes.h (sect_offset): Change type to uint64_t.
(sect_offset_str): New function.
* dwarf2read.c (create_addrmap_from_aranges): Use
sect_offset_str.
(error_check_comp_unit_head): Likewise.
(create_debug_type_hash_table): Likewise.
(read_cutu_die_from_dwo): Likewise.
(init_cutu_and_read_dies): Likewise.
(init_cutu_and_read_dies_no_follow): Likewise.
(process_psymtab_comp_unit_reader): Likewise.
(partial_die_parent_scope): Likewise.
(peek_die_abbrev): Likewise.
(process_queue): Likewise.
(dwarf2_physname): Likewise.
(read_namespace_alias): Likewise.
(read_import_statement): Likewise.
(create_dwo_cu_reader): Likewise.
(create_cus_hash_table): Likewise.
(lookup_dwo_cutu): Likewise.
(inherit_abstract_dies): Likewise.
(read_func_scope): Likewise.
(read_call_site_scope): Likewise.
(dwarf2_add_member_fn): Likewise.
(read_common_block): Likewise.
(read_module_type): Likewise.
(read_typedef): Likewise.
(read_subrange_type): Likewise.
(load_partial_dies): Likewise.
(read_partial_die): Likewise.
(find_partial_die): Likewise.
(read_str_index): Likewise.
(dwarf2_string_attr): Likewise.
(build_error_marker_type): Likewise.
(lookup_die_type): Likewise.
(dump_die_shallow): Likewise.
(follow_die_ref): Likewise.
(dwarf2_fetch_die_loc_sect_off): Likewise.
(dwarf2_fetch_constant_bytes): Likewise.
(follow_die_sig): Likewise.
(get_signatured_type): Likewise.
(get_DW_AT_signature_type): Likewise.
(dwarf2_find_containing_comp_unit): Likewise.
(set_die_type): Likewise.
sergiodj+
2018-02-23 18:26:25 UTC
Permalink
Buildslave:
fedora-x86-64-4

Full Build URL:
<http://gdb-build.sergiodj.net/builders/Fedora-x86_64-m64/builds/8914>

Commit(s) tested:
9d8780f0d0f53d9d326a9d64b7919fe1a628b767

Author(s) (in the same order as the commits):
Simon Marchi <***@polymtl.ca>

Subject:
dwarf: Make sect_offset 64-bits

Testsuite log (gdb.sum and gdb.log) URL(s):
<http://gdb-build.sergiodj.net/results/Fedora-x86_64-m64/9d/9d8780f0d0f53d9d326a9d64b7919fe1a628b767/>

*** Diff to previous build ***
============================
PASS -> FAIL: gdb.arch/amd64-disp-step-avx.exp: vex2: xmm0 has expected value before
PASS -> KFAIL: gdb.threads/process-dies-while-handling-bp.exp: non_stop=on: cond_bp_target=0: inferior 1 exited
============================


*** Complete list of XFAILs for this builder ***

To obtain the list of XFAIL tests for this builder, go to:

<http://git.sergiodj.net/?p=gdb-xfails.git;a=blob;f=xfails/Fedora-x86_64-m64/xfails/master/xfail;hb=1fc871c>

You can also see a pretty-printed version of the list, with more information
about each XFAIL, by going to:

<http://git.sergiodj.net/?p=gdb-xfails.git;a=blob;f=xfails/Fedora-x86_64-m64/xfails/master/xfail.table;hb=1fc871c>
sergiodj+
2018-02-23 18:27:33 UTC
Permalink
Buildslave:
fedora-x86-64-2

Full Build URL:
<http://gdb-build.sergiodj.net/builders/Fedora-x86_64-native-gdbserver-m32/builds/8857>

Commit(s) tested:
9d8780f0d0f53d9d326a9d64b7919fe1a628b767

Author(s) (in the same order as the commits):
Simon Marchi <***@polymtl.ca>

Subject:
dwarf: Make sect_offset 64-bits

Testsuite log (gdb.sum and gdb.log) URL(s):
<http://gdb-build.sergiodj.net/results/Fedora-x86_64-native-gdbserver-m32/9d/9d8780f0d0f53d9d326a9d64b7919fe1a628b767/>

*** Diff to previous build ***
============================
PASS -> KFAIL: gdb.threads/process-dies-while-handling-bp.exp: non_stop=on: cond_bp_target=1: inferior 1 exited
PASS -> KFAIL: gdb.threads/process-dies-while-handling-bp.exp: non_stop=off: cond_bp_target=1: inferior 1 exited
============================


*** Complete list of XFAILs for this builder ***

To obtain the list of XFAIL tests for this builder, go to:

<http://git.sergiodj.net/?p=gdb-xfails.git;a=blob;f=xfails/Fedora-x86_64-native-gdbserver-m32/xfails/master/xfail;hb=a647d11>

You can also see a pretty-printed version of the list, with more information
about each XFAIL, by going to:

<http://git.sergiodj.net/?p=gdb-xfails.git;a=blob;f=xfails/Fedora-x86_64-native-gdbserver-m32/xfails/master/xfail.table;hb=a647d11>
sergiodj+
2018-02-23 18:39:44 UTC
Permalink
Buildslave:
ubuntu-trusty-aarch32-1

Full Build URL:
<http://gdb-build.sergiodj.net/builders/Ubuntu-AArch32-native-extended-gdbserver-m32/builds/2818>

Commit(s) tested:
9d8780f0d0f53d9d326a9d64b7919fe1a628b767

Author(s) (in the same order as the commits):
Simon Marchi <***@polymtl.ca>

Subject:
dwarf: Make sect_offset 64-bits

Testsuite log (gdb.sum and gdb.log) URL(s):
<http://gdb-build.sergiodj.net/results/Ubuntu-AArch32-native-extended-gdbserver-m32/9d/9d8780f0d0f53d9d326a9d64b7919fe1a628b767/>

*** Diff to previous build ***
============================
PASS -> FAIL: gdb.base/step-over-syscall.exp: clone: displaced=off: single step over clone
new FAIL: gdb.threads/interrupt-while-step-over.exp: displaced-stepping=off: iter=8: wait for stops
new FAIL: gdb.threads/interrupt-while-step-over.exp: displaced-stepping=off: iter=9: wait for stops
new FAIL: gdb.threads/interrupt-while-step-over.exp: displaced-stepping=off: iter=13: wait for stops
new FAIL: gdb.threads/interrupt-while-step-over.exp: displaced-stepping=off: iter=15: wait for stops
new FAIL: gdb.threads/interrupt-while-step-over.exp: displaced-stepping=off: iter=18: wait for stops
PASS -> FAIL: gdb.threads/process-dies-while-detaching.exp: single-process: continue: killed outside: continue
PASS -> KFAIL: gdb.threads/process-dies-while-handling-bp.exp: non_stop=on: cond_bp_target=0: inferior 1 exited
PASS -> FAIL: gdb.threads/pthreads.exp: check backtrace from thread 1
new FAIL: gdb.threads/queue-signal.exp: determine thread functions
============================


*** Complete list of XFAILs for this builder ***

FAILURE TO OBTAIN THE COMMIT FOR THE XFAIL LIST. PLEASE CONTACT THE BUILDBOT ADMIN.
sergiodj+
2018-02-23 18:45:21 UTC
Permalink
Buildslave:
fedora-x86-64-2

Full Build URL:
<http://gdb-build.sergiodj.net/builders/Fedora-x86_64-native-extended-gdbserver-m64/builds/8900>

Commit(s) tested:
9d8780f0d0f53d9d326a9d64b7919fe1a628b767

Author(s) (in the same order as the commits):
Simon Marchi <***@polymtl.ca>

Subject:
dwarf: Make sect_offset 64-bits

Testsuite log (gdb.sum and gdb.log) URL(s):
<http://gdb-build.sergiodj.net/results/Fedora-x86_64-native-extended-gdbserver-m64/9d/9d8780f0d0f53d9d326a9d64b7919fe1a628b767/>

*** Diff to previous build ***
============================
PASS -> FAIL: gdb.arch/amd64-disp-step-avx.exp: vex2: xmm0 has expected value before
PASS -> KFAIL: gdb.threads/process-dies-while-handling-bp.exp: non_stop=off: cond_bp_target=0: inferior 1 exited
============================


*** Complete list of XFAILs for this builder ***

To obtain the list of XFAIL tests for this builder, go to:

<http://git.sergiodj.net/?p=gdb-xfails.git;a=blob;f=xfails/Fedora-x86_64-native-extended-gdbserver-m64/xfails/master/xfail;hb=8d02102>

You can also see a pretty-printed version of the list, with more information
about each XFAIL, by going to:

<http://git.sergiodj.net/?p=gdb-xfails.git;a=blob;f=xfails/Fedora-x86_64-native-extended-gdbserver-m64/xfails/master/xfail.table;hb=8d02102>
sergiodj+
2018-02-23 18:46:57 UTC
Permalink
Buildslave:
fedora-x86-64-3

Full Build URL:
<http://gdb-build.sergiodj.net/builders/Fedora-x86_64-cc-with-index/builds/8810>

Commit(s) tested:
9d8780f0d0f53d9d326a9d64b7919fe1a628b767

Author(s) (in the same order as the commits):
Simon Marchi <***@polymtl.ca>

Subject:
dwarf: Make sect_offset 64-bits

Testsuite log (gdb.sum and gdb.log) URL(s):
<http://gdb-build.sergiodj.net/results/Fedora-x86_64-cc-with-index/9d/9d8780f0d0f53d9d326a9d64b7919fe1a628b767/>

*** Diff to previous build ***
============================
PASS -> KFAIL: gdb.threads/non-ldr-exit.exp: program exits normally
============================


*** Complete list of XFAILs for this builder ***

To obtain the list of XFAIL tests for this builder, go to:

<http://git.sergiodj.net/?p=gdb-xfails.git;a=blob;f=xfails/Fedora-x86_64-cc-with-index/xfails/master/xfail;hb=e51500f>

You can also see a pretty-printed version of the list, with more information
about each XFAIL, by going to:

<http://git.sergiodj.net/?p=gdb-xfails.git;a=blob;f=xfails/Fedora-x86_64-cc-with-index/xfails/master/xfail.table;hb=e51500f>
sergiodj+
2018-02-23 18:48:20 UTC
Permalink
Buildslave:
fedora-x86-64-4

Full Build URL:
<http://gdb-build.sergiodj.net/builders/Fedora-x86_64-native-extended-gdbserver-m32/builds/8861>

Commit(s) tested:
9d8780f0d0f53d9d326a9d64b7919fe1a628b767

Author(s) (in the same order as the commits):
Simon Marchi <***@polymtl.ca>

Subject:
dwarf: Make sect_offset 64-bits

Testsuite log (gdb.sum and gdb.log) URL(s):
<http://gdb-build.sergiodj.net/results/Fedora-x86_64-native-extended-gdbserver-m32/9d/9d8780f0d0f53d9d326a9d64b7919fe1a628b767/>

*** Diff to previous build ***
============================
new FAIL: gdb.mi/mi-exec-run.exp: inferior-tty=main: mi=main: force-fail=1: run failure detected
new FAIL: gdb.mi/mi-exec-run.exp: inferior-tty=main: mi=separate: force-fail=1: run failure detected
new FAIL: gdb.mi/mi-exec-run.exp: inferior-tty=separate: mi=main: force-fail=1: run failure detected
new FAIL: gdb.mi/mi-exec-run.exp: inferior-tty=separate: mi=separate: force-fail=1: run failure detected
PASS -> KFAIL: gdb.threads/process-dies-while-handling-bp.exp: non_stop=off: cond_bp_target=1: inferior 1 exited
PASS -> KFAIL: gdb.threads/process-dies-while-handling-bp.exp: non_stop=off: cond_bp_target=0: inferior 1 exited
============================


*** Complete list of XFAILs for this builder ***

To obtain the list of XFAIL tests for this builder, go to:

<http://git.sergiodj.net/?p=gdb-xfails.git;a=blob;f=xfails/Fedora-x86_64-native-extended-gdbserver-m32/xfails/master/xfail;hb=b557023>

You can also see a pretty-printed version of the list, with more information
about each XFAIL, by going to:

<http://git.sergiodj.net/?p=gdb-xfails.git;a=blob;f=xfails/Fedora-x86_64-native-extended-gdbserver-m32/xfails/master/xfail.table;hb=b557023>
sergiodj+
2018-02-23 19:01:16 UTC
Permalink
Buildslave:
fedora-x86-64-2

Full Build URL:
<http://gdb-build.sergiodj.net/builders/Fedora-x86_64-native-gdbserver-m64/builds/8855>

Commit(s) tested:
9d8780f0d0f53d9d326a9d64b7919fe1a628b767

Author(s) (in the same order as the commits):
Simon Marchi <***@polymtl.ca>

Subject:
dwarf: Make sect_offset 64-bits

Testsuite log (gdb.sum and gdb.log) URL(s):
<http://gdb-build.sergiodj.net/results/Fedora-x86_64-native-gdbserver-m64/9d/9d8780f0d0f53d9d326a9d64b7919fe1a628b767/>

*** Diff to previous build ***
============================
PASS -> FAIL: gdb.arch/amd64-disp-step-avx.exp: vex2: xmm0 has expected value before
PASS -> KFAIL: gdb.threads/process-dies-while-handling-bp.exp: non_stop=on: cond_bp_target=1: inferior 1 exited
============================


*** Complete list of XFAILs for this builder ***

To obtain the list of XFAIL tests for this builder, go to:

<http://git.sergiodj.net/?p=gdb-xfails.git;a=blob;f=xfails/Fedora-x86_64-native-gdbserver-m64/xfails/master/xfail;hb=d5466a1>

You can also see a pretty-printed version of the list, with more information
about each XFAIL, by going to:

<http://git.sergiodj.net/?p=gdb-xfails.git;a=blob;f=xfails/Fedora-x86_64-native-gdbserver-m64/xfails/master/xfail.table;hb=d5466a1>
sergiodj+
2018-02-23 19:12:15 UTC
Permalink
Buildslave:
ubuntu-trusty-aarch32-1

Full Build URL:
<http://gdb-build.sergiodj.net/builders/Ubuntu-AArch32-native-gdbserver-m32/builds/2800>

Commit(s) tested:
9d8780f0d0f53d9d326a9d64b7919fe1a628b767

Author(s) (in the same order as the commits):
Simon Marchi <***@polymtl.ca>

Subject:
dwarf: Make sect_offset 64-bits

Testsuite log (gdb.sum and gdb.log) URL(s):
<http://gdb-build.sergiodj.net/results/Ubuntu-AArch32-native-gdbserver-m32/9d/9d8780f0d0f53d9d326a9d64b7919fe1a628b767/>

*** Diff to previous build ***
============================
PASS -> KFAIL: gdb.threads/non-ldr-exit.exp: program exits normally
PASS -> KFAIL: gdb.threads/process-dies-while-handling-bp.exp: non_stop=on: cond_bp_target=1: inferior 1 exited
PASS -> KFAIL: gdb.threads/process-dies-while-handling-bp.exp: non_stop=off: cond_bp_target=0: inferior 1 exited
============================


*** Complete list of XFAILs for this builder ***

To obtain the list of XFAIL tests for this builder, go to:

<http://git.sergiodj.net/?p=gdb-xfails.git;a=blob;f=xfails/Ubuntu-AArch32-native-gdbserver-m32/xfails/master/xfail;hb=>

You can also see a pretty-printed version of the list, with more information
about each XFAIL, by going to:

<http://git.sergiodj.net/?p=gdb-xfails.git;a=blob;f=xfails/Ubuntu-AArch32-native-gdbserver-m32/xfails/master/xfail.table;hb=>
sergiodj+
2018-02-26 10:18:44 UTC
Permalink
Buildslave:
debian-jessie-s390x-1

Full Build URL:
<http://gdb-build.sergiodj.net/builders/Debian-s390x-m64/builds/4643>

Commit(s) tested:
9d8780f0d0f53d9d326a9d64b7919fe1a628b767

Author(s) (in the same order as the commits):
Simon Marchi <***@polymtl.ca>

Subject:
dwarf: Make sect_offset 64-bits

Testsuite log (gdb.sum and gdb.log) URL(s):
<http://gdb-build.sergiodj.net/results/Debian-s390x-m64/9d/9d8780f0d0f53d9d326a9d64b7919fe1a628b767/>

*** Diff to previous build ***
============================
PASS -> KFAIL: gdb.threads/non-ldr-exit.exp: program exits normally
PASS -> KFAIL: gdb.threads/process-dies-while-handling-bp.exp: non_stop=on: cond_bp_target=0: inferior 1 exited
============================


*** Complete list of XFAILs for this builder ***

To obtain the list of XFAIL tests for this builder, go to:

<http://git.sergiodj.net/?p=gdb-xfails.git;a=blob;f=xfails/Debian-s390x-m64/xfails/master/xfail;hb=69ab67d>

You can also see a pretty-printed version of the list, with more information
about each XFAIL, by going to:

<http://git.sergiodj.net/?p=gdb-xfails.git;a=blob;f=xfails/Debian-s390x-m64/xfails/master/xfail.table;hb=69ab67d>
sergiodj+
2018-02-26 10:33:33 UTC
Permalink
Buildslave:
debian-jessie-s390x-1

Full Build URL:
<http://gdb-build.sergiodj.net/builders/Debian-s390x-native-extended-gdbserver-m64/builds/4834>

Commit(s) tested:
9d8780f0d0f53d9d326a9d64b7919fe1a628b767

Author(s) (in the same order as the commits):
Simon Marchi <***@polymtl.ca>

Subject:
dwarf: Make sect_offset 64-bits

Testsuite log (gdb.sum and gdb.log) URL(s):
<http://gdb-build.sergiodj.net/results/Debian-s390x-native-extended-gdbserver-m64/9d/9d8780f0d0f53d9d326a9d64b7919fe1a628b767/>

*** Diff to previous build ***
============================
PASS -> KFAIL: gdb.threads/process-dies-while-handling-bp.exp: non_stop=on: cond_bp_target=1: inferior 1 exited
============================


*** Complete list of XFAILs for this builder ***

To obtain the list of XFAIL tests for this builder, go to:

<http://git.sergiodj.net/?p=gdb-xfails.git;a=blob;f=xfails/Debian-s390x-native-extended-gdbserver-m64/xfails/master/xfail;hb=9576a4e>

You can also see a pretty-printed version of the list, with more information
about each XFAIL, by going to:

<http://git.sergiodj.net/?p=gdb-xfails.git;a=blob;f=xfails/Debian-s390x-native-extended-gdbserver-m64/xfails/master/xfail.table;hb=9576a4e>
Loading...