Unix Programming - how to dump a core inside gdb

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > November 2005 > how to dump a core inside gdb





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author how to dump a core inside gdb
Jeremy

2005-11-30, 7:58 am

Hi

My program crashed when it's running inside gdb. Since this is a rare
case to reproduce, I want to dump current state to a core file and
check it later on, does anybody know to to do this?

Thanks a lot,

Fang

Thobias Vakayil

2005-11-30, 7:58 am

Jeremy wrote:

>Hi
>
>My program crashed when it's running inside gdb. Since this is a rare
>case to reproduce, I want to dump current state to a core file and
>check it later on, does anybody know to to do this?
>
>Thanks a lot,
>
>Fang
>
>
>

Execute like this :

gdb <application name> core

<application name> - the application which produced the core.

Regards,
Thobias Vakayil

David Resnick

2005-11-30, 7:58 am


Jeremy wrote:
> Hi
>
> My program crashed when it's running inside gdb. Since this is a rare
> case to reproduce, I want to dump current state to a core file and
> check it later on, does anybody know to to do this?
>
> Thanks a lot,
>
> Fang


Try:
signal 6

That will send an abort to the process, works for me.
You can externally cause a program that is running to core
by doing
kill -6 <pid>

-David

Chris Markle

2005-11-30, 5:55 pm

Jeremy,

> My program crashed when it's running inside gdb. Since this is a rare
> case to reproduce, I want to dump current state to a core file and
> check it later on, does anybody know to to do this?


Recent'ish releases of gdb have a gcore command which will create a core
file of the thing being debugged...

Chris
Jeremy

2005-11-30, 5:55 pm


Chris Markle wrote:
> Jeremy,
>
>
> Recent'ish releases of gdb have a gcore command which will create a core
> file of the thing being debugged...
>
> Chris


Thanks to everyone. gcore works seamlessly!

Jeremy

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com