public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Help: debug binary
       [not found]   ` <CACEFAc0C9J-x8_3H_3omD_-KBcgwqAR3Nd4q+JRaOpnvnPhybQ@mail.gmail.com>
@ 2020-05-12  3:24     ` Kunal Chauhan
  2020-05-12 19:35       ` Kunal Chauhan
  0 siblings, 1 reply; 5+ messages in thread
From: Kunal Chauhan @ 2020-05-12  3:24 UTC (permalink / raw)
  To: gdb

Hi Team

I am new to the stuff of debugging and do not know any memory tools.

1. I have logs of binary and have only development machine. I searched my
logs and prints shows something like.

Void f1()
{
    F1()

}

1.F1: returns the int val and after that binary crash .
2. In f1 some memory allocation and deallocation done for char*


How can i check that particular function and file for memory crash . As i
have develoment system where i can only compile my binary.?

Please suggest some useful steps


Thanks
Kunal

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Help: debug binary
  2020-05-12  3:24     ` Help: debug binary Kunal Chauhan
@ 2020-05-12 19:35       ` Kunal Chauhan
  2020-05-12 20:22         ` Andrew Burgess
  0 siblings, 1 reply; 5+ messages in thread
From: Kunal Chauhan @ 2020-05-12 19:35 UTC (permalink / raw)
  To: gdb

Hi Team
As I am new to core files and gdb
>> How core file looks like in unix ?
>>Can we use gdb to findout crash from core files? at development system.

On Tue, May 12, 2020 at 8:54 AM Kunal Chauhan <atkunalchauhan@gmail.com>
wrote:

> Hi Team
>
> I am new to the stuff of debugging and do not know any memory tools.
>
> 1. I have logs of binary and have only development machine. I searched my
> logs and prints shows something like.
>
> Void f1()
> {
>     F1()
>
> }
>
> 1.F1: returns the int val and after that binary crash .
> 2. In f1 some memory allocation and deallocation done for char*
>
>
> How can i check that particular function and file for memory crash . As i
> have develoment system where i can only compile my binary.?
>
> Please suggest some useful steps
>
>
> Thanks
> Kunal
>
>
>

-- 
*Thanks with Regards!*

*Kunal Chauhan*
*Mob:09813614826*
*Mob:08860397903*

*E-mail:atkunalchauhan@gmail.com <E-mail%3Aatkunalchauhan@gmail.com>*

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Help: debug binary
  2020-05-12 19:35       ` Kunal Chauhan
@ 2020-05-12 20:22         ` Andrew Burgess
  2020-05-12 21:07           ` Kunal Chauhan
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Burgess @ 2020-05-12 20:22 UTC (permalink / raw)
  To: Kunal Chauhan; +Cc: gdb

* Kunal Chauhan via Gdb <gdb@sourceware.org> [2020-05-13 01:05:32 +0530]:

> Hi Team
> As I am new to core files and gdb
> >> How core file looks like in unix ?
> >>Can we use gdb to findout crash from core files? at development
> system.

You don't really need to know the details of the core file format, you
just need the core file and the corresponding binary and you can debug
this with GDB.  See:

  https://sourceware.org/gdb/current/onlinedocs/gdb/Invoking-GDB.html#Invoking-GDB

Basically you want:

  $ gdb application.exe core.file

Then you should be able to investigate the state of the target at the
time it produced the core file.

Good luck,
Andrew




> 
> On Tue, May 12, 2020 at 8:54 AM Kunal Chauhan <atkunalchauhan@gmail.com>
> wrote:
> 
> > Hi Team
> >
> > I am new to the stuff of debugging and do not know any memory tools.
> >
> > 1. I have logs of binary and have only development machine. I searched my
> > logs and prints shows something like.
> >
> > Void f1()
> > {
> >     F1()
> >
> > }
> >
> > 1.F1: returns the int val and after that binary crash .
> > 2. In f1 some memory allocation and deallocation done for char*
> >
> >
> > How can i check that particular function and file for memory crash . As i
> > have develoment system where i can only compile my binary.?
> >
> > Please suggest some useful steps
> >
> >
> > Thanks
> > Kunal
> >
> >
> >
> 
> -- 
> *Thanks with Regards!*
> 
> *Kunal Chauhan*
> *Mob:09813614826*
> *Mob:08860397903*
> 
> *E-mail:atkunalchauhan@gmail.com <E-mail%3Aatkunalchauhan@gmail.com>*

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Help: debug binary
  2020-05-12 20:22         ` Andrew Burgess
@ 2020-05-12 21:07           ` Kunal Chauhan
  2020-05-12 21:35             ` Andrew Burgess
  0 siblings, 1 reply; 5+ messages in thread
From: Kunal Chauhan @ 2020-05-12 21:07 UTC (permalink / raw)
  To: Andrew Burgess; +Cc: gdb

Is gdb binary core.file   this can be run or developement system ? Means is
it necessary to run on target board

On 13 May 2020 1:52 a.m., "Andrew Burgess" <andrew.burgess@embecosm.com>
wrote:

