~ubuntu-support-team/binutils/+git/binutils-gdb:users/palves/runto_main

Last commit made on 2020-10-12
Get this branch:
git clone -b users/palves/runto_main https://git.launchpad.net/~ubuntu-support-team/binutils/+git/binutils-gdb

Branch merges

Branch information

Name:
users/palves/runto_main
Repository:
lp:~ubuntu-support-team/binutils/+git/binutils-gdb

Recent commits

bdfbda9... by Pedro Alves <email address hidden>

Eliminate mi_run_to_main, introduce mi_clean_restart

Since we now have mi_runto_main which is like runto_main, eliminate
mi_run_to_main, in favor of a new MI clean_restart counterpart --
mi_clean_restart -- and mi_runto_main.

This makes MI testcases look a bit more like CLI testcases.

gdb/testsuite/ChangeLog:

 * lib/mi-support.exp (mi_clean_restart): New.
 (mi_run_to_main): Delete.
 All callers adjust to use mi_clean_restart / mi_runto_main.

Change-Id: I34920bab4fea1f23fb752928c2969c1f6ad714b6

df47e3e... by Pedro Alves <email address hidden>

gdb/testsuite/: Use "-qualified" in explicit "break main", etc.

Similar to the previous patch, but this time add "-q" to tests that do
"break main", "list main", etc. explicitly.

gdb/testsuite/ChangeLog:

 * config/monitor.exp: Use "list -q".
 * gdb.arch/gdb1558.exp: Use "break -q".
 * gdb.arch/i386-permbkpt.exp: Use "break -q".
 * gdb.arch/i386-prologue-skip-cf-protection.exp: Use "break -q".
 * gdb.base/break.exp: Use "break -q", "list -q" and "tbreak -q".
 * gdb.base/commands.exp: Use "break -q".
 * gdb.base/condbreak.exp: Use "break -q".
 * gdb.base/ctf-ptype.exp: Use "list -q".
 * gdb.base/define.exp: Use "break -q".
 * gdb.base/del.exp: Use "break -q".
 * gdb.base/fullname.exp: Use "break -q".
 * gdb.base/hbreak-in-shr-unsupported.exp: Use "hbreak -q".
 * gdb.base/hbreak-unmapped.exp: Use "hbreak -q".
 * gdb.base/hbreak2.exp: Use "hbreak -q" and "list -q".
 * gdb.base/hw-sw-break-same-address.exp: Use "break -q" and
 "hbreak -q".
 * gdb.base/included.exp: Use "list -q".
 * gdb.base/label.exp: Use "break -q".
 * gdb.base/lineinc.exp: Use "break -q".
 * gdb.base/list.exp: Use "list -q".
 * gdb.base/macscp.exp: Use "list -q".
 * gdb.base/pending.exp: Use "break -q".
 * gdb.base/prologue-include.exp: Use "break -q".
 * gdb.base/ptype.exp: Use "list -q".
 * gdb.base/sepdebug.exp: Use "break -q", "list -q" and "tbreak -q".
 * gdb.base/server-del-break.exp: Use "break -q".
 * gdb.base/style.exp: Use "break -q".
 * gdb.base/symbol-without-target_section.exp: Use "list -q".
 * gdb.base/watchpoint-reuse-slot.exp: Use "hbreak -q".
 * gdb.cp/exception.exp: Use "tbreak -q".
 * gdb.dwarf2/dw2-error.exp: Use "break -q".
 * gdb.dwarf2/fission-mix.exp: Use "break -q".
 * gdb.dwarf2/fission-reread.exp: Use "break -q".
 * gdb.dwarf2/pr13961.exp: Use "break -q".
 * gdb.linespec/explicit.exp: Use "list -q".
 * gdb.linespec/linespec.exp: Use "break -q".
 * gdb.mi/mi-simplerun.exp: Use "--qualified".
 * gdb.python/py-mi-objfile-gdb.py: Use "list -q".
 * gdb.server/bkpt-other-inferior.exp: Use "break -q".
 * gdb.server/connect-without-multi-process.exp: Use "break -q".
 * gdb.trace/change-loc.exp: Use "break -q".
 * gdb.trace/pending.exp: Use "break -q".
 * gdb.tui/basic.exp: Use "list -q".
 * gdb.tui/list-before.exp: Use "list -q".
 * gdb.tui/list.exp: Use "list -q".
 * lib/gdb.exp (gdb_has_argv0): Use "break -q".

Change-Id: Iab9408e90ed71cbb111cd737d2d81b5ba8adb108

fc9cf3c... by Pedro Alves <email address hidden>

gdb/testsuite/: Use -qualified in runto_main / mi_runto_main

In some runtimes, there may be a "main" function in some class or
namespace. The breakpoint created by runto_main may therefore have
unexpected locations on some other functions than the actual main.
These breakpoint locations can unexpectedly get hit during tests and
lead to failures.

