472,359 Members | 1,625 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,359 software developers and data experts.

help needed in debug please

pmm
hi all ,
I am working on a router which is Coded in ansi C ,it uses number of
semaphores,threads
I want to know that how can we know what threads are currently alive
in a program being executed ,I do not have the support of <bold> GDB on
my target board ,not even gdbserver,</bold> my way is very crude by
placing print stmts in between the line and knowing the status.
kindly suggest me a way to know what threads are alive as one of then
throwing a segfault I am not able to determine which one
thanks in advance
PMM

Dec 31 '05 #1
8 1158
"pmm" <mu************@hotmail.com> writes:
I am working on a router which is Coded in ansi C ,it uses number of
semaphores,threads
I want to know that how can we know what threads are currently alive
in a program being executed ,I do not have the support of <bold> GDB on
my target board ,not even gdbserver,</bold> my way is very crude by
placing print stmts in between the line and knowing the status.
kindly suggest me a way to know what threads are alive as one of then
throwing a segfault I am not able to determine which one
thanks in advance


Standard C has no support for threads. Try a newsgroup specific to
your system, or perhaps comp.programming.threads.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Dec 31 '05 #2
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

pmm wrote:
hi all ,
I am working on a router which is Coded in ansi C ,it uses number of
semaphores,threads
Then, it isn't really ANSI C, is it? (Considering that ANSI C doesn't include
semaphores or threads; those are add-ons, and outside of ANSI C's purvue)
I want to know that how can we know what threads are currently alive
in a program being executed ,I do not have the support of <bold> GDB on
my target board ,not even gdbserver,</bold> my way is very crude by
placing print stmts in between the line and knowing the status.
kindly suggest me a way to know what threads are alive as one of then
throwing a segfault I am not able to determine which one
thanks in advance


You'll have to check with the creator/supplier of the semaphore and threading
library add-on. Perhaps they can help.

FWIW, you are in a bit of a bind. Assuming that your platform doesn't support
any independant external method of checking thread status (like using process
statistics gathered by the OS, for instance), and you don't have access to any
third-party diagnostics (like gdb), then you are entirely dependant on the
tools that your vendor has provided you. You really should check with them as
to how they enable or facilitate problem diagnosis in their threading package.
Certainly, there's nothing in ANSI C that will help you, beyond those tools
that you've already found (print statements, etc.).
- --
Lew Pitcher

Master Codewright & JOAT-in-training | GPG public key available on request
Registered Linux User #112576 (http://counter.li.org/)
Slackware - Because I know what I'm doing.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.7 (GNU/Linux)

iD8DBQFDtiklagVFX4UWr64RAouTAJ43tEHmb1UCM+396j/pzYlULhWCqwCgq0Z5
8P+GCEgsAvaFnmZEZtN2cW4=
=4fy0
-----END PGP SIGNATURE-----
Dec 31 '05 #3
pmm
Hi , Thanks for the reply
Its my mistake to specify as ANSI C I am sorry for that
I am on linux Redhat 9, GCC version 3.2.2
target board is on i386-linux snapgear build for amd processor

Dec 31 '05 #4
pmm
Hi , Thanks for the reply
Its my mistake to specify as ANSI C I am sorry for that
I am on linux Redhat 9, GCC version 3.2.2
target board is on i386-linux snapgear build for amd processor

Dec 31 '05 #5
pmm wrote:

Its my mistake to specify as ANSI C I am sorry for that
I am on linux Redhat 9, GCC version 3.2.2
target board is on i386-linux snapgear build for amd processor


You failed to offer the courtesy of including context and
attributions. See my sig. below for suitable means.

Whatever system you are using is immaterial. c.l.c only discusses
standard C, as specified by the appropriate ISO standards (and K&R
C). Any other flavor is off-topic, and should be taken to a
newsgroup dealing with that particular system.

