473,569 Members | 2,870 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Debugger not reaching the first line of code

hi,
I was asked this peculiar question in an interview - There's a one line
C code ( the simplest you can assume , a printf statement inside the
main) and a breakpoint has been set at that very first line. The code
compiles and runs but the debugger never reaches that breakpoint. What
could be the possible reason/bug/issue behind this. Does anyone have
any clue to this.
Thanks,
Shishir

Apr 5 '06 #1
16 1741
On 2006-04-05, shishir <sh************ ****@gmail.com> wrote:
hi,
I was asked this peculiar question in an interview - There's a one line
C code ( the simplest you can assume , a printf statement inside the
main) and a breakpoint has been set at that very first line. The code
compiles and runs but the debugger never reaches that breakpoint. What
could be the possible reason/bug/issue behind this. Does anyone have
any clue to this.
Thanks,


An undefined global initializer, maybe?
Apr 5 '06 #2
shishir wrote:
hi,
I was asked this peculiar question in an interview - There's a one line
C code ( the simplest you can assume , a printf statement inside the
main) and a breakpoint has been set at that very first line. The code
compiles and runs but the debugger never reaches that breakpoint. What
could be the possible reason/bug/issue behind this. Does anyone have
any clue to this.

Could be a user bug.
Provide more info directed in the proper channel for your particular
platform/compiler/debugger for more answers.
Apr 5 '06 #3
"shishir" <sh************ ****@gmail.com> wrote:
I was asked this peculiar question in an interview - There's a one line
C code ( the simplest you can assume , a printf statement inside the
main) and a breakpoint has been set at that very first line. The code
compiles and runs but the debugger never reaches that breakpoint. What
could be the possible reason/bug/issue behind this. Does anyone have
any clue to this.


Clearly the interviewer had read the FAQ, and you haven't.

HTH; HAND.

Richard
Apr 5 '06 #4
Where can I find the FAQ?
Thanks!
"Richard Bos" <rl*@hoekstra-uitgeverij.nl> дÈëÏûÏ¢ÐÂÎÅ
:44************ ****@news.xs4al l.nl...
"shishir" <sh************ ****@gmail.com> wrote:
I was asked this peculiar question in an interview - There's a one line
C code ( the simplest you can assume , a printf statement inside the
main) and a breakpoint has been set at that very first line. The code
compiles and runs but the debugger never reaches that breakpoint. What
could be the possible reason/bug/issue behind this. Does anyone have
any clue to this.


Clearly the interviewer had read the FAQ, and you haven't.

HTH; HAND.

Richard

Apr 5 '06 #5
"Chang Feng" <cy****@metarne t.com> writes:
Where can I find the FAQ?
Thanks!


A Google search for "comp.lang. c FAQ" or "C FAQ" would have found
<http://www.c-faq.com/>.

Please also read <http://www.caliburn.nl/topposting.html > and
<http://clc-wiki.net/wiki/Introduction_to _comp.lang.c>.

--
Keith Thompson (The_Other_Keit h) 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.
Apr 5 '06 #6
On 2006-04-05, Richard Bos <rl*@hoekstra-uitgeverij.nl> wrote:
"shishir" <sh************ ****@gmail.com> wrote:
I was asked this peculiar question in an interview - There's a one line
C code ( the simplest you can assume , a printf statement inside the
main) and a breakpoint has been set at that very first line. The code
compiles and runs but the debugger never reaches that breakpoint. What
could be the possible reason/bug/issue behind this. Does anyone have
any clue to this.


Clearly the interviewer had read the FAQ, and you haven't.

HTH; HAND.

Richard


Great "advice". And would be much more helpful had you provided a link or an
excerpt from the FAQ to help. Or was your only reason to reply to
belittle the OP who may, or may not, have been aware of the FAQ?

To the OP : dig around here if you have web access - http://c-faq.com/

In addition, what is HTH and HAND? I thought acronyms were frowned
upon here?

--
Aspirat primo Fortuna labori.
-- Virgil, and all good teachers
Apr 9 '06 #7
Richard G. Riley wrote:
To the OP
ITYM Original Poster
I thought acronyms were frowned upon here?


