moderated >> Auto debug

by mpersico » Fri, 18 Mar 2005 22:36:31 GMT

When I install perl scripts that are basic utilities, I drop the .pl
suffix, set the she-bang line to #!/usr/bin/env perl, chmod +x and
install into the appropriate local bin.

If I need to debug same, I invoke perl -d:ptkdb $(which mytuil) ....

Inthe name of Laziness, I was wondering if there was any way to rig the
script so that

myutil -d:ptkdb ...

would DWIM, start up in the debugger.

Any suggestions?

moderated >> Auto debug

by Jeff Schwab » Sun, 20 Mar 2005 04:17:54 GMT



#!/usr/bin/perl

use warnings;
use strict;

if( $_ = shift ) {
if( /^-d/ ) {
my $command = "perl -d $0 @ARGV";
exec $command or print STDERR
"warning: couldn't exec $command: $!\n";
}
else {
unshift @ARGV, $_;
}
}

# Main program starts here...

print "$_\n" for @ARGV;

moderated >> Auto debug

by Brian McCauley » Sun, 20 Mar 2005 15:39:41 GMT


I don't think you can start up debug mode once the perl interpreter is
running so you'd basically need to have the script restart itself.

Something like:

use strict;
use warnings;

package autodebug;
use FindBin qw( $Bin $Script );

return 1 unless $ARGV[0] && $ARGV[0]=~/^-d/;
my $db_arg = shift @ARGV;
exec $^X, $db_arg, "$Bin/$Script", @ARGV;
die "failed to re-exec self with debug: $!";
__END__

But this is only as good as $^X and FindBin which can both be faked.

moderated >> Auto debug

by Peter Scott » Sun, 20 Mar 2005 22:30:22 GMT


Something like this, perhaps (not tested much):

# Insert near beginning:

BEGIN {
if (my ($debug_arg) = grep /^-d/, @ARGV) {
my @remain = grep !/^-d/, @ARGV;
exec $^X, $debug_arg, $0, @remain;
}
}

--
Peter Scott
http://www.perlmedic.com/
http://www.perldebugged.com/

moderated >> Auto debug

by Jeff Schwab » Sun, 27 Mar 2005 06:46:42 GMT

I'm a field Negro. The masses
are the field Negroes. When they see this man's house on fire, you don't
hear these little Negroes talking about "our government is in trouble."
They say, "The government is in trouble." Imagine a Negro: "Our
government"! I even heard one say "our astronauts." They won't even let
him near the plant -- and "our astronauts"! "Our Navy" -- that's a Negro
that's out of his mind. That's a Negro that's out of his mind.

Just as the slavemaster of that day used Tom, the house Negro, to keep
the field Negroes in check, the same old slavemaster today has Negroes
who are nothing but modern Uncle Toms, 20th century Uncle Toms, to keep
you and me in check, keep us under control, keep us passive and peaceful
and nonviolent. That's Tom making you nonviolent. It's like when you go
to the dentist, and the man's going to take your tooth. You're going to
fight him when he starts pulling. So he squirts some stuff in your jaw
called novocaine, to make you think they're not doing anything to you.
So you sit there and 'cause you've got all of that novocaine in your
jaw, you suffer peacefully. Blood running all down your jaw, and you
don't know what's happening. 'Cause someone has taught you to suffer --
peacefully.

The white man do the same thing to you in the street, when he want [sic]
to put knots on your head and take advantage of you and don't have to be
afraid of your fighting back. To keep you from fighting back, he gets
these old religious Uncle Toms to teach you and me, just like novocaine,
suffer peacefully. Don't stop suffering -- just suffer peacefully. As
Reverend Cleage

moderated >> Auto debug

by Peter Scott » Sun, 27 Mar 2005 06:48:11 GMT

