Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@polymtl.ca>
To: Eli Zaretskii <eliz@gnu.org>, Joel Brobecker <brobecker@adacore.com>
Cc: gdb-patches@sourceware.org
Subject: Re: GDB internal error in pc_in_thread_step_range
Date: Sun, 23 Dec 2018 15:33:00 -0000	[thread overview]
Message-ID: <ebcbf679-c43c-a2ca-36f7-cbdfb45f0ba7@polymtl.ca> (raw)
In-Reply-To: <834lb49sib.fsf@gnu.org>

On 2018-12-23 10:23 a.m., Eli Zaretskii wrote:
>> Date: Sun, 23 Dec 2018 09:35:02 +0400
>> From: Joel Brobecker <brobecker@adacore.com>
>> Cc: Eli Zaretskii <eliz@gnu.org>, gdb-patches@sourceware.org
>>
>>>>> Side-question, are there some debug symbols in the binary that could
>>>>> describe this location?
>>>>
>>>> How do I know that?
>>>
>>> I would normally use "readelf --debug-dump" to look at the DWARF info, but
>>> since this is not an ELF, I don't know.
>>
>> Objdump has the same kind of functionality for both DWARF and
>> the symbol table (--dwarf, -t, -T, etc).
> 
> Yes.  But in what part of its output would you expect to see debug
> symbols that describe this location?
> 

If you use "objdump --dwarf=info <binary>", then you can see some nodes representing
subprograms (functions), like this:

 <1><51>: Abbrev Number: 5 (DW_TAG_subprogram)
    <52>   DW_AT_external    : 1
    <52>   DW_AT_name        : (indirect string, offset: 0x257b): main
    <56>   DW_AT_decl_file   : 1
    <57>   DW_AT_decl_line   : 6
    <58>   DW_AT_decl_column : 5
    <59>   DW_AT_type        : <0x4a>
    <5d>   DW_AT_low_pc      : 0x1119
    <65>   DW_AT_high_pc     : 0xb
    <6d>   DW_AT_frame_base  : 1 byte block: 9c 	(DW_OP_call_frame_cfa)
    <6f>   DW_AT_GNU_all_call_sites: 1


Here, DW_AT_high_pc is actually an offset relative to DW_AT_low_pc. This means
my function main's range is [0x1119,0x1119+0xb[.  So you could search in that
output for "__mingw_CRTStartup", to see if there's a node describing that function.

Honestly, I would be quite surprised if you had DWARF info for it but not a basic
COFF symbol, but it costs nothing to check.

Simon


  reply	other threads:[~2018-12-23 15:33 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <83h8kjr8r6.fsf@gnu.org>
     [not found] ` <100001f1b27aa7d90902a75d5db37710@polymtl.ca>
2018-11-18 16:37   ` Eli Zaretskii
2018-11-30 13:42     ` Eli Zaretskii
2018-12-07  7:22       ` Eli Zaretskii
2018-12-15 12:07         ` Eli Zaretskii
2018-12-16  3:58     ` Simon Marchi
2018-12-16 15:40       ` Eli Zaretskii
2018-12-16 17:06         ` Simon Marchi
2018-12-16 17:22           ` Eli Zaretskii
2018-12-16 18:06             ` Simon Marchi
2018-12-19 15:50               ` Eli Zaretskii
2018-12-20  0:16                 ` Simon Marchi
2018-12-20 15:45                   ` Eli Zaretskii
2018-12-20 23:03                     ` Simon Marchi
2018-12-22  8:44                       ` Eli Zaretskii
2018-12-22 16:47                         ` Simon Marchi
2018-12-23  5:35                           ` Joel Brobecker
2018-12-23 15:23                             ` Eli Zaretskii
2018-12-23 15:33                               ` Simon Marchi [this message]
2018-12-23 16:10                           ` Eli Zaretskii
2018-12-23 23:31                             ` Simon Marchi
2018-12-24 16:14                               ` Eli Zaretskii
2018-12-24 16:29                                 ` Simon Marchi
2018-12-28  7:09                                   ` Eli Zaretskii
2018-12-28 10:09                                     ` Joel Brobecker
2018-12-28 10:15                                       ` Eli Zaretskii

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=ebcbf679-c43c-a2ca-36f7-cbdfb45f0ba7@polymtl.ca \
    --to=simon.marchi@polymtl.ca \
    --cc=brobecker@adacore.com \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    /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