I saw this while playing with AMD's ROCm toolchain -- I wrote a board
file to run the testsuite against device kernels. There, the runtime
calls a "main" function before the device kernel code is reached:

 Thread 4 "bit_extract" hit Breakpoint 1, 0x00007ffeea140960 in lld::elf::LinkerDriver::main(llvm::ArrayRef<char const*>) () from /opt/rocm/lib/libamd_comgr.so.1
 (gdb) bt
 #0 0x00007ffeea140960 in lld::elf::LinkerDriver::main(llvm::ArrayRef<char const*>) () from /opt/rocm/lib/libamd_comgr.so.1
 #1 0x00007ffeea2257a5 in lld::elf::link(llvm::ArrayRef<char const*>, bool, llvm::raw_ostream&, llvm::raw_ostream&) () from /opt/rocm/lib/libamd_comgr.so.1
 #2 0x00007ffeea1bc374 in COMGR::linkWithLLD(llvm::ArrayRef<char const*>, llvm::raw_ostream&, llvm::raw_ostream&) () from /opt/rocm/lib/libamd_comgr.so.1
 #3 0x00007ffeea1bfb09 in COMGR::InProcessDriver::execute(llvm::ArrayRef<char const*>) () from /opt/rocm/lib/libamd_comgr.so.1
 #4 0x00007ffeea1c4da9 in COMGR::AMDGPUCompiler::linkToExecutable() () from /opt/rocm/lib/libamd_comgr.so.1
 #5 0x00007ffeea1fde20 in dispatchCompilerAction(amd_comgr_action_kind_s, COMGR::DataAction*, COMGR::DataSet*, COMGR::DataSet*, llvm::raw_ostream&) () from /opt/rocm/lib/libamd_comgr.so.1
 #6 0x00007ffeea203a87 in amd_comgr_do_action () from /opt/rocm/lib/libamd_comgr.so.1
 ...

To avoid that, pass "qualified" to runto, in runto_main, so that
gdb_breakpoint ends up creating a breakpoint with -qualified. This
avoids creating breakpoints locations for other unrelated "main"
functions.

Note: I first tried making runto itself use "-qualified", but that
caused regressions in the gdb.ada/ tests, which use runto without
specifying the whole fully-qualified function name (i.e., without the
package). So I end up restricting the -qualified to
runto_main/mi_runto_main.

The gdb.base/ui-redirect.exp change is necessary because that testcase
is looking at what "save breakpoint" generates.

gdb/testsuite/ChangeLog:

 * gdb.base/ui-redirect.exp: Expect "break -qualified main" in
 saved breakpoints file.
 * gdb.guile/scm-breakpoint.exp: Expect "-qualified main" when
 inspecting breakpoint list.
 * lib/gdb.exp (runto_main): Add "qualified" to options.
 * lib/mi-support.exp (mi_runto_helper): Add 'qualified' parameter,
 and handle it.
 (mi_runto_main): Pass 1 as qualified argument.

Change-Id: I51468359ab0a518f05f7c0394c97f7e33b45fe69

026fd25... by Pedro Alves <email address hidden>

Introduce mi_runto_main

This adds an mi_runto_main routine, very much like the runto_main CLI
counterpart.

Note there's already a mi_run_to_main (extra underscore in "run_to"),
but unlike its intro comment says, that does more than the CLI's
runto_main -- it also starts GDB. I would like to eliminate that
other one by introducing a mi_clean_restart function instead. That is
done later in the series.

gdb/testsuite/ChangeLog:

 * lib/mi-support.exp (mi_runto_main): New proc.
 (mi_run_to_main): Use it.
 * gdb.mi/mi-catch-cpp-exceptions.exp: Likewise.
 * gdb.mi/mi-var-cmd.exp: Likewise.
 * gdb.mi/mi-var-invalidate.exp: Likewise.
 * mi-var-list-children-invalid-grandchild.exp: Likewise.
 * gdb.mi/mi2-amd64-entry-value.exp: Likewise.
 * gdb.mi/new-ui-mi-sync.exp: Likewise.
 * gdb.mi/user-selected-context-sync.exp: Likewise.
 * gdb.opt/inline-cmds.exp: Likewise.
 * gdb.python/py-framefilter-mi.exp: Likewise.
 * gdb.python/py-mi.exp: Likewise.

Change-Id: I2e49ca7b0b61cea57c1202e5dfa32417e6a4403d

c80c1bb... by Pedro Alves <email address hidden>

'runto main' -> 'runto_main' throughout

This commit does 's/runto main/runto_main/g' throughout.