When the house caught on fire, he didn't try and put
it out; that field Negro prayed for a wind, for a breeze. When the
master got sick, the field Negro prayed that he'd die. If someone come
[sic] to the field Negro and said, "Let's separate, let's run," he
didn't say "Where we going?" He'd say, "Any place is better than here."
You've got field Negroes in America today. I'm a field Negro. The masses
are the field Negroes. When they see this man's house on fire, you don't
hear these little Negroes talking about "our government is in trouble."
They say, "The government is in trouble." Imagine a Negro: "Our
government"! I even heard one say "our astronauts." They won't even let
him near the plant -- and "our astronauts"! "Our Navy" -- that's a Negro
that's out of his mind. That's a Negro that's out of his mind.

Just as the slavemaster of that day used Tom, the house Negro, to keep
the field Negroes in check, the same old slavemaster today has Negroes
who are nothing but modern Uncle Toms, 20th century Uncle Toms, to keep
you and me in check, keep us under control, keep us passive

moderated >> Auto debug

by Brian McCauley » Sun, 27 Mar 2005 06:48:38 GMT

islands in the Pacific, when the American soldiers landed, one Japanese
sometimes could hold the whole army off. He'd just wait until the sun
went down, and when the sun went down they were all equal. He would take
his little blade and slip from bush to bush, and from American to
American. The white soldiers couldn't cope with that. Whenever you see a
white soldier that fought in the Pacific, he has the shakes, he has a
nervous condition, because they scared him to death.

The same thing happened to the French up in French Indochina. People who
just a few years previously were rice farmers got together and ran the
heavily-mechanized French army out of Indochina. You don't need it --
modern warfare today won't work. This is the day of the guerrilla. They
did the same thing in Algeria. Algerians, who were nothing but Bedouins,
took a rine and sneaked off to the hills, and de Gaulle and all of his
highfalutin' war machinery couldn't defeat those guerrillas. Nowhere on
this earth does the white man win in a guerrilla warfare. It's not his
speed. Just as guerrilla warfare is prevailing in Asia and in parts of
Africa and in parts of Latin America, you've got to be mighty naive, or
you've got to play the black man cheap, if you don't think some day he's
going to wake up and find that it's got to be the ballot or the bullet.



l would like to say, in closing, a few things concerning the Muslim
Mosque, Inc., which we established recently in New York Cit

moderated >> Auto debug

by mpersico » Sun, 27 Mar 2005 06:49:08 GMT

not even
a government that's based on democracy. lt. is not a government that is
made up of representatives of the people. Half of the people in the
South can't even vote. Eastland is not even supposed to be in
Washington. Half of the senators and congressmen who occupy these key
positions in Washington, D.C., are there illegally, are there
unconstitutionally.



I was in Washington, D.C., a week ago Thursday, when they were debating
whether or not they should let the bill come onto the floor. And in the
back of the room where the Senate meets, there's a huge map of the
United States, and on that map it shows the location of Negroes
throughout the country. And it shows that the Southern section of the
country, the states that are most heavily concentrated with Negroes, are
the ones that have senators and congressmen standing up filibustering
and doing all other kinds of trickery to keep the Negro from being able
to vote. This is pitiful. But it's not pitiful for us any longer; it's
actually pitiful for the white man, because soon now, as the Negro
awakens a little more and sees the vise that he's in, sees the bag that
he's in, sees the real game that he's in, then the Negro's going to
develop a new tactic.

These senators and congressmen actually violate the constitutional
amendments that guarantee the people of that particular state or county
the right to vote. And the Constitution itself has within it the
machinery to expel any representative from a state where the voting
rights of the people are violated. You do

Similar Threads

1. Auto initials & auto date not working properly

2. How to disable auto-underlining Hyperlinks and Auto-Capitalization

Hi, Ken.  In Word 2003, click on Tools | AutoCorrect Options | AutoCorrect tab | uncheck the boxes for "Capitalize first letter of sentences" and "Capitalize first letter of table cells" | Autoformat As You Type tab | uncheck the box for "Internet and network paths with hyperlinks" | OK.
    

"Ken Tucker" wrote:

> Currently all hyperlinks in MSWord2003 documents are automatically underlined and switched to blue color.
> 
> How do I disable this auto-format permanently ?
> 
> From time to time the first character of a word is automatically capitalized. How do I permanently
> disable this "feature"?
> 
> Keep in mind that I ask for MsOffice 2003 and not for former versions.
> 
> Ken
> 
> 

3. google and youtube script ( auto resume auto filename ) - Perl

4. compiling perl/tk with debugging?; help debugging a segfault in Tk_HandleEvent

Hi all,

I have an app that's crashing with a segfault under perl 5.8.7,
perl/tk 800.025. I have a core file from one such crash, but I
didn't have perl/tk compiled with debugging information, so with
my weak C and debugging skills, I'm having a hard time figuring out
exactly what's up. So first off, can anyone tell me how to modify the
standard "perl Makefile.PL; make" so that it will be compiled with
the -g option?

I'd also be grateful for any pointers from people with good debugger
skills as to what I'm doing wrong in my attempts to analyze the
bare-bones core file that I have. Here's what I've done:

$ gdb /usr/bin/perl core
...
(gdb) bt
#0  0xb7c23fcc in Tk_HandleEvent () from /usr/lib/perl5/auto/Tk/Tk.so
#1  0xb7c2471f in TkQueueEventForAllChildren () from 
/usr/lib/perl5/auto/Tk/Tk.so
#2  0xb7c81519 in Tcl_ServiceEvent () from 
/usr/lib/perl5/auto/Tk/Event/Event.so
#3  0xb7c81757 in Tcl_DoOneEvent () from 
/usr/lib/perl5/auto/Tk/Event/Event.so
#4  0xb7bf238d in XS_Tk_DoOneEvent () from /usr/lib/perl5/auto/Tk/Tk.so
#5  0x080c406d in Perl_pp_entersub ()
#6  0x080bce9b in Perl_runops_standard ()
#7  0x08064f8c in perl_run ()
#8  0x0805fde6 in main ()
(gdb) info f
Stack level 0, frame at 0xbfeb5300:
  eip = 0xb7c23fcc in Tk_HandleEvent; saved eip 0xb7c2471f
  called by frame at 0xbfeb5320
  Arglist at 0xbfeb52f8, args:
  Locals at 0xbfeb52f8, Previous frame's sp is 0xbfeb5300
  Saved registers:
   ebx at 0xbfeb52ec, ebp at 0xbfeb52f8, esi at 0xbfeb52f0, edi at 
0xbfeb52f4, eip at 0xbfeb52fc
(gdb) x 0xbfeb52f8
0xbfeb52f8:     0xbfeb5318
(gdb) x 0xbfeb5318
0xbfeb5318:     0xbfeb5338

So evidently the crash happens inside Tk_HandleEvent. The source code
starts out like this:
   void
   Tk_HandleEvent(eventPtr)
       XEvent *eventPtr;           /* Event to dispatch. */
   {
So if I'm understanding gdb correctly, the argument eventPtr
is at 0xbfeb52f8. When I examine eventPtr, I find that it points
to 0xbfeb5318. Now AFAICT the XEvent stucture is defined in Xlib.h
like so:
         typedef struct {
         int type;
         unsigned long serial;
         Bool send_event;
         Display *display;
         Window window;
       } XAnyEvent;
(Actually it's a union, but this is the stuff that every type of event
has in common.) So the very first thing in the structure should be
an integer which is the type of event. But when I examine address
0xbfeb5318, its contents are clearly another pointer, not a small
integer representing an event type. Can anyone tell me if I'm
misunderstanding how stack frames work in gcc or something? (Of
course this would all become easier if I could obtain a core file
that had debugging information in it, but the crashes also aren't
reproducible, so even once I manage to compile perl/tk with
debugging, it may be weeks before I obtain a core file.)

TIA!

5. How to disable auto-underlining Hyperlinks and Auto-Capitalization in Office 2003 ???? - Microsoft Office