Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Danny Backx <danny.backx@scarlet.be>
To: Pedro Alves <pedro@codesourcery.com>
Cc: gdb-patches@sourceware.org
Subject: Re: Post mortem debugging for Windows CE
Date: Thu, 07 May 2009 01:21:00 -0000	[thread overview]
Message-ID: <1241659264.4083.268.camel@dannypc> (raw)
In-Reply-To: <200905062148.03196.pedro@codesourcery.com>

On Wed, 2009-05-06 at 21:48 +0100, Pedro Alves wrote:
> A few suggestions:
> 
>  - Please forgive me if you know this already.
>    Your minidump bfd code should work on all hosts, 64-bit, 32-bit,
>    big endian or little endian.  This means that code like:
[..]
>    ... is unacceptable.  You need to use the bfd_get_32 and friends
>    to parse the data on the file.

I'll start doing all that. I didn't know about avoiding structs so
this'll be some work.

Should they be avoided completely ? I wrote code like the snippet below.
Should the sizeof (CEDUMP_THREAD_CALL_STACK_LIST) be replaced ? Should
the struct definitions be gone completely, or still be there in
comment ?

Also this'll work for CE based minidumps now, not the ones from desktop
Windows. This may be as simple as getting the code to handle not only
the 
        ceStreamThreadCallStackList = 0x8007
but also the desktop value. But life is usually not that simple.

	Danny



  rva = minidump_core_locate_stream(abfd, ceStreamThreadCallStackList);
  if (bfd_seek (abfd, (file_ptr) rva, SEEK_SET) != 0)
    return;
  nread = bfd_bread (&tcsl, (bfd_size_type) sizeof
(CEDUMP_THREAD_CALL_STACK_LIST), abfd);
  if (nread != sizeof (CEDUMP_THREAD_CALL_STACK_LIST))
    {
      if (bfd_get_error () != bfd_error_system_call)
        bfd_set_error (bfd_error_wrong_format);
      return;
    }

  /*
   * Need to read all the CEDUMP_THREAD_CALL_STACK entries,
   * they're just after the CEDUMP_THREAD_CALL_STACK_LIST.
   * The CEDUMP_THREAD_CALL_STACK_FRAME fields are in potentially other
places though.
   * So allocate space for enough CEDUMP_THREAD_CALL_STACK_LIST entries.
   */
  sz = tcsl.NumberOfEntries * sizeof(CEDUMP_THREAD_CALL_STACK);
  tcs = bfd_malloc(sz);
  nread = bfd_bread (tcs, (bfd_size_type) sz, abfd);
  if (nread != sz)
    {
      if (bfd_get_error () != bfd_error_system_call)
        bfd_set_error (bfd_error_wrong_format);
      return;
    }




-- 
Danny Backx ; danny.backx - at - scarlet.be ; http://danny.backx.info


  reply	other threads:[~2009-05-07  1:21 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-28 14:45 Danny Backx
2009-04-28 16:02 ` Pedro Alves
2009-04-28 17:48   ` Danny Backx
2009-04-28 19:18     ` Danny Backx
2009-04-29  7:10       ` Eli Zaretskii
2009-04-29  7:19         ` Danny Backx
2009-04-29  7:44           ` Eli Zaretskii
2009-04-30  7:25   ` Danny Backx
2009-04-30  9:58     ` Pedro Alves
2009-05-01 14:35       ` Danny Backx
2009-05-01 15:37         ` Pedro Alves
2009-05-05 13:31           ` Danny Backx
2009-05-05 16:53             ` Pedro Alves
2009-05-06 14:13               ` Danny Backx
2009-05-06 14:34                 ` Pedro Alves
2009-05-06 20:05                   ` Danny Backx
2009-05-06 20:47                     ` Pedro Alves
2009-05-07  1:21                       ` Danny Backx [this message]
2009-05-10 19:21                         ` Pedro Alves
2009-05-11 14:03                           ` Danny Backx
2009-05-11 15:00                             ` Danny Backx

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=1241659264.4083.268.camel@dannypc \
    --to=danny.backx@scarlet.be \
    --cc=gdb-patches@sourceware.org \
    --cc=pedro@codesourcery.com \
    /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