public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Aditya Kamath1 <Aditya.Kamath1@ibm.com>
To: Tom Tromey <tom@tromey.com>,
	Aditya Kamath1 via Gdb-patches <gdb-patches@sourceware.org>,
	Ulrich Weigand <Ulrich.Weigand@de.ibm.com>,
	Sanket Rathi <sanrathi@in.ibm.com>
Cc: Ulrich Weigand <Ulrich.Weigand@de.ibm.com>,
	Sangamesh Mallayya <sangamesh.swamy@in.ibm.com>,
	Sanket Rathi <sanrathi@in.ibm.com>
Subject: RE: [PATCH] Fix call functions command bug in 64-bit programs for AIX and PC read in psymtab-symtab  warning
Date: Thu, 27 Apr 2023 10:14:43 +0000	[thread overview]
Message-ID: <CH2PR15MB35449D8D42C74989F3AA81BCD66A9@CH2PR15MB3544.namprd15.prod.outlook.com> (raw)
In-Reply-To: <87sfd24j4w.fsf@tromey.com>

[-- Attachment #1: Type: text/plain, Size: 3394 bytes --]

Hi Tom,

>The stabs reader is on life support.  If you want to track down and fix
>this bug, it's up to you.

>Actually I'm curious how important stabs are to your organization.  I
>would like to deprecate stabs in gdb 14 and remove them entirely in gdb
>15.  However, they are still required for AIX, I suppose we'd keep the
>code around as long as you need.

We are okay with you removing the stabs debugging in GDB 15.

Have a nice day ahead.

Thanks and regards,
Aditya.

From: Tom Tromey <tom@tromey.com>
Date: Friday, 14 April 2023 at 8:15 PM
To: Aditya Kamath1 via Gdb-patches <gdb-patches@sourceware.org>
Cc: Tom Tromey <tom@tromey.com>, Ulrich Weigand <Ulrich.Weigand@de.ibm.com>, Aditya Kamath1 <Aditya.Kamath1@ibm.com>, Sangamesh Mallayya <sangamesh.swamy@in.ibm.com>, simon.marchi@efficios.com <simon.marchi@efficios.com>
Subject: [EXTERNAL] Re: [PATCH] Fix call functions command bug in 64-bit programs for AIX and PC read in psymtab-symtab warning
>>>>> Aditya Kamath1 via Gdb-patches <gdb-patches@sourceware.org> writes:

>> warning: (Internal error: pc 0x100005a8 in read in psymtab, but not in symtab.)

Hi.  Thanks for the reply.

> But the libc shared library that gives the printf () was compiled
> using stabs. So now we have symtab created for symbols used by our
> code and psymtab created for the shared library functions.

Ok.  This answers one of my questions.

The stabs reader is on life support.  If you want to track down and fix
this bug, it's up to you.

Actually I'm curious how important stabs are to your organization.  I
would like to deprecate stabs in gdb 14 and remove them entirely in gdb
15.  However, they are still required for AIX, I suppose we'd keep the
code around as long as you need.

> The problem is the shared library functions in AIX do not have an
> entry in the symtab. They have in psymtab.

> Coming to solving this, I did try a few things in the last one
> week. Let me tell you all what I did and where I failed. I tried to
> add the symtab entry in the xcoffread.c file via record_minimal_symbol
> () but then realised that after initial scan GDB code was not coming
> here during execution. So it failed. I tried searching around
> solib-aix.c file if I can get a hint to fix this but did not find any.

gdb reads 3 kinds of symbols.

"Minimal" symbols are essentially "linker symbols" -- in this case they
aren't super relevant.  That's why your investigation here didn't yield
anything.

Partial symbols are made by an initial scan of the debug info.  (The
DWARF reader doesn't use these any more but has its own analogous idea.)

When more information is needed about a partial symbol, full symbols are
read for the compilation unit.

The warning you are seeing means that the partial and full symbol
readers disagree.  This is a bug somewhere.

Maybe the fix is to ensure a symbol is made in the full reader.  It's
also possible that the fix is to not make a partial symbol.

Finding the issue isn't always very easy, but basically what you want to
do is inspect the point at which the relevant partial symbol is made;
then expand the CU; and finally see why the full reader doesn't make a
corresponding symbol.

TBH all of this stuff is a design flaw.  In the DWARF reader I hope to
unify the paths so that this kind of mismatch is impossible.

Tom

      parent reply	other threads:[~2023-04-27 10:14 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-07 11:00 [PATCH] Fix call functions command bug in 64-bit programs for AIX Aditya Kamath1
2022-11-08 13:30 ` Ulrich Weigand
2022-11-11 17:53   ` Aditya Kamath1
2022-11-14 15:54     ` Ulrich Weigand
2022-11-14 17:32       ` Aditya Kamath1
2022-11-14 18:19         ` Ulrich Weigand
2022-11-14 18:28           ` Aditya Kamath1
2022-11-14 18:43             ` Ulrich Weigand
2022-11-14 18:52               ` Aditya Kamath1
2022-11-14 19:10                 ` Ulrich Weigand
2022-11-16 11:27                   ` Aditya Kamath1
2022-11-16 15:15                     ` Ulrich Weigand
2022-11-16 18:07                       ` Aditya Kamath1
2022-11-16 18:30                         ` Tom Tromey
2022-11-17 12:54                         ` Ulrich Weigand
2022-11-24 17:56                           ` Aditya Kamath1
2022-11-24 18:15                             ` Tom Tromey
2023-04-14  7:38                               ` [PATCH] Fix call functions command bug in 64-bit programs for AIX and PC read in psymtab-symtab warning Aditya Kamath1
2023-04-14 14:45                                 ` Tom Tromey
2023-04-17 13:08                                   ` Aditya Kamath1
2023-04-17 13:16                                     ` Aditya Kamath1
2023-04-18 10:12                                       ` Ulrich Weigand
2023-04-21 13:00                                         ` Aditya Kamath1
2023-04-24 15:44                                           ` Ulrich Weigand
2023-04-27 10:13                                             ` Aditya Kamath1
2023-04-27 12:23                                               ` Ulrich Weigand
2023-04-27 10:14                                   ` Aditya Kamath1 [this message]

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=CH2PR15MB35449D8D42C74989F3AA81BCD66A9@CH2PR15MB3544.namprd15.prod.outlook.com \
    --to=aditya.kamath1@ibm.com \
    --cc=Ulrich.Weigand@de.ibm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=sangamesh.swamy@in.ibm.com \
    --cc=sanrathi@in.ibm.com \
    --cc=tom@tromey.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).