This is the mail archive of the archer@sourceware.org mailing list for the Archer project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] Patch for gnats pr 2495


On Wed, Oct 22, 2008 at 8:15 AM, Phil Muldoon  wrote:
> Phil Muldoon wrote:
>>
>> Tom Tromey wrote:
>>>>>>>>
>>>>>>>> "Phil" == Phil Muldoon  writes:
>>>>>>>>
>>>
>>> Phil> This patch addresses that by gating access to std::terminate in an
>>> Phil> inferior function call.
>>>
>>> Sounds good.  The patch looks nice!  In fact the majority of my
>>> comments are on the string constants :-
>>
>> I've attached an updated patch. I think I caught all of your suggestions.
>>
> Sorry, I thought I checked this fix in before I submitted the patch for,
> but:
>
> +  if (unwind_on_terminating_exception_p)
> +    {
> +      tm = lookup_minimal_symbol ("std::terminate()", NULL, NULL);
> +      if (tm != NULL)
> +    terminate_bp = set_momentary_breakpoint_at_pc
> +      (SYMBOL_VALUE_ADDRESS (tm),  bp_breakpoint);
> +      make_cleanup_delete_breakpoint (terminate_bp);
> +    }
>
>
> should read:
> +  if (unwind_on_terminating_exception_p)
> +    {
> +      tm = lookup_minimal_symbol ("std::terminate()", NULL, NULL);
> +      if (tm != NULL)
> +       {
> +         terminate_bp = set_momentary_breakpoint_at_pc
> +           (SYMBOL_VALUE_ADDRESS (tm),  bp_breakpoint);
> +         make_cleanup_delete_breakpoint (terminate_bp);
> +       }
> +    }
>

Hi.  If the inferior exits gdb will now crash in the call to inferior_thread:

              if ((terminate_bp != NULL) &&
                  (inferior_thread()->stop_bpstat->breakpoint_at->address
                   == terminate_bp->loc->address))

I'll submit the attached patch upstream as while gdb doesn't crash,
the error message it currently prints is confusing.
Shall I check it into archer or the exception-rewind branch?

Attachment: gdb-081111-callexit-1.patch.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]