Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.programming > #2251 > unrolled thread

high-level NOP

Started bybob <bob@coolfone.comze.com>
First post2012-09-26 14:12 -0700
Last post2012-09-26 19:45 -0500
Articles 7 — 4 participants

Back to article view | Back to comp.programming


Contents

  high-level NOP bob <bob@coolfone.comze.com> - 2012-09-26 14:12 -0700
    Re: high-level NOP Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-09-26 14:21 -0700
      Re: high-level NOP Robert Wessel <robertwessel2@yahoo.com> - 2012-09-26 17:26 -0500
        Re: high-level NOP bob <bob@coolfone.comze.com> - 2012-09-27 10:58 -0700
      Re: high-level NOP bob <bob@coolfone.comze.com> - 2012-09-27 10:54 -0700
        Re: high-level NOP Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-09-27 13:52 -0700
    Re: high-level NOP BGB <cr88192@hotmail.com> - 2012-09-26 19:45 -0500

#2251 — high-level NOP

Frombob <bob@coolfone.comze.com>
Date2012-09-26 14:12 -0700
Subjecthigh-level NOP
Message-ID<7e1021e0-d4ad-4ad1-8d59-b6c50644a891@googlegroups.com>
Am I the only one who adds a lot of "NOP" statements to my code just so I can put a breakpoint there?

For instance, in Java I might add:

System.out.println("whatever");

just so I can put a breakpoint there.

Does anyone else do this?

Should there be a high-level NOP that is easy to type?

[toc] | [next] | [standalone]


#2252

FromDaniel Pitts <newsgroup.nospam@virtualinfinity.net>
Date2012-09-26 14:21 -0700
Message-ID<1lK8s.4$4k1.0@newsfe18.iad>
In reply to#2251
On 9/26/12 2:12 PM, bob wrote:
> Am I the only one who adds a lot of "NOP" statements to my code just so I can put a breakpoint there?
>
> For instance, in Java I might add:
>
> System.out.println("whatever");
>
> just so I can put a breakpoint there.
>
> Does anyone else do this?
>
> Should there be a high-level NOP that is easy to type?
>
Why not put a break-point on the statement directly after that? That 
requires no typing what-so-ever.

[toc] | [prev] | [next] | [standalone]


#2253

FromRobert Wessel <robertwessel2@yahoo.com>
Date2012-09-26 17:26 -0500
Message-ID<inv668ll4ntknmdurmi8g55atrj0m077qj@4ax.com>
In reply to#2252
On Wed, 26 Sep 2012 14:21:01 -0700, Daniel Pitts
<newsgroup.nospam@virtualinfinity.net> wrote:

>On 9/26/12 2:12 PM, bob wrote:
>> Am I the only one who adds a lot of "NOP" statements to my code just so I can put a breakpoint there?
>>
>> For instance, in Java I might add:
>>
>> System.out.println("whatever");
>>
>> just so I can put a breakpoint there.
>>
>> Does anyone else do this?
>>
>> Should there be a high-level NOP that is easy to type?
>>
>Why not put a break-point on the statement directly after that? That 
>requires no typing what-so-ever.


That may not be convenient - consider that if the following statement
begins a loop, your breakpoint will likely hit for every loop
iteration.

But to the OP, yes, on occasion I have, but it's rare enough that any
difficulty in typing it is irrelevant.  But you really want something
with few or no side effects, but that won't get optimized away or use
a lot of resources.  In Windows I've used a call to the (system)
GetTickCount() and ignored the results.

[toc] | [prev] | [next] | [standalone]


#2256