gdb/testsuite/ChangeLog:

 * gdb.ada/fun_in_declare.exp: Use "runto_main" instead of
 "runto main".
 * gdb.ada/small_reg_param.exp: Likewise.
 * gdb.arch/powerpc-d128-regs.exp: Likewise.
 * gdb.base/annota1.exp: Likewise.
 * gdb.base/anon.exp: Likewise.
 * gdb.base/breakpoint-in-ro-region.exp: Likewise.
 * gdb.base/dprintf-non-stop.exp: Likewise.
 * gdb.base/dprintf.exp: Likewise.
 * gdb.base/gdb11530.exp: Likewise.
 * gdb.base/gdb11531.exp: Likewise.
 * gdb.base/gnu_vector.exp: Likewise.
 * gdb.base/interrupt-noterm.exp: Likewise.
 * gdb.base/memattr.exp: Likewise.
 * gdb.base/step-over-syscall.exp: Likewise.
 * gdb.base/watch-cond-infcall.exp: Likewise.
 * gdb.base/watch-read.exp: Likewise.
 * gdb.base/watch-vfork.exp: Likewise.
 * gdb.base/watch_thread_num.exp: Likewise.
 * gdb.base/watchpoint-stops-at-right-insn.exp: Likewise.
 * gdb.guile/scm-frame-inline.exp: Likewise.
 * gdb.linespec/explicit.exp: Likewise.
 * gdb.opt/inline-break.exp: Likewise.
 * gdb.python/py-frame-inline.exp: Likewise.
 * gdb.reverse/break-precsave.exp: Likewise.
 * gdb.reverse/break-reverse.exp: Likewise.
 * gdb.reverse/consecutive-precsave.exp: Likewise.
 * gdb.reverse/consecutive-reverse.exp: Likewise.
 * gdb.reverse/finish-precsave.exp: Likewise.
 * gdb.reverse/finish-reverse.exp: Likewise.
 * gdb.reverse/fstatat-reverse.exp: Likewise.
 * gdb.reverse/getresuid-reverse.exp: Likewise.
 * gdb.reverse/i386-precsave.exp: Likewise.
 * gdb.reverse/i386-reverse.exp: Likewise.
 * gdb.reverse/i386-sse-reverse.exp: Likewise.
 * gdb.reverse/i387-env-reverse.exp: Likewise.
 * gdb.reverse/i387-stack-reverse.exp: Likewise.
 * gdb.reverse/insn-reverse.exp: Likewise.
 * gdb.reverse/machinestate-precsave.exp: Likewise.
 * gdb.reverse/machinestate.exp: Likewise.
 * gdb.reverse/pipe-reverse.exp: Likewise.
 * gdb.reverse/readv-reverse.exp: Likewise.
 * gdb.reverse/recvmsg-reverse.exp: Likewise.
 * gdb.reverse/rerun-prec.exp: Likewise.
 * gdb.reverse/s390-mvcle.exp: Likewise.
 * gdb.reverse/solib-precsave.exp: Likewise.
 * gdb.reverse/solib-reverse.exp: Likewise.
 * gdb.reverse/step-precsave.exp: Likewise.
 * gdb.reverse/step-reverse.exp: Likewise.
 * gdb.reverse/time-reverse.exp: Likewise.
 * gdb.reverse/until-precsave.exp: Likewise.
 * gdb.reverse/until-reverse.exp: Likewise.
 * gdb.reverse/waitpid-reverse.exp: Likewise.
 * gdb.reverse/watch-precsave.exp: Likewise.
 * gdb.reverse/watch-reverse.exp: Likewise.
 * gdb.threads/kill.exp: Likewise.
 * gdb.threads/tid-reuse.exp: Likewise.

Change-Id: I70f457253836019880b4d7fb981936afa56724c2

8a6e98c... by GDB Administrator <email address hidden>

Automatic date update in version.in

9370fd5... by Andrew Burgess <email address hidden>

gdb: detect main function even when there's no matching msymbol

Currently, GDB will only stop the backtrace at the main function if
there is a minimal symbol with the matching name. In Fortran programs
compiled with gfortran this is not the case. The main function is
present in the DWARF, and as marked as DW_AT_main_subprogram, but
there's no minimal symbol.

This commit extends `inside_main_func` to check the full symbols if no
matching minimal symbol is found.

There's an updated test case that covers this change.

gdb/ChangeLog:

 * frame.c (inside_main_func): Check full symbols as well as
 minimal symbols.

gdb/testsuite/ChangeLog:

 * gdb.fortran/mixed-lang-stack.exp (run_tests): Update expected
 output of backtrace.

f7c1eda... by GDB Administrator <email address hidden>

Automatic date update in version.in

448ba68... by GDB Administrator <email address hidden>

Automatic date update in version.in

59c8a30... by Joel Brobecker <email address hidden>

ada-lang.c::advance_wild_match improve doc and parameter+temporaries types

This commit fixes the type of one of the parameters as well as a couple
of temporaries.

While at it, the function's description is slightly rewritten to make it
a little clearer what the function does.

gdb/ChangeLog:

        * ada-lang.c (advance_wild_match): Rewrite the function's
        description. Change the type of target0, t0 and t1 to char.