Fishing information from Core file
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > Fishing information from Core file




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Fishing information from Core file  
Anoop Kumar


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
08-17-04 12:59 PM

How do i get information (location of the error ) from a core file ,
assuming that the program which created the core was optimized build.

when i invoke gdb with -c option with the core files
and run backtrace command in gdb
all i see are memory locations . Is there any way i could find out
which function corresponds to the memory location ???





[ Post a follow-up to this message ]



    Re: Fishing information from Core file  
Nils O. Selåsdal


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
08-17-04 12:59 PM

Anoop Kumar wrote:

> How do i get information (location of the error ) from a core file ,
> assuming that the program which created the core was optimized build.
>
> when i invoke gdb with -c option with the core files
> and run backtrace command in gdb
> all i see are memory locations . Is there any way i could find out
> which function corresponds to the memory location ???
Did you specify the binary ? ;
gdb --core=/path/to/core /path/to/binary





[ Post a follow-up to this message ]



    Re: Fishing information from Core file  
Karthick S.


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
08-17-04 10:54 PM

anoop_kn@yahoo.com (Anoop Kumar) wrote in message news:<31fe3fb2.0408170228.748776d@posting.
google.com>...
> How do i get information (location of the error ) from a core file ,
> assuming that the program which created the core was optimized build.
>
> when i invoke gdb with -c option with the core files
> and run backtrace command in gdb
> all i see are memory locations . Is there any way i could find out
> which function corresponds to the memory location ???

By "Optimized Build" I assume you mean without -g. This would mean
there is no debugging info and hence there is no chance of gdb to have
the function related information for it to print it.
use the -g option while compiling to get the info. man gcc and man gdb
will be helpful.
Rgds,
Karthick S.





[ Post a follow-up to this message ]



    Re: Fishing information from Core file  
Fletcher Glenn


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
08-17-04 10:54 PM



Karthick S. wrote:
> anoop_kn@yahoo.com (Anoop Kumar) wrote in message news:<31fe3fb2.040817022
8.748776d@posting.google.com>...
> 
>
>
> By "Optimized Build" I assume you mean without -g. This would mean
> there is no debugging info and hence there is no chance of gdb to have
> the function related information for it to print it.
> use the -g option while compiling to get the info. man gcc and man gdb
> will be helpful.
> Rgds,
> Karthick S.

A debugger will at least translate addresses into function names on an
unstripped binary.  Other clues will tell you where in the function you
are.  Although type information may be missing, you can examine sections
of memory in the core file to determine if the data is valid.
I've taken apart many core files, and although it is difficult to pin
down a specific code line under these circumstances, you can often get
a surprising amount of information.

--

Fletcher Glenn






[ Post a follow-up to this message ]



    Re: Fishing information from Core file  
Billy N. Patton


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
08-18-04 07:48 AM

Nils O. Selåsdal wrote:
> Anoop Kumar wrote:
> 
>
> Did you specify the binary ? ;
> gdb --core=/path/to/core /path/to/binary

and did you compile with the debug option turned on ?

--
___  _ ____       ___       __  __
/ _ )(_) / /_ __  / _ \___ _/ /_/ /____  ___
/ _  / / / / // / / ___/ _ `/ __/ __/ _ \/ _ \
/____/_/_/_/\_, / /_/   \_,_/\__/\__/\___/_//_/
/___/
Texas Instruments ASIC Circuit Design Methodlogy Group
Dallas, Texas, 214-480-4455,  b-patton@ti.com





[ Post a follow-up to this message ]



    Re: Fishing information from Core file  
Anoop Kumar


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
08-18-04 10:57 PM

Fletcher Glenn <fletcher@removethisfoglight.com> wrote in message news:<412275B1.5000401@rem
ovethisfoglight.com>...
> Karthick S. wrote: 

[vbcol=seagreen] 
>
> A debugger will at least translate addresses into function names on an
> unstripped binary.  Other clues will tell you where in the function you
> are.  Although type information may be missing, you can examine sections
> of memory in the core file to determine if the data is valid.
> I've taken apart many core files, and although it is difficult to pin
> down a specific code line under these circumstances, you can often get
> a surprising amount of information.


It is not a debug build , that is -g option hasn't been set while compiling.
gdb --core=path_to_core path_to_program doesn't help either.





[ Post a follow-up to this message ]



    Re: Fishing information from Core file  
Fletcher Glenn


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
08-18-04 10:57 PM



Anoop Kumar wrote:
> Fletcher Glenn <fletcher@removethisfoglight.com> wrote in message news:<41
2275B1.5000401@removethisfoglight.com>...
> 
>
> 
>
>
>
> It is not a debug build , that is -g option hasn't been set while compilin
g.
> gdb --core=path_to_core path_to_program doesn't help either.

I'm guessing that your binary that produced the core file is stripped.
You can take an unstripped version of the same binary file and use
it with gdb to examine the core file.  This will provide more
information about the core file.

--

Fletcher Glenn






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 04:18 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register