> * Kunal Chauhan via Gdb <gdb@sourceware.org> [2020-05-13 01:05:32 +0530]:
>
> > Hi Team
> > As I am new to core files and gdb
> > >> How core file looks like in unix ?
> > >>Can we use gdb to findout crash from core files? at development
> > system.
>
> You don't really need to know the details of the core file format, you
> just need the core file and the corresponding binary and you can debug
> this with GDB.  See:
>
>   https://sourceware.org/gdb/current/onlinedocs/gdb/
> Invoking-GDB.html#Invoking-GDB
>
> Basically you want:
>
>   $ gdb application.exe core.file
>
> Then you should be able to investigate the state of the target at the
> time it produced the core file.
>
> Good luck,
> Andrew
>
>
>
>
> >
> > On Tue, May 12, 2020 at 8:54 AM Kunal Chauhan <atkunalchauhan@gmail.com>
> > wrote:
> >
> > > Hi Team
> > >
> > > I am new to the stuff of debugging and do not know any memory tools.
> > >
> > > 1. I have logs of binary and have only development machine. I searched
> my
> > > logs and prints shows something like.
> > >
> > > Void f1()
> > > {
> > >     F1()
> > >
> > > }
> > >
> > > 1.F1: returns the int val and after that binary crash .
> > > 2. In f1 some memory allocation and deallocation done for char*
> > >
> > >
> > > How can i check that particular function and file for memory crash .
> As i
> > > have develoment system where i can only compile my binary.?
> > >
> > > Please suggest some useful steps
> > >
> > >
> > > Thanks
> > > Kunal
> > >
> > >
> > >
> >
> > --
> > *Thanks with Regards!*
> >
> > *Kunal Chauhan*
> > *Mob:09813614826*
> > *Mob:08860397903*
> >
> > *E-mail:atkunalchauhan@gmail.com <E-mail%3Aatkunalchauhan@gmail.com>*
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Help: debug binary
  2020-05-12 21:07           ` Kunal Chauhan
@ 2020-05-12 21:35             ` Andrew Burgess
  0 siblings, 0 replies; 5+ messages in thread
From: Andrew Burgess @ 2020-05-12 21:35 UTC (permalink / raw)
  To: Kunal Chauhan; +Cc: gdb

* Kunal Chauhan <atkunalchauhan@gmail.com> [2020-05-13 02:37:47 +0530]:

> Is gdb binary core.file   this can be run or developement system ? Means is
> it necessary to run on target board

It depends what your setup is, and what you want to do.

You'll need a GDB built to debug your target environment.  That
doesn't mean you can't run that GDB on a totally different machine.

So on my X86-64/Linux desktop I can build GDB to debug RISC-V.  I then
run that GDB on my x86-64 machine, and connect to a remote RISC-V
target and debug.  If that target can produce core files I can copy
those to my local machine and use the RISC-V GDB to debug them.

You can feel free to expand on your questions a little, explain what
your setup is, what you'd like to achieve, what you've tried, and why
the results you see aren't what you expect.  This will make it much
easier for people to help you.

Thanks,
Andrew

> 
> On 13 May 2020 1:52 a.m., "Andrew Burgess" <andrew.burgess@embecosm.com>
> wrote:
> 
> > * Kunal Chauhan via Gdb <gdb@sourceware.org> [2020-05-13 01:05:32 +0530]:
> >
> > > Hi Team
> > > As I am new to core files and gdb
> > > >> How core file looks like in unix ?
> > > >>Can we use gdb to findout crash from core files? at development
> > > system.
> >
> > You don't really need to know the details of the core file format, you
> > just need the core file and the corresponding binary and you can debug
> > this with GDB.  See:
> >
> >   https://sourceware.org/gdb/current/onlinedocs/gdb/
> > Invoking-GDB.html#Invoking-GDB
> >
> > Basically you want:
> >
> >   $ gdb application.exe core.file
> >
> > Then you should be able to investigate the state of the target at the
> > time it produced the core file.
> >
> > Good luck,
> > Andrew
> >
> >
> >
> >
> > >
> > > On Tue, May 12, 2020 at 8:54 AM Kunal Chauhan <atkunalchauhan@gmail.com>
> > > wrote:
> > >
> > > > Hi Team
> > > >
> > > > I am new to the stuff of debugging and do not know any memory tools.
> > > >
> > > > 1. I have logs of binary and have only development machine. I searched
> > my
> > > > logs and prints shows something like.
> > > >
> > > > Void f1()
> > > > {
> > > >     F1()
> > > >
> > > > }
> > > >
> > > > 1.F1: returns the int val and after that binary crash .
> > > > 2. In f1 some memory allocation and deallocation done for char*
> > > >
> > > >
> > > > How can i check that particular function and file for memory crash .
> > As i
> > > > have develoment system where i can only compile my binary.?
> > > >
> > > > Please suggest some useful steps
> > > >
> > > >
> > > > Thanks
> > > > Kunal
> > > >
> > > >
> > > >
> > >
> > > --
> > > *Thanks with Regards!*
> > >
> > > *Kunal Chauhan*
> > > *Mob:09813614826*
> > > *Mob:08860397903*
> > >
> > > *E-mail:atkunalchauhan@gmail.com <E-mail%3Aatkunalchauhan@gmail.com>*
> >

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-05-12 21:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CACEFAc0rQ2XJ0vgDb95AO0684eU+woBKAf84Z5Yhf1LFQ3dS5Q@mail.gmail.com>
     [not found] ` <CACEFAc24agH+OCFWqCf2rEUSEQxJSmK58dWt0z=3A2e=WAkhWA@mail.gmail.com>
     [not found]   ` <CACEFAc0C9J-x8_3H_3omD_-KBcgwqAR3Nd4q+JRaOpnvnPhybQ@mail.gmail.com>
2020-05-12  3:24     ` Help: debug binary Kunal Chauhan
2020-05-12 19:35       ` Kunal Chauhan
2020-05-12 20:22         ` Andrew Burgess
2020-05-12 21:07           ` Kunal Chauhan
2020-05-12 21:35             ` Andrew Burgess

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).