public inbox for frysk-bugzilla@sourceware.org
help / color / mirror / Atom feed
* [Bug general/5869] New: can't print contents of a C string
@ 2008-03-04 22:25 tromey at redhat dot com
  2008-03-05  3:38 ` [Bug general/5869] " cagney at redhat dot com
  2008-03-05  3:59 ` cagney at redhat dot com
  0 siblings, 2 replies; 3+ messages in thread
From: tromey at redhat dot com @ 2008-03-04 22:25 UTC (permalink / raw)
  To: frysk-bugzilla

I have a "const char **" in my program.  I tried to print the
string but couldn't figure out how to get fhpd to print the contents

(fhpd) p pfilename
(const char **) 0x8b2797c
(fhpd) p *pfilename
(const char *) 0xbf8af822

-- 
           Summary: can't print contents of a C string
           Product: frysk
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: general
        AssignedTo: frysk-bugzilla at sourceware dot org
        ReportedBy: tromey at redhat dot com


http://sourceware.org/bugzilla/show_bug.cgi?id=5869

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug general/5869] can't print contents of a C string
  2008-03-04 22:25 [Bug general/5869] New: can't print contents of a C string tromey at redhat dot com
@ 2008-03-05  3:38 ` cagney at redhat dot com
  2008-03-05  3:59 ` cagney at redhat dot com
  1 sibling, 0 replies; 3+ messages in thread
From: cagney at redhat dot com @ 2008-03-05  3:38 UTC (permalink / raw)
  To: frysk-bugzilla


------- Additional Comments From cagney at redhat dot com  2008-03-05 03:37 -------
The "const" is likely throwing it vis:

$ ./frysk/bindir/fhpd ./frysk/pkglibdir/funit-hello
Loaded executable file:
/home/scratch/frysk/git/native/frysk-core/./frysk/pkglibdir/funit-hello
(fhpd) b main
breakpoint 0 deferred
(fhpd) run foo
Attached to process 30018
starting/running with this command: ./frysk/pkglibdir/funit-hello foo
Running process 30018
(fhpd) Breakpoint 0 main 0x804842a
list
[0.0]
    43   print(char *what) {
    44     while (*what != '\0') {
    45       write(1, what, 1);
    46       what++;
    47     }
    48   }
    49   
    50   int
    51   main(int argc, char** argv) {
    52     // XXX: This forgets to check ARGC.
->  53     print(argv[1]);
    54     print("\n");
    55     return 0;
    56   }
(fhpd) print argv
(char **) 0xbf945154
(fhpd) print *argv
(char *) 0xbf945986 "./frysk/pkglibdir/funit-hello"


-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=5869

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug general/5869] can't print contents of a C string
  2008-03-04 22:25 [Bug general/5869] New: can't print contents of a C string tromey at redhat dot com
  2008-03-05  3:38 ` [Bug general/5869] " cagney at redhat dot com
@ 2008-03-05  3:59 ` cagney at redhat dot com
  1 sibling, 0 replies; 3+ messages in thread
From: cagney at redhat dot com @ 2008-03-05  3:59 UTC (permalink / raw)
  To: frysk-bugzilla


------- Additional Comments From cagney at redhat dot com  2008-03-05 03:59 -------
commit ed3e465f0588c2297480be91501c431a5ccf2b22
Author: Andrew Cagney <cagney@redhat.com>
Date:   Tue Mar 4 22:57:25 2008 -0500

    Fix print const_char_pointer.
    
    frysk-core/frysk/value/ChangeLog
    2008-03-04  Andrew Cagney  <cagney@redhat.com>
    
        * TestPointer.java (testConstCharPointer()): New.
        * PointerType.java: Get the target's ultimate type.



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


http://sourceware.org/bugzilla/show_bug.cgi?id=5869

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-03-05  3:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-04 22:25 [Bug general/5869] New: can't print contents of a C string tromey at redhat dot com
2008-03-05  3:38 ` [Bug general/5869] " cagney at redhat dot com
2008-03-05  3:59 ` cagney at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).