Frombob <bob@coolfone.comze.com>
Date2012-09-27 10:58 -0700
Message-ID<65f0842c-0cbb-467d-a1d0-06b0005515ab@googlegroups.com>
In reply to#2253
On Wednesday, September 26, 2012 5:26:33 PM UTC-5, robert...@yahoo.com wrote:
> On Wed, 26 Sep 2012 14:21:01 -0700, Daniel Pitts
> 
> <newsgroup.nospam@virtualinfinity.net> wrote:
> 
> 
> 
> >On 9/26/12 2:12 PM, bob wrote:
> 
> >> Am I the only one who adds a lot of "NOP" statements to my code just so I can put a breakpoint there?
> 
> >>
> 
> >> For instance, in Java I might add:
> 
> >>
> 
> >> System.out.println("whatever");
> 
> >>
> 
> >> just so I can put a breakpoint there.
> 
> >>
> 
> >> Does anyone else do this?
> 
> >>
> 
> >> Should there be a high-level NOP that is easy to type?
> 
> >>
> 
> >Why not put a break-point on the statement directly after that? That 
> 
> >requires no typing what-so-ever.
> 
> 
> 
> 
> 
> That may not be convenient - consider that if the following statement
> 
> begins a loop, your breakpoint will likely hit for every loop
> 
> iteration.
> 
> 
> 
> But to the OP, yes, on occasion I have, but it's rare enough that any
> 
> difficulty in typing it is irrelevant.  But you really want something
> 
> with few or no side effects, but that won't get optimized away or use
> 
> a lot of resources.  In Windows I've used a call to the (system)
> 
> GetTickCount() and ignored the results.

In Windows C++, you could probably do something like

#define N GetTickCount();

Then you just do a NOP like this:

N


Java probably doesn't have anything that succinct.

[toc] | [prev] | [next] | [standalone]


#2255

Frombob <bob@coolfone.comze.com>
Date2012-09-27 10:54 -0700
Message-ID<5047cb47-be16-48e3-b06a-3f6c2940e76c@googlegroups.com>
In reply to#2252
On Wednesday, September 26, 2012 4:21:02 PM UTC-5, Daniel Pitts wrote:
> On 9/26/12 2:12 PM, bob wrote:
> 
> > Am I the only one who adds a lot of "NOP" statements to my code just so I can put a breakpoint there?
> 
> >
> 
> > For instance, in Java I might add:
> 
> >
> 
> > System.out.println("whatever");
> 
> >
> 
> > just so I can put a breakpoint there.
> 
> >
> 
> > Does anyone else do this?
> 
> >
> 
> > Should there be a high-level NOP that is easy to type?
> 
> >
> 
> Why not put a break-point on the statement directly after that? That 
> 
> requires no typing what-so-ever.

It seems like a lot of times the variables I'm interested in are out of scope on the next line.

[toc] | [prev] | [next] | [standalone]


#2257

FromDaniel Pitts <newsgroup.nospam@virtualinfinity.net>
Date2012-09-27 13:52 -0700
Message-ID<y039s.640$KS6.480@newsfe15.iad>
In reply to#2255
On 9/27/12 10:54 AM, bob wrote:
> On Wednesday, September 26, 2012 4:21:02 PM UTC-5, Daniel Pitts wrote:
>> On 9/26/12 2:12 PM, bob wrote:
>>
>>> Am I the only one who adds a lot of "NOP" statements to my code just so I can put a breakpoint there?
>>
>>>
>>
>>> For instance, in Java I might add:
>>
>>>
>>
>>> System.out.println("whatever");
>>
>>>
>>
>>> just so I can put a breakpoint there.
>>
>>>
>>
>>> Does anyone else do this?
>>
>>>
>>
>>> Should there be a high-level NOP that is easy to type?
>>
>>>
>>
>> Why not put a break-point on the statement directly after that? That
>>
>> requires no typing what-so-ever.
>
> It seems like a lot of times the variables I'm interested in are out of scope on the next line.
>

Then put the break-point on the point immediately before?

[toc] | [prev] | [next] | [standalone]


#2254

FromBGB <cr88192@hotmail.com>
Date2012-09-26 19:45 -0500
Message-ID<k407oc$5nu$1@news.albasani.net>
In reply to#2251
On 9/26/2012 4:12 PM, bob wrote:
> Am I the only one who adds a lot of "NOP" statements to my code just so I can put a breakpoint there?
>
> For instance, in Java I might add:
>
> System.out.println("whatever");
>
> just so I can put a breakpoint there.
>
> Does anyone else do this?
>
> Should there be a high-level NOP that is easy to type?
>

public static void nop()
	{ /* does nothing */ }

...

SomeClass.nop();

?...


maybe as a class:
public class NOP extends Object {
public static void nop()
	{ /* does nothing */ }
}

NOP.nop();

?...

[toc] | [prev] | [standalone]


Back to top | Article view | comp.programming


csiph-web