public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug cli/28290] pathstuff.cc:132: internal-error: gdb::unique_xmalloc_ptr<char> gdb_abspath(const char*): Assertion `path != NULL && path[0] != '\0'' failed
Date: Mon, 30 Aug 2021 12:34:10 +0000	[thread overview]
Message-ID: <bug-28290-4717-eoXXOD1ewQ@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-28290-4717@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=28290

--- Comment #3 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tom de Vries <vries@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=f947f96797f8ec33aabf9cd7234c850778068445

commit f947f96797f8ec33aabf9cd7234c850778068445
Author: Tom de Vries <tdevries@suse.de>
Date:   Mon Aug 30 14:34:03 2021 +0200

    [gdb/cli] Don't assert on empty string for core-file

    With current gdb we run into:
    ...
    $ gdb -batch '' ''
    : No such file or directory.
    pathstuff.cc:132: internal-error: \
      gdb::unique_xmalloc_ptr<char> gdb_abspath(const char*): \
      Assertion `path != NULL && path[0] != '\0'' failed.
    ...

    Fix this by skipping the call to gdb_abspath in core_target_open in the
    empty-string case, such that we have instead:
    ...
    $ gdb -batch '' ''
    : No such file or directory.
    : No such file or directory.
    $
    ...

    Tested on x86_64-linux.

    gdb/ChangeLog:

    2021-08-30  Tom de Vries  <tdevries@suse.de>

            PR cli/28290
            * gdb/corelow.c (core_target_open): Skip call to gdb_abspath in the
            empty-string case.

    gdb/testsuite/ChangeLog:

    2021-08-30  Tom de Vries  <tdevries@suse.de>

            PR cli/28290
            * gdb.base/batch-exit-status.exp: Add gdb '' and gdb '' '' tests.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  parent reply	other threads:[~2021-08-30 12:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-30  9:57 [Bug cli/28290] New: " vries at gcc dot gnu.org
2021-08-30 10:25 ` [Bug cli/28290] " vries at gcc dot gnu.org
2021-08-30 10:33 ` vries at gcc dot gnu.org
2021-08-30 12:34 ` cvs-commit at gcc dot gnu.org [this message]
2021-08-30 14:03 ` cvs-commit at gcc dot gnu.org
2021-08-30 14:04 ` vries at gcc dot gnu.org

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=bug-28290-4717-eoXXOD1ewQ@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).