It looks like you didn't.

--
pete
Apr 9 '06 #8
On 2006-04-09, pete <pf*****@mindsp ring.com> wrote:
Richard G. Riley wrote:
To the OP


ITYM Original Poster
I thought acronyms were frowned upon here?


It looks like you didn't.


Fair point ... ( I didnt know an acronym for that...).
Apr 9 '06 #9
On Sun, 9 Apr 2006 14:48:11 +0200, in comp.lang.c , "Richard G. Riley"
<rg****@gmail.c om> wrote:
On 2006-04-05, Richard Bos <rl*@hoekstra-uitgeverij.nl> wrote:
"shishir" <sh************ ****@gmail.com> wrote:

Clearly the interviewer had read the FAQ, and you haven't.

Great "advice". And would be much more helpful had you provided a link or an
excerpt from the FAQ to help.


About every fourth post here, not to mention the regular 'welcome'
message, mentions it. And frankly anyone who can't use google is
probably not going to make a programmer anyway.
In addition, what is HTH and HAND? I thought acronyms were frowned
upon here?


What on earth gave you that idea?
Mark McIntyre
--
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
Apr 9 '06 #10

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

Similar topics

6
11106
by: jonathan | last post by:
everyone, I'd like to be able to debug php scripts on the command line, going through the browser. In other words, set up the debugger to listen and then type in a url and have the code stop before displaying stuff to the browser. Then, step through each individual piece of code, etc, whilst having the output mirrored to either another...
4
1565
by: wenjie wang | last post by:
Greetings, I'd like to know is there any situation where your program could crash without reaching the breakpoint which you set at the beginning of main().
13
2920
by: python | last post by:
hello and thanks for reading this, i have been a dos/windows user using some form of the basic language for 30 years now. i own and run a small programming company and there is one feature that keeps me in the windows/basic world. while i will agree that it has not evolved well, it does have one awesome feature that i have yet to see...
2
2993
by: Ioannis Hadjichambis | last post by:
I am trying to debug my program using the DDD debugger. I have also downloaded a manual for the debugger but I cannot RUN my program in the debugger. I use the -g flag when compiling. I then write to the command line > ddd table2 Then the debugger pops up and i press Programs->Run where it asks for arguments and because my program doesn't...
7
1635
by: Piet Van Vlierberghe | last post by:
We are a software firm developing in C++ and we recently made the step from Microsoft Visual Studio 6 to Microsoft Visual Studio .NET 2003. We are really excited about the quality of the compiler; however there seem to be some issues with the debugger or the combination of our code with the debugger that makes debugging very slow and...
6
4579
by: bob lambert | last post by:
Help, I have vb.net std 2002, have a windows forms app and am debugging code behind it. I think I am viewing the source, I set the project to debug (as opposed to release), I start the debugger, it stops at a breakpoint. But as I step through, it stops on what appear to be comment lines. It seems I am not looking at the code line for...
18
2951
by: R. Bernstein | last post by:
Okay, a bit of an exaggeration. Recently, I've been using Python more seriously, and in using the debugger I think one of the first things I noticed was that there is no "restart" ("R" in perldb) or "run" (gdb) command. I was pleasantly pleased discover how easy though it was patch pdb.py and pdb.doc; my patch for this is here:...
2
21962
by: Ilkka | last post by:
I have created an C++ application with Windows Forms, ADO and SQL server 2005. Now I need to change something and started debugging the code. Then suddenly I receive an error. "An unhandled exception of type 'System.AccessViolationException' occurred in mscorlib.dll Additional information: Attempted to read or write protected memory. This...
0
1502
xarzu
by: xarzu | last post by:
Getting a C# program with a manifest file to run in the debugger ---------------------------------------------------------------- How do I declare a manifest file in the Visual Studio IDE for C# so that I can debug the resulting code? I have been able to add the manifest file, to the exe after I have built the program. But then, when I try...
0
7703
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7618
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7926
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7983
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6287
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3657
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2117
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1228
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
946
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.