* [patch/5.2/commit] Zap __func__
@ 2002-07-15 9:50 Andrew Cagney
2002-07-15 11:18 ` Daniel Jacobowitz
0 siblings, 1 reply; 5+ messages in thread
From: Andrew Cagney @ 2002-07-15 9:50 UTC (permalink / raw)
To: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 117 bytes --]
Just FYI,
I've committed this to the 5.2 branch - zap more __func__s. It's brutal
but it works :-)
enjoy,
Andrew
[-- Attachment #2: diffs --]
[-- Type: text/plain, Size: 1154 bytes --]
2002-07-15 Andrew Cagney <ac131313@redhat.com>
* dwarf2cfi.c: Replace __func__ with "?func?".
Index: dwarf2cfi.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2cfi.c,v
retrieving revision 1.1.2.5
diff -u -r1.1.2.5 dwarf2cfi.c
--- dwarf2cfi.c 3 Jul 2002 06:00:26 -0000 1.1.2.5
+++ dwarf2cfi.c 15 Jul 2002 16:40:58 -0000
@@ -860,7 +860,7 @@
}
else
internal_error (__FILE__, __LINE__,
- "%s(): Internal error: fde->cie_ptr==NULL !", __func__);
+ "%s(): Internal error: fde->cie_ptr==NULL !", "?func?");
}
static void
@@ -1361,7 +1361,7 @@
orig_context->reg[fs->regs.reg[i].loc.reg].loc.addr;
default:
internal_error (__FILE__, __LINE__,
- "%s: unknown register rule", __func__);
+ "%s: unknown register rule", "?func?");
}
break;
case REG_SAVED_EXP:
@@ -1379,7 +1379,7 @@
break;
default:
internal_error (__FILE__, __LINE__,
- "%s: unknown register rule", __func__);
+ "%s: unknown register rule", "?func?");
}
get_reg ((char *) &context->ra, context, fs->retaddr_column);
unwind_tmp_obstack_free ();
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [patch/5.2/commit] Zap __func__
2002-07-15 9:50 [patch/5.2/commit] Zap __func__ Andrew Cagney
@ 2002-07-15 11:18 ` Daniel Jacobowitz
2002-07-15 13:09 ` Andrew Cagney
0 siblings, 1 reply; 5+ messages in thread
From: Daniel Jacobowitz @ 2002-07-15 11:18 UTC (permalink / raw)
To: Andrew Cagney; +Cc: gdb-patches
On Mon, Jul 15, 2002 at 12:42:49PM -0400, Andrew Cagney wrote:
> Just FYI,
>
> I've committed this to the 5.2 branch - zap more __func__s. It's brutal
> but it works :-)
>
> enjoy,
> Andrew
> 2002-07-15 Andrew Cagney <ac131313@redhat.com>
>
> * dwarf2cfi.c: Replace __func__ with "?func?".
Er, hunh?
First of all, is there any reason that __FUNCTION__ is not adequately
portable? I think it is. Second of all, if you're going to remove
__func__ you could at least replace it with the name of the function.
--
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [patch/5.2/commit] Zap __func__
2002-07-15 11:18 ` Daniel Jacobowitz
@ 2002-07-15 13:09 ` Andrew Cagney
2002-07-15 13:42 ` Daniel Jacobowitz
0 siblings, 1 reply; 5+ messages in thread
From: Andrew Cagney @ 2002-07-15 13:09 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: gdb-patches
> On Mon, Jul 15, 2002 at 12:42:49PM -0400, Andrew Cagney wrote:
>
>> Just FYI,
>>
>> I've committed this to the 5.2 branch - zap more __func__s. It's brutal
>> but it works :-)
>>
>> enjoy,
>> Andrew
>
>
>> 2002-07-15 Andrew Cagney <ac131313@redhat.com>
>>
>> * dwarf2cfi.c: Replace __func__ with "?func?".
>
>
> Er, hunh?
>
> First of all, is there any reason that __FUNCTION__ is not adequately
> portable? I think it is. Second of all, if you're going to remove
> __func__ you could at least replace it with the name of the function.
Remember this is a branch and those ``__func__''s were only printed when
there was an internal_error() - I don't think anyone is going to notice
:-). The correct clean fix was committed to the mainline a few hours
earlier (I looked at back patching it but noticed too many differences).
As for __FUNCTION__, that isn''t part of ISO C 90.
enjoy,
Andrew
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [patch/5.2/commit] Zap __func__
2002-07-15 13:09 ` Andrew Cagney
@ 2002-07-15 13:42 ` Daniel Jacobowitz
2002-07-15 15:00 ` Andrew Cagney
0 siblings, 1 reply; 5+ messages in thread
From: Daniel Jacobowitz @ 2002-07-15 13:42 UTC (permalink / raw)
To: Andrew Cagney; +Cc: gdb-patches
On Mon, Jul 15, 2002 at 04:09:35PM -0400, Andrew Cagney wrote:
> >On Mon, Jul 15, 2002 at 12:42:49PM -0400, Andrew Cagney wrote:
> >
> >>Just FYI,
> >>
> >>I've committed this to the 5.2 branch - zap more __func__s. It's brutal
> >>but it works :-)
> >>
> >>enjoy,
> >>Andrew
> >
> >
> >>2002-07-15 Andrew Cagney <ac131313@redhat.com>
> >>
> >> * dwarf2cfi.c: Replace __func__ with "?func?".
> >
> >
> >Er, hunh?
> >
> >First of all, is there any reason that __FUNCTION__ is not adequately
> >portable? I think it is. Second of all, if you're going to remove
> >__func__ you could at least replace it with the name of the function.
>
> Remember this is a branch and those ``__func__''s were only printed when
> there was an internal_error() - I don't think anyone is going to notice
> :-). The correct clean fix was committed to the mainline a few hours
> earlier (I looked at back patching it but noticed too many differences).
- internal_error (__FILE__, __LINE__,
- "%s: unknown register rule", __func__);
+ internal_error (__FILE__, __LINE__, "bad switch");
Is there any reason not to leave the error message as it was? It's
just a matter of "update_context: unknown register rule". Replacing a
clear internal error with "bad switch" doesn't seem like a good move.
(having an internal_error here is a little shady anyway, it's like
abort()ing on user input)
> As for __FUNCTION__, that isn''t part of ISO C 90.
Yep, you're right.
--
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [patch/5.2/commit] Zap __func__
2002-07-15 13:42 ` Daniel Jacobowitz
@ 2002-07-15 15:00 ` Andrew Cagney
0 siblings, 0 replies; 5+ messages in thread
From: Andrew Cagney @ 2002-07-15 15:00 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: gdb-patches
> Remember this is a branch and those ``__func__''s were only printed when
>> there was an internal_error() - I don't think anyone is going to notice
>> :-). The correct clean fix was committed to the mainline a few hours
>> earlier (I looked at back patching it but noticed too many differences).
>
>
> - internal_error (__FILE__, __LINE__,
> - "%s: unknown register rule", __func__);
> + internal_error (__FILE__, __LINE__, "bad switch");
>
> Is there any reason not to leave the error message as it was? It's
> just a matter of "update_context: unknown register rule". Replacing a
> clear internal error with "bad switch" doesn't seem like a good move.
If it really is an internal error due to a messed up switch then I think
the message is sufficient. However ....
> (having an internal_error here is a little shady anyway, it's like
> abort()ing on user input)
.... it sounds like these should be replaced by error() (or complain()).
If it is triggered by a bad input file then, yes, you are correct.
Andrew
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2002-07-15 20:42 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-15 9:50 [patch/5.2/commit] Zap __func__ Andrew Cagney
2002-07-15 11:18 ` Daniel Jacobowitz
2002-07-15 13:09 ` Andrew Cagney
2002-07-15 13:42 ` Daniel Jacobowitz
2002-07-15 15:00 ` Andrew Cagney
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox