Bug 5416 - <<fhpd) print argv[1]>> gets an error
Summary: <<fhpd) print argv[1]>> gets an error
Status: RESOLVED FIXED
Alias: None
Product: frysk
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Teresa Thomas
URL:
Keywords:
Depends on:
Blocks: 2246 5421
  Show dependency treegraph
 
Reported: 2007-11-27 19:48 UTC by Andrew Cagney
Modified: 2008-03-07 15:46 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Cagney 2007-11-27 19:48:58 UTC
When printing a <<char*>> (such as argv[1]) that is null, the output looks like:
   (char*) 0x1234 "Error: ...
the string should only be printed when the memory is accessable (at least the
first character).
Comment 1 Teresa Thomas 2007-11-30 18:25:35 UTC
    Catch exceptions on memory errors while printing pointers.
    
    frysk-core/frysk/value/ChangeLog
    2007-11-29  Teresa Thomas  <tthomas@redhat.com>
    
    	* PointerType.java (toPrint): Catch exception
    	on memory error.
Comment 2 Mark Wielaard 2007-12-05 16:11:46 UTC
What should happen given:

  (fhpd) print *(int*)1

The suggestion is to introduce an frysk.MemoryException.MemoryException(long
address, <other information>, possible underlying RuntimeException) extends
RuntimeException (or FryskException extends RUntimeException -- later).

and "encourage" memory code in the core to catch and re-throw that.


Comment 3 Teresa Thomas 2008-03-07 15:46:07 UTC
(fhpd) print argv[2]
(char *) 0x0 " < Memory Error > "