--
"If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson
More details at: <http://cfaj.freeshell.org/google/>
Dec 31 '05 #6
On 30 Dec 2005 23:23:34 -0800, "pmm" <mu************@hotmail.com>
wrote:
Hi , Thanks for the reply
Its my mistake to specify as ANSI C I am sorry for that
I am on linux Redhat 9, GCC version 3.2.2
target board is on i386-linux snapgear build for amd processor


OT

I feel your pain. I've spent my entire career debugging games
consoles and embedded systems with no debuggers. Printf is your best
friend, especially if you have an unbuffered version.
Try not starting some of the threads and see what happens.
If this is something new that's happening, go back to old working code
in your source management tool and roll versions forward until the
problem re-occurs. If it's new code, try doing a code review and
working through tough areas of code on paper. Code reviews work.
Add some exception handling to your OS. Give each thread a name at
initialisation so the exception handler can print the name of the
crashing thread.
Try building the code with maxiumum warnings and maximum standards
compliance enabled. Try building with another compiler on another
platform.

Jim
Dec 31 '05 #7
pmm

JimS wrote:
On 30 Dec 2005 23:23:34 -0800, "pmm" <mu************@hotmail.com>
wrote:
Hi , Thanks for the reply
Its my mistake to specify as ANSI C I am sorry for that
I am on linux Redhat 9, GCC version 3.2.2
target board is on i386-linux snapgear build for amd processor


OT

I feel your pain. I've spent my entire career debugging games
consoles and embedded systems with no debuggers. Printf is your best
friend, especially if you have an unbuffered version.
Try not starting some of the threads and see what happens.
If this is something new that's happening, go back to old working code
in your source management tool and roll versions forward until the
problem re-occurs. If it's new code, try doing a code review and
working through tough areas of code on paper. Code reviews work.
Add some exception handling to your OS. Give each thread a name at
initialisation so the exception handler can print the name of the
crashing thread.
Try building the code with maxiumum warnings and maximum standards
compliance enabled. Try building with another compiler on another
platform.

Jim


Hi,
Thanks for reply
I am working on your suggestions
thanks again
bye
PMM

Dec 31 '05 #8
pmm
hi ,
I am sorry Mr.Keith that wont be repeated again
thanx

Jan 2 '06 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: rh0dium | last post by:
Hi all, So I have a slice of code which calls other python code. I have started to take a real liking to the logging module, but I want to extend this into the called python code. I have no...
4
by: pshindle | last post by:
DB2 Team - I just downloaded and unzipped the new Fixpack 9 for DB2 ESE V8 for Windows (FP9_WR21350_ESE.exe). I then burned the unzipped Fixpack files to a CD. I proceded to install this...
4
by: Tarique Jawed | last post by:
Alright I needed some help regarding a removal of a binary search tree. Yes its for a class, and yes I have tried working on it on my own, so no patronizing please. I have most of the code working,...
6
by: gregory_may | last post by:
I am dying trying to get the GinaStub example to work at: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcsample98/html/vcsmpginastubsample.asp Any help is greatly...
5
by: SStory | last post by:
Hi all, I really needed to get the icons associated with each file that I want to show in a listview. I used the follow modified code sniplets found on the internet. I have left in...
10
by: Mae Lim | last post by:
Dear all, I'm new to C# WebServices. I compile the WebService project it return no errors "Build: 1 succeeded, 0 failed, 0 skipped". Basically I have 2 WebMethod, when I try to invoke the...
5
by: skumar434 | last post by:
Hi everybody, I am faceing problem with strings. The code is given bellow .In this program i am tring to copy data from a file into structure . I am able to copy the data ,but the dat is...
2
by: feltra | last post by:
Hi, The following is from my friend, who has some technical problem at present in accessing the web... I am writing for him... Kindly request your inputs ASAP, as he has some kind of deadline...
5
by: justbovo | last post by:
Hello, My name is Justin. I am working on a part of a Find Memory module for a program. Here's how it works.. I enter '13' at the main menu which branches out to my Find Memory module. I ask...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
1
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. header("Location:".$urlback); Is this the right layout the...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it so the python app could use a http request to get...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and credentials and received a successful connection...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
1
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.