This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB 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: [patch] Fix `return' of long/long-long results with no debuginfo


On Wed, 11 Feb 2009 23:37:38 +0100, Mark Kettenis wrote:
> > ..., would it be an idea to use the type of the return value
> > expression given by the user instead of int as a fallback?
> 
> Which you seemed to ignore.  I think it actually makes the return
> command more powerful, by letting the user (implicitly or explicitly)
> specify the return type of a function for which debugging information
> is missing.  Can you please consider the suggestion I make?

Your suggestion ("type of the return value expression given by the user"):
+ improvement over the current state (one _can_ return long or long long)
- may be more tricky to the user (requirement to cast to long or long long if
  the inferior function returns such type)
  (as the redhat.com Bug would be still filed on this implementation by the
   user I did not find it acceptable myself no matter of its technical aspects)

My suggestion (long long cast forced by GDB):
+ improvement over the current state - like yours
+ easier for the user automatically fixing his mistakes
- possibly incompatible with ABI having `int' value placement incompatible with
  `long long' value placement
- possibly incompatible with ABI not having `long' returned in a register
(both ABI requirements are compliant with the common ABIs I am aware of)

You are right I should have been more addressing your opinion.


Regards,
Jan


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