stack tracing

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jon Slaughter

    stack tracing

    Is there anything in php that lets me trace the call stack or do I have to
    implement something like that on my own?

    e.g., I could insert somethign like $callstack[sizeof($callsta ck)] =
    __FUNCTION__; at the top of every function and
    unset($callstac k[sizeof($callsta ck)-1]);

    So that I could trace the to code to where an error occured and know the
    function "path" that created it. Of course its probalby not worth it if I
    have to clutter up all the code very every return statement will need to
    have that coupled with it.

    Thanks,
    Jon


  • =?ISO-8859-15?Q?Oliver_Gr=E4tz?=

    #2
    Re: stack tracing

    Jon Slaughter schrieb:
    Is there anything in php that lets me trace the call stack or do I have to
    implement something like that on my own?
    How about googling for "php call stack"?

    *SCNR*

    OLLi

    --
    "Well, lady I must say-- (admiring smile) You're my kinda stupid."
    [Mal, firefly 113]

    Comment

    • gosha bine

      #3
      Re: stack tracing

      On 14.05.2007 04:00 Oliver Grätz wrote:
      Jon Slaughter schrieb:
      >Is there anything in php that lets me trace the call stack or do I have to
      >implement something like that on my own?
      >
      How about googling for "php call stack"?
      >
      *SCNR*
      >
      OLLi
      >
      Well, this brings up 4 links none of which have to do with the question.
      Got another google? ;)

      --
      gosha bine

      extended php parser ~ http://code.google.com/p/pihipi
      blok ~ http://www.tagarga.com/blok

      Comment

      • gosha bine

        #4
        Re: stack tracing

        On 14.05.2007 02:06 Jon Slaughter wrote:
        Is there anything in php that lets me trace the call stack or do I have to
        implement something like that on my own?
        >
        e.g., I could insert somethign like $callstack[sizeof($callsta ck)] =
        __FUNCTION__; at the top of every function and
        unset($callstac k[sizeof($callsta ck)-1]);
        >
        So that I could trace the to code to where an error occured and know the
        function "path" that created it. Of course its probalby not worth it if I
        have to clutter up all the code very every return statement will need to
        have that coupled with it.
        >
        Thanks,
        Jon
        >
        >
        hi, look for debug_backtrace in manual

        --
        gosha bine

        extended php parser ~ http://code.google.com/p/pihipi
        blok ~ http://www.tagarga.com/blok

        Comment

        • Schraalhans Keukenmeester

          #5
          Re: stack tracing

          At Mon, 14 May 2007 10:13:43 +0200, gosha bine let his monkeys type:
          On 14.05.2007 04:00 Oliver Grätz wrote:
          >Jon Slaughter schrieb:
          >>Is there anything in php that lets me trace the call stack or do I
          >>have to implement something like that on my own?
          >>
          >How about googling for "php call stack"?
          >>
          >*SCNR*
          >>
          >OLLi
          >>
          >>
          Well, this brings up 4 links none of which have to do with the question.
          Got another google? ;)
          You could try a php debugger, such as Gubed, Xdebug.

          Comment

          • Toby A Inkster

            #6
            Re: stack tracing

            Jon Slaughter wrote:
            So that I could trace the to code to where an error occured and know the
            function "path" that created it.
            Use Exceptions:

            throw new Exception("Argh !");

            --
            Toby A Inkster BSc (Hons) ARCS
            Fast withdrawal casino UK 2025 – Play now & cash out instantly! Discover the top sites for rapid, secure payouts with no delays.

            Geek of ~ HTML/SQL/Perl/PHP/Python/Apache/Linux

            Comment

            • Jerry Stuckle

              #7
              Re: stack tracing

              gosha bine wrote:
              On 14.05.2007 04:00 Oliver Grätz wrote:
              >Jon Slaughter schrieb:
              >>Is there anything in php that lets me trace the call stack or do I
              >>have to implement something like that on my own?
              >>
              >How about googling for "php call stack"?
              >>
              >*SCNR*
              >>
              >OLLi
              >>
              >
              Well, this brings up 4 links none of which have to do with the question.
              Got another google? ;)
              >
              Take a look at debug_backtrace ();

              --
              =============== ===
              Remove the "x" from my email address
              Jerry Stuckle
              JDS Computer Training Corp.
              jstucklex@attgl obal.net
              =============== ===

              Comment

              • =?ISO-8859-15?Q?Oliver_Gr=E4tz?=

                #8
                Re: stack tracing

                gosha bine schrieb:
                >How about googling for "php call stack"?
                >>
                >*SCNR*
                Well, this brings up 4 links none of which have to do with the question.
                Got another google? ;)
                I switched my Google settings to the original english google.com to
                check this BEFORE answering so don't try to pull one on me. Result
                number 2 is



                OLLi

                --
                According to my calculations the problem doesn't exist.

                Comment

                • gosha bine

                  #9
                  Re: stack tracing

                  Oliver Grätz wrote:
                  gosha bine schrieb:
                  >>How about googling for "php call stack"?
                  >>>
                  >>*SCNR*
                  >Well, this brings up 4 links none of which have to do with the question.
                  >Got another google? ;)
                  >
                  I switched my Google settings to the original english google.com to
                  check this BEFORE answering so don't try to pull one on me. Result
                  number 2 is
                  >

                  >
                  OLLi
                  >

                  isn't that what you said?

                  if you rtfm someone, be prepared to be rtfm'd yourself. ;)




                  --
                  gosha bine

                  extended php parser ~ http://code.google.com/p/pihipi
                  blok ~ http://www.tagarga.com/blok

                  Comment

                  • Schraalhans Keukenmeester

                    #10
                    Re: stack tracing

                    At Mon, 14 May 2007 23:06:05 +0200, gosha bine let his monkeys type:
                    Oliver Grätz wrote:
                    >gosha bine schrieb:
                    >>>How about googling for "php call stack"?
                    >>>>
                    >>>*SCNR*
                    >>Well, this brings up 4 links none of which have to do with the question.
                    >>Got another google? ;)
                    >>
                    >I switched my Google settings to the original english google.com to
                    >check this BEFORE answering so don't try to pull one on me. Result
                    >number 2 is
                    >>
                    >http://www.php.net/debug_backtrace
                    >>
                    >OLLi
                    >>
                    >

                    isn't that what you said?
                    >
                    if you rtfm someone, be prepared to be rtfm'd yourself. ;)
                    Gosha, I'm not sure what your gripe with Olli or his reply to OP is, but
                    on my system and ENGLISH google it's the 2nd hit (probably since a few
                    here checked the link). So his reply hit the mark, I suppose. Perhaps you
                    checked in a non-enlish version? Or are ou referring to something
                    completely different (in which case I apologize for the confusion)

                    Sh.

                    Comment

                    • Jon Slaughter

                      #11
                      Re: stack tracing


                      "gosha bine" <stereofrog@gma il.comwrote in message
                      news:4648d0ca$0 $2889$6e1ede2f@ read.cnntp.org. ..
                      Oliver Grätz wrote:
                      >gosha bine schrieb:
                      >>>How about googling for "php call stack"?
                      >>>>
                      >>>*SCNR*
                      >>Well, this brings up 4 links none of which have to do with the question.
                      >>Got another google? ;)
                      >>
                      >I switched my Google settings to the original english google.com to
                      >check this BEFORE answering so don't try to pull one on me. Result
                      >number 2 is
                      >>
                      >http://www.php.net/debug_backtrace
                      >>
                      >OLLi
                      >>
                      >

                      isn't that what you said?
                      >
                      if you rtfm someone, be prepared to be rtfm'd yourself. ;)
                      >
                      >
                      >
                      >

                      Technically your right!! I think Oliver owes you an apology ;)


                      Comment

                      • Toby A Inkster

                        #12
                        Re: stack tracing

                        Schraalhans Keukenmeester wrote:
                        Gosha, I'm not sure what your gripe with Olli or his reply to OP is, but
                        on my system and ENGLISH google it's the 2nd hit (probably since a few
                        here checked the link). So his reply hit the mark, I suppose. Perhaps you
                        checked in a non-enlish version? Or are ou referring to something
                        completely different (in which case I apologize for the confusion)

                        -vs-


                        --
                        Toby A Inkster BSc (Hons) ARCS
                        Fast withdrawal casino UK 2025 – Play now & cash out instantly! Discover the top sites for rapid, secure payouts with no delays.

                        Geek of ~ HTML/SQL/Perl/PHP/Python/Apache/Linux

                        Comment

                        • Schraalhans Keukenmeester

                          #13
                          Re: stack tracing

                          At Tue, 15 May 2007 06:19:37 +0100, Toby A Inkster let his monkeys type:
                          Schraalhans Keukenmeester wrote:
                          >
                          >Gosha, I'm not sure what your gripe with Olli or his reply to OP is, but
                          >on my system and ENGLISH google it's the 2nd hit (probably since a few
                          >here checked the link). So his reply hit the mark, I suppose. Perhaps you
                          >checked in a non-enlish version? Or are ou referring to something
                          >completely different (in which case I apologize for the confusion)
                          >

                          -vs-
                          http://www.google.com/search?q=%22php+call+stack%22
                          Yep, I missed that. Not sure that's what Olli intended by "php call stack"
                          but it's feasable one would use the quoted string.
                          Thanks for clearing that up Toby!

                          I'll crawl back under my rock now.
                          Sh.

                          Comment

                          • gosha bine

                            #14
                            Re: stack tracing

                            On 15.05.2007 01:13 Schraalhans Keukenmeester wrote:
                            At Mon, 14 May 2007 23:06:05 +0200, gosha bine let his monkeys type:
                            >
                            >Oliver Grätz wrote:
                            >>gosha bine schrieb:
                            >>>>How about googling for "php call stack"?
                            >>>>>
                            >>>>*SCNR*
                            >>>Well, this brings up 4 links none of which have to do with the question.
                            >>>Got another google? ;)
                            >>I switched my Google settings to the original english google.com to
                            >>check this BEFORE answering so don't try to pull one on me. Result
                            >>number 2 is
                            >>>
                            >>http://www.php.net/debug_backtrace
                            >>>
                            >>OLLi
                            >>>
                            >http://www.google.com/search?q=%22php+call+stack%22
                            >isn't that what you said?
                            >>
                            >if you rtfm someone, be prepared to be rtfm'd yourself. ;)
                            >
                            Gosha, I'm not sure what your gripe with Olli or his reply to OP is, but
                            on my system and ENGLISH google it's the 2nd hit (probably since a few
                            here checked the link). So his reply hit the mark, I suppose. Perhaps you
                            checked in a non-enlish version? Or are ou referring to something
                            completely different (in which case I apologize for the confusion)
                            >
                            Sh.
                            >
                            Schraalhans,

                            I have no gripe with Olli personally, I just don't like "google for xyz"
                            kind of replies. They do nothing but show disrespect to OP and to the
                            group as whole. Hope you understand this.

                            --
                            gosha bine

                            extended php parser ~ http://code.google.com/p/pihipi
                            blok ~ http://www.tagarga.com/blok

                            Comment

                            • Schraalhans Keukenmeester

                              #15
                              Re: stack tracing

                              At Tue, 15 May 2007 10:03:29 +0200, gosha bine let his monkeys type:
                              On 15.05.2007 01:13 Schraalhans Keukenmeester wrote:
                              >At Mon, 14 May 2007 23:06:05 +0200, gosha bine let his monkeys type:
                              >>
                              >>Oliver Grätz wrote:
                              >>>gosha bine schrieb:
                              >>>>>How about googling for "php call stack"?
                              >>>>>>
                              >>>>>*SCNR*
                              >>>>Well, this brings up 4 links none of which have to do with the question.
                              >>>>Got another google? ;)
                              >>>I switched my Google settings to the original english google.com to
                              >>>check this BEFORE answering so don't try to pull one on me. Result
                              >>>number 2 is
                              >>>>
                              >>>http://www.php.net/debug_backtrace
                              >>>>
                              >>>OLLi
                              >>>>
                              >>http://www.google.com/search?q=%22php+call+stack%22
                              >>isn't that what you said?
                              >>>
                              >>if you rtfm someone, be prepared to be rtfm'd yourself. ;)
                              >>
                              >Gosha, I'm not sure what your gripe with Olli or his reply to OP is, but
                              >on my system and ENGLISH google it's the 2nd hit (probably since a few
                              >here checked the link). So his reply hit the mark, I suppose. Perhaps you
                              >checked in a non-enlish version? Or are ou referring to something
                              >completely different (in which case I apologize for the confusion)
                              >>
                              >Sh.
                              >>
                              >
                              Schraalhans,
                              >
                              I have no gripe with Olli personally, I just don't like "google for xyz"
                              kind of replies. They do nothing but show disrespect to OP and to the
                              group as whole. Hope you understand this.
                              I see what you mean Gosha. Personally I lean towards sympathizing
                              with the one writing such a response to a question that OP simply could at
                              least have tried to find an answer to. Some people (if the shoe fits....)
                              tend to (ab)use newsgroups as their first source of information.
                              How to tell them to do their homework first next time is a matter of
                              personal preference, mood of the day, social skills, the desire to
                              please, the weather perhaps and then some. With you I am all for a polite
                              approach, unless someone clearly and repeatedly disregards any advice
                              given. And yes, I know using the plonk button in these cases is better
                              than writing a flame, but sometimes the itch is too intense not to scratch
                              it.

                              Thanks for your explanation Gosha!
                              Sh.

                              P.S. Jon, have you by now found what you were looking for? In the "heat of
                              the debate" the threat wandered off a little...

                              Comment

                              Working...