Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* Minimal core dump mapping set
@ 2016-04-20 17:00 Кукушкин Павел Геннадьевич
  2016-04-22  5:25 ` vijay nag
  2016-04-27 18:39 ` Antoine Tremblay
  0 siblings, 2 replies; 3+ messages in thread
From: Кукушкин Павел Геннадьевич @ 2016-04-20 17:00 UTC (permalink / raw)
  To: gdb

Dear developers, 

I want to generate core dump file by application itself. Of course it supposed to be compatible with gdb. When I store all anonymous mappings to the file I get no problems. I can see stacks and heaps and so forth. But I want to store only stacks without heap. So I decided to skip anonymous mappings. Here I get in trouble. Gdb can't open that kind of core. I noticed that storing last 4 anonymous  mappings (I mean in proc maps list) solves the problem. But how can I be sure that and if the  particular mapping is vital for gdb. And what do those mappings keep. 

Thank you for answer, 
Pavel Kukushkin, 
kukp@1c.ru




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

* Re: Minimal core dump mapping set
  2016-04-20 17:00 Minimal core dump mapping set Кукушкин Павел Геннадьевич
@ 2016-04-22  5:25 ` vijay nag
  2016-04-27 18:39 ` Antoine Tremblay
  1 sibling, 0 replies; 3+ messages in thread
From: vijay nag @ 2016-04-22  5:25 UTC (permalink / raw)
  To: Кукушкин
	Павел
	Геннадьевич
  Cc: gdb

On Wed, Apr 20, 2016 at 10:29 PM, Кукушкин Павел Геннадьевич <kukp@1c.ru> wrote:
> Dear developers,
>
> I want to generate core dump file by application itself. Of course it supposed to be compatible with gdb. When I store all anonymous mappings to the file I get no problems. I can see stacks and heaps and so forth. But I want to store only stacks without heap. So I decided to skip anonymous mappings. Here I get in trouble. Gdb can't open that kind of core. I noticed that storing last 4 anonymous  mappings (I mean in proc maps list) solves the problem. But how can I be sure that and if the  particular mapping is vital for gdb. And what do those mappings keep.
>
> Thank you for answer,
> Pavel Kukushkin,
> kukp@1c.ru
>
>
>
If you are looking for only stacktrace, you don't have to bother about
including anonymous mappings of your task. You simply have to dump the
stack pages from the current stack-top ($esp or $rsp) till the stack
bottom(stack bottom can be the first variable in the main function) in
your signal handler if stack pages aren't corrupted(Use madvise or
msync to know the sanity of a page). Along with stack pages, you'll
need register contents especially ($eip/$rip) for stack crawling. With
this data, you can teach GDB to load the stack trace from your core by
writing a BFD backend.


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

* Re: Minimal core dump mapping set
  2016-04-20 17:00 Minimal core dump mapping set Кукушкин Павел Геннадьевич
  2016-04-22  5:25 ` vijay nag
@ 2016-04-27 18:39 ` Antoine Tremblay
  1 sibling, 0 replies; 3+ messages in thread
From: Antoine Tremblay @ 2016-04-27 18:39 UTC (permalink / raw)
  To: Кукушкин
	Павел
	Геннадьевич
  Cc: gdb


Кукушкин Павел Геннадьевич writes:

> Dear developers, 
>
> I want to generate core dump file by application itself. Of course it supposed to be compatible with gdb. When I store all anonymous mappings to the file I get no problems. I can see stacks and heaps and so forth. But I want to store only stacks without heap. So I decided to skip anonymous mappings. Here I get in trouble. Gdb can't open that kind of core. I noticed that storing last 4 anonymous  mappings (I mean in proc maps list) solves the problem. But how can I be sure that and if the  particular mapping is vital for gdb. And what do those mappings keep. 
>

Not sure about your exact issue but you may want to check
https://www.linutronix.de/minicoredumper/ if you have not already...

Regards,
Antoine


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

end of thread, other threads:[~2016-04-27 18:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-20 17:00 Minimal core dump mapping set Кукушкин Павел Геннадьевич
2016-04-22  5:25 ` vijay nag
2016-04-27 18:39 ` Antoine Tremblay

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox