public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Nagaraju Mekala <gnuuser.raj@gmail.com>
To: Michael Eager <eager@eagercon.com>
Cc: gcc-help <gcc-help@gcc.gnu.org>
Subject: Re: Issue with debug symbols with garbage collector
Date: Thu, 21 Apr 2022 12:57:04 +0530	[thread overview]
Message-ID: <CAKuVEhBot73i-AKZdujwyzMKe7Aarz1tjELG64q0CpRYp5MO7g@mail.gmail.com> (raw)
In-Reply-To: <ef61be82-1489-7908-5f79-e8060b5d33de@eagercon.com>

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

Hi Michael,

Thanks for the reply.

On Thu, Apr 21, 2022 at 12:52 AM Michael Eager <eager@eagercon.com> wrote:

> On 4/20/22 02:15, Nagaraju Mekala via Gcc-help wrote:
> > Hello All,
> >
> > When I enable the garbage collector for the microblaze compiler
> compilation
> > seems to be fine, but the debug symbols are not generated properly.
> >
> > If we set a breakpoint at 0x0 it is showing some different location, we
> can
> > see the same in the objdump as well.
>
> What different location?
>
>  I meant instead of pointing to _start, Debug symbols were pointing to
microblaze_register_handler.

> >
> >
> > Disassembly of section .vectors.reset:
> >
> > 00000000 <_start>:
> > *
> > *
> >
> ****************************************************************************/
> > void microblaze_register_handler(XInterruptHandler Handler, void
> *DataPtr)
> > {
> >     MB_InterruptVectorTable[0].Handler = Handler;
> >     0: b0008000 imm -32768
> >     4: b8080000 brai 0
> >
> > for the _start symbols "void
> microblaze_register_handler(XInterruptHandler
> > Handler, void *DataPtr)" is coming up.
>
> It looks like both _start and microblaze_register_handler are both at 0.
> What did you expect?
>
> GDB picks the first symbol which matches the address.
>
I have attached the elf, where we cannot find any symbols related to
microblaze_register_handler function but the debug_loc is somehow showing
up at _start address.


> > If I disable the garbage-collector then everything seems fine.
> > I have used "-ffunction-sections and -fdata-sections" options during
> > compilation and -gc-sections during linking command.
> >
> > Please let me know how to tell the garbage collector to not delete
> > debug_loc information.
>
> Why do you think that the garbage collector is deleting debug info?
>
I was just guessing since _start debug symbols were mixed with
microblaze_register_handler.


> --
> Michael Eager
>

[-- Attachment #2: kc705_hello.elf --]
[-- Type: application/octet-stream, Size: 202256 bytes --]

  reply	other threads:[~2022-04-21  7:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-20  9:15 Nagaraju Mekala
2022-04-20 19:22 ` Michael Eager
2022-04-21  7:27   ` Nagaraju Mekala [this message]
2022-04-21 18:11     ` Michael Eager
2022-04-21 18:28       ` Michael Eager
2022-04-22  6:29         ` Nagaraju Mekala

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=CAKuVEhBot73i-AKZdujwyzMKe7Aarz1tjELG64q0CpRYp5MO7g@mail.gmail.com \
    --to=gnuuser.raj@gmail.com \
    --cc=eager@eagercon.com \
    --cc=gcc-help@gcc.gnu.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).