×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Getting useful info from assert

    I've looked for the answer to this several times and never found anything: Is there any way to get any sort of useful information as a result of an "assert" failure, either on the emulator or on the hardware? The popup message shows you the name of the application and the first 5 characters of the failing test, which is not a great amount of help. And with all but the C++ exception traps enabled on the emulator, enabling those traps catches nothing. (The C++ trap, of course, catches every 3rd instruction.)

    With Qt I can put a stop at qFatal, but I haven't found the equivalent for native assertion failures.

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,734

    Re: Getting useful info from assert

    In this thread I have not really understood what you are asking, so check a possible answer in your RFile-related thread (http://discussion.forum.nokia.com/fo...d.php?t=201831)

  3. #3
    Super Contributor
    Join Date
    Jul 2008
    Posts
    2,020

    Re: Getting useful info from assert

    Do I understand you correctly: you want to get some data out about the system state when the assert occurs?
    The lines above are the best I have to offer.If anyone of you is of more advanced knowledge, I ask for your patience and understanding! - unknown arab poet
    http://www.tamoggemon.com - Symbian blog - Windows Phone blog
    My other blogs:
    webOS blog iPhone blog BlackBerry blog Samsung bada blog Android blog

  4. #4
    Super Contributor
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968

    Re: Getting useful info from assert

    you can use Crash-debugger in case of Symbian.C++ donot know if that applies to Qt For Symbian too.

  5. #5
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: Getting useful info from assert

    Quote Originally Posted by tamhanna View Post
    Do I understand you correctly: you want to get some data out about the system state when the assert occurs?
    A simple traceback would be nice. Symbian has some of the worst diagnostic facilities I've ever seen (and that's saying quite a bit, since I'm including switches and lights).

  6. #6
    Super Contributor
    Join Date
    Jul 2008
    Posts
    2,020

    Re: Getting useful info from assert

    Hi,
    in qt you can just use qDebug() and send it to the PC. In native Symbian code, the call is:
    Code:
    RDebug::Print( _L("CSndMixer::Pause") );
    Then run the app tethered on device, and see in the console window of the carbide.
    The lines above are the best I have to offer.If anyone of you is of more advanced knowledge, I ask for your patience and understanding! - unknown arab poet
    http://www.tamoggemon.com - Symbian blog - Windows Phone blog
    My other blogs:
    webOS blog iPhone blog BlackBerry blog Samsung bada blog Android blog

  7. #7
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: Getting useful info from assert

    That's just another variation of println. I've got my own that works pretty well, and writes to a file on the device so that I don't need device debug to work. Still doesn't do a traceback, though. Heck, even my old Small-c environment did a traceback on abort.

  8. #8
    Super Contributor
    Join Date
    Jul 2008
    Posts
    2,020

    Re: Getting useful info from assert

    Hi,
    IMHO, you can get a stack trace on fail only in the WINSCW emulator!

    With best regards
    Tam Hanna
    The lines above are the best I have to offer.If anyone of you is of more advanced knowledge, I ask for your patience and understanding! - unknown arab poet
    http://www.tamoggemon.com - Symbian blog - Windows Phone blog
    My other blogs:
    webOS blog iPhone blog BlackBerry blog Samsung bada blog Android blog

  9. #9
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: Getting useful info from assert

    And even there it's not a given.

    If there's enough info in the stack to do Trap/exception handling, there's enough to produce a traceback. There's no real excuse for not having the function on the hardware too.

  10. #10
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,734

    Re: Getting useful info from assert

    The panic breakpoint is somewhere in the middle of euser.dll, or something similar. Since the firmware is built from release code it contains no debug info, and in addition it is not available in the SDK. This is where constructing an usable stack trace begins to be complicated.

  11. #11
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: Getting useful info from assert

    It doesn't have to materialize the method names for the system lib routines (though that would be nice), but having a stack trace that shows where your code called the system lib would be invaluable.

  12. #12
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,734

    Re: Getting useful info from assert

    I understand your need, just the CPU stack contains simple numbers, and it is hard to decide which number is a return address to an other method (and to your own code at the end), which number contains "TInt a=5", which number is just a part of a larger class/structure (TSize.iWidth=10), which is a pointer to the heap, which is a pointer which has not been initialized yet (=it contains a random number practically). Numbers are hard to interpret if you do not know their role and type, and in case of RISC architecture (ARM=Advanced RISC Machine) the extended usage of processor registers makes things even harder.

  13. #13
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: Getting useful info from assert

    As I said, if they can do Traps and exceptions and auto object destructors then the information's there.

  14. #14
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: Getting useful info from assert

    (BTW, I worked with RISC processors at the instruction level from 1992 until about a year ago. Implemented both a C++ runtime and a Java runtime, among other things.)

  15. #15
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,734

    Re: Getting useful info from assert

    Quote Originally Posted by danhicksbyron View Post
    As I said, if they can do Traps and exceptions and auto object destructors then the information's there.
    These things are part of the execution, they happen inside your code. On the other hand the debugger is looking at the stack from outside.
    Actually I have not worked with RISC processors, but as far as I know they prefer a register-oriented programming style, so the stack frame for the current method does not necessarily exist at all, half of the registers contain variables for the current method, the other half for the caller methods, something is really on the stack, but even the return address may be in any register - and we are talking about a situation where the debugger has no idea about what it is looking at.

Similar Threads

  1. Nokia 5800 XpressMusic accerated video decoders
    By Gingah in forum General Development Questions
    Replies: 4
    Last Post: 2009-07-06, 17:44
  2. JavaME SDK 3 EA, want start anymore on my system.
    By sblantipodi in forum Mobile Java General
    Replies: 7
    Last Post: 2009-03-16, 09:25
  3. Replies: 0
    Last Post: 2008-09-17, 13:16
  4. Problem with running SnapMobileSample
    By quanxpro in forum Mobile Java Games
    Replies: 7
    Last Post: 2008-04-25, 18:27
  5. Problem executing Maze Racer
    By IFtechsupport in forum Mobile Java Games
    Replies: 1
    Last Post: 2006-09-22, 17:18

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×