Compiling with debug info
Hi!
I get a question about PL/SQl, How can I compile a Block PL/SQL with debug information, in SQL*Plus?
Thanks in Advance
- Pablo
From the symptoms you describe, it is possible that the shared library contains a bug, but it is more likely that the problem is in your code, passing bad data to the shared library.
The problem might be a compiler bug, but I think an error in your code is more likely.
For example, your code as written might have undefined behavior that works by accident when compiling without optimizing, but fails when the compiler improves the runtime code.
Some examples:
1. A classic MT programming error is failing to declare a variable volatile when it is shared by more than one thread. In each thread, the compiler assumes it can remember the value of the variable and not reload it between references.
2. "x = ++x + b;" Modifying a variable twice in an expression withtout sequence points has undefined behavior -- compiler optimization can affect the result.
3." foo(x, x+=3);" the order of evaluation of function arguments is unspecified, so the actual values passed to foo could depend on optimization.
With C++ 5.5, you get some warnings from system headers that you can't do anything about, which I suspect is why you have disabled some warnings. Unfortunately, you might be disabling warnings that you need to see. That is, some of the disabled warnings could point to invalid code that results in the program crash.
I suggest using w instead of w2 (to avoid uninteresting warnings), and fix your code to eliminate the warnings you get.
In the current compiler, C++ 5.7 in Sun Studio 10, we have made some adjustments to warnings to make w and w2 more useful. You should consider upgrading.You can get a 60-day free trial version here:
http://www.sun.com/software/products/studio/index.xml
Also get the current patches for it here:
http://developers.sun.com/prodtech/cc/downloads/patches/index.html
Similar Messages
-
Packages compiled with debug info
Hi,
How do we check if a package has been compiled with DEBUG information or not?
The package could have been compiled like this:
ALTER PACKAGE pk1 COMPILE DEBUG
Is there any table that I can check?
Thanks in advance.
Sanal KrishnanIs this a 10g feature?It seems only user_plsql_object_settings is new in 10g.
all_plsql_object_settings is available in 9i:
michaels> select * from dict where table_name like '%PLSQL%'
TABLE_NAME COMMENTS
ALL_PLSQL_OBJECT_SETTINGS Compiler settings of stored objects acce
ssible to the user
1 row selected.
michaels> select name, type,plsql_debug from sys.all_plsql_object_settings where owner = 'SYSTEM'
NAME TYPE P
DEF$_PROPAGATOR_TRIG TRIGGER
REPCATLOGTRIG TRIGGER
michaels> select * from v$version
BANNER
Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64bit Production
PL/SQL Release 9.2.0.8.0 - Production
CORE 9.2.0.8.0 Production
TNS for HPUX: Version 9.2.0.8.0 - Production
NLSRTL Version 9.2.0.8.0 - Production -
Looking for JDK binary compiled with debug info
For some reason JTree.startEditingAtPath() is not doing what I expect, and I'd like to step through the JDK code to see what's going on. Back with Java 5 there were debug builds of the JDK that would let me do this. I've been searching, but cannot find the equivalent for Java 6. Are there still debug binaries out there I can grab (and not have to compile the JDK myself)?
JDK is open source. Just get the source and step through it in your debugger.
-
In general, is it proper to release an official distribution with debug info, i.e., compile with -g option? is there a standard on this?
Thank you
J.L.From my point of view from having worked in a department where we often got 3rd party code...
This is a customer service issue. If you leave the debug info in, then it will be easier for us (the customer) to understand what's going on when something breaks, and it will be easier for you to fix it.
You shouldn't remove the debug info unless you're 100% confident that the code is flawless (and you should never be so confident).
Similarly, you shouldn't obfuscate code unless the documentation is 100% complete. Some vendors are paranoid about their code being stolen, but most people decompile as an aid to understanding what they've purchased, not to steal it. Obfuscation reduces the usability of the product, and creates a hostile vendor/customer relationship.
Well, I've digressed a bit. The point is that unless there's a very strong reason otherwise, the customer service aspect trumps it and you should leave the debug info in. -
How to determine if class was compiled with debugging information?
How may I determine if class was compiled with debugging information? Aside from actually executing the class in a debugger.
As known, when compiling "javac -g ..." the class
files contain debugging information.
my Naive question is WHAT is this information?
could you please add any links to articles about this
debugging information?http://java.sun.com/docs/books/vmspec/2nd-edition/html/ClassFile.doc.html#22856
http://java.sun.com/docs/books/vmspec/2nd-edition/html/ClassFile.doc.html#5956 -
Copied objects are compiled with debug True
I had an issue with copied packages/triggers/procedures that when they were copied showed up as compiled with debug status.
My sql developer client has a default setting of compilng PL/SQL code with optimization level = 0 , while our database has a default = 2.
When modifying this level and setting it to 0, the debug flag is turned on, although not specified in the sql developer client)
preferences -> database -> PL/SQL -> Optimization Level = 2
select * from v$parameter where name like 'plsql%' returns
888 plsql_debug 1 FALSE FALSE
889 plsql_optimize_level 3 2 2 after setting the level to 0 the same query returns:
888 plsql_debug 1 TRUE TRUE
889 plsql_optimize_level 3 0 0this compile with debug behavior is shown on oracle 10 and 11 databases.I also have sqldeveloper version 3.2.20.09 and look up the value for optimizer in the preferences menu via preferences -> database -> PL/SQL (just as in my first message)
BTW I can still reproduce this issue (and 15 other dbas and developers at where I work) on both oracle 10 and 11.
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
PL/SQL Release 10.2.0.4.0 - Production
"CORE 10.2.0.4.0 Production"
TNS for Linux: Version 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - Production
and
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
PL/SQL Release 11.2.0.2.0 - Production
"CORE 11.2.0.2.0 Production"
TNS for Linux: Version 11.2.0.2.0 - Production
NLSRTL Version 11.2.0.2.0 - Production
BTW We've been using sqldeveloper here since version 2.x. We found a workaround by setting the value for Optimization Level to 2, although you might not reproduce the issue, I suggest to keep it for others, although it seems not many others experience this issue. -
How to give user Compiling with debug option, i have try to by giving grant debug any procedure and debug connect session but it failed.
Any ideas?
Edited by: rootsman on Jul 15, 2010 12:00 AMPost the error screenshot..
eg:
grant DEBUG CONNECT SESSION to username;
grant DEBUG ANY PROCEDURE to username;
Check the below explanation:
DEBUGGING:
DEBUG CONNECT SESSION
Connect the current session to a debugger that uses the Java Debug Wire Protocol (JDWP).
DEBUG ANY PROCEDURE
Debug all PL/SQL and Java code in any database object; displayinformation on all SQL statements executed by the application
Note: Granting this privilege is equivalent to granting the DEBUG object privilege on all applicable objects in the database. -
How to find out which PL/SQL Proc is Compiled with Debug?
Hi,
is there any View where i can see, which PL/SQL Proc is compiled with the debug flag?
Thanks
Marco
Message was edited by:
mpatzwahAlternatively:
select name, plsql_debug from sys.all_plsql_object_settings -
Can't find library when compiled with debugging
Hi all,
Compiling this code segment cannot find a library when using -g
bash-3.2$ cat tester.cc
#include <iostream>
#include <string>
using namespace std ;
static void
myRoutine()
string str= "this is in routine" ;
string str3 ;
str3 = str.substr(11,7) ;
if(str.substr(0,4) == "this") cout << "Have a hit" << endl ;
cout << "this is str3 - " << str3 << endl ;
int main(int argc, char **argv)
string str = "this is a test" ;
string str1, str2 ;
str1 = str.substr(0,4) ;
str2 = str.substr(10,4) ;
cout << "this is str1 - " << str1 << endl ;
cout << "this is str2 - " << str2 << endl ;
myRoutine() ;
return 0 ;
bash-3.2$ CC -g -o tester tester.cc
bash-3.2$ ldd tester
libCstd.so.1 => /usr/lib/libCstd.so.1
libCstd.so.1 (SUNW_1.4.2) => (version not found)
libCrun.so.1 => /usr/lib/libCrun.so.1
libm.so.2 => /usr/lib/libm.so.2
libc.so.1 => /usr/lib/libc.so.1
If I comment out:
if(str.substr(0,4) == "this") cout << "Have a hit" << endl ;
bash-3.2$ cat tester.cc
#include <iostream>
#include <string>
using namespace std ;
static void
myRoutine()
string str= "this is in routine" ;
string str3 ;
str3 = str.substr(11,7) ;
// if(str.substr(0,4) == "this") cout << "Have a hit" << endl ;
cout << "this is str3 - " << str3 << endl ;
int main(int argc, char **argv)
string str = "this is a test" ;
string str1, str2 ;
str1 = str.substr(0,4) ;
str2 = str.substr(10,4) ;
cout << "this is str1 - " << str1 << endl ;
cout << "this is str2 - " << str2 << endl ;
myRoutine() ;
return 0 ;
bash-3.2$ CC -g -o tester tester.cc
bash-3.2$ ldd tester
libCstd.so.1 => /usr/lib/libCstd.so.1
libCrun.so.1 => /usr/lib/libCrun.so.1
libm.so.2 => /usr/lib/libm.so.2
libc.so.1 => /usr/lib/libc.so.1
Or if I remove -g:
bash-3.2$ cat tester.cc
#include <iostream>
#include <string>
using namespace std ;
static void
myRoutine()
string str= "this is in routine" ;
string str3 ;
str3 = str.substr(11,7) ;
if(str.substr(0,4) == "this") cout << "Have a hit" << endl ;
cout << "this is str3 - " << str3 << endl ;
int main(int argc, char **argv)
string str = "this is a test" ;
string str1, str2 ;
str1 = str.substr(0,4) ;
str2 = str.substr(10,4) ;
cout << "this is str1 - " << str1 << endl ;
cout << "this is str2 - " << str2 << endl ;
myRoutine() ;
return 0 ;
bash-3.2$ CC -o tester tester.cc
bash-3.2$ ldd tester
libCstd.so.1 => /usr/lib/libCstd.so.1
libCrun.so.1 => /usr/lib/libCrun.so.1
libm.so.2 => /usr/lib/libm.so.2
libc.so.1 => /usr/lib/libc.so.1
then I can run successfully
Any thoughts or hints?
bash-3.2$ CC -V
CC: Sun Ceres C++ 5.10 SunOS_i386 2008/07/10
Usage: CC [ options ] files. Use 'CC -flags' for details
bash-3.2$ uname -a
SunOS alpha 5.11 snv_86 i86pc i386 i86pc
Thanks,
JimAck! Please ignore my earlier posting. I did not play close enough attention to details in your post. I apologize for the confusion. Let me start over:
The Studio Express release you have contains a newer version of the C++ runtime library libCstd.so.1 than is available yet in Solaris patches. We bump the internal version number when we add new interfaces. The internal version number of the Studio Express library is SUNW_1.3.2. The version of the latest release Solaris patch is SUNW_1.3.1.
Some new string class operator functions are in version SUNW_1.3.2. I think these are also defined as inline functions in the compiler headers. When you compile with -g, inlining is disabled, and you create a dependency on library version SUNW_1.3.2. (Compiling with -g0 allows function inlining, and might resolve your problem, but read on.)
We have not released a libCstd.so.1 with internal version SUNW_1.4.2, so I don't understand how that version number could appear in an error message. Did you really see that version, or is it a transcription error? For now, let's assume it is a transcription error.
When you compile and link with CC, the program gets a runpath pointing into the compiler installation area. At program run time, the loader looks for libraries in directories listed in the runpath, with /lib and /usr/lib as last resort. The "ldd" command reports what the runtime loader will do regarding dependent libraries.
If the compiler is installed in /opt, a 32-bit program gets a runpath that includes /opt/SUNWspro/lib. In that directory in Sun Studio Express is a symbolic link that points to ../prod/usr/lib/libCstd.so.1, the library with version SUNW_1.3.2.
If you try this:
% /opt/SUNWspro/bin/CC hello.cc
% ldd a.out
you should see, among other things,
libCrun.so.1 => /opt/SUNWspro/lib/libCstd.so.1
(Depending on the OS version, you might see
libCrun.so.1 => /opt/SUNWspro/prod/usr/lib/libCstd.so.1 instead.)
But if ldd can't resolve the library, you probably have a corrupted Sun Studio Express installation. In that case, uninstall it, and reinstall from a fresh download.
If you run the program on a different computer where Sun Studio Express is not installed, the loader won't be able to find the right library version, and you will get "not found" results. I addressed this issue in another thread:
http://forums.sun.com/thread.jspa?threadID=5340163 -
Problem with debug info...
Hi
CC -V
CC: Sun C++ 5.9 Linux_i386 Build27_2 2006/08/02
CC -g -c test.cpp
>> Assertion: DBGGEN ERROR: FILE="../src/dbg_dwarf2.c", LINE=%7605, DW_DLE_DEBUGINFO_ERROR [DBG_GEN 5.1.18] (../lnk/dbg_dbggen.cc, line 4336)
while processing test.cpp at line 0.I can not paste test.cpp here though, it's quite huge since I created it with CC -E, but anyway, perhaps someone at sun is interested ?
/LarsThis looks like bugid 6456470. It's fixed in our development
branch, but the fix won't be available until Express 3 which
isn't for a month or two. The problem is related to the way
symbols and types reference other symbols and types. You
can work around it by not using -g for those source files where
it happens. Not a very good workaround, I know. Of course,
that's why we have express releases. To find problems like
this as early as possible. ;-)
--chris -
Compiling with debug and runtime performance degradation
Just a quick question: Does including debug information in class files degrade runtime performance in any way?
Thanks!Quick answer: it depends on what your application does.
Mostly, it shouldn't matter but you should always profile and time your
application to find the truth. -
Debug info unavailable for web services
I've run into an interesting problem. I'm trying to remote debug a web service
I've deployed on wls 7. I can connect to the server, place breakpoints, and step
through the code, but there isn't any information available (objects, stack, etc).
It just says debug info unavailable. Thing is, there is another application deployed
in which I can see all the debug info. Yes, they're both compiled with debug info
turned on.
I originally thought that a difference in deployment might be an issue, since
one is deployed as a directory, and the other as an ear file, but deploying them
both as a directory didn't seem to help. Does anyone have any idea?
My debugger is the one included in intellij idea...
--petemrbean wrote:
I've posted some questions about this already, but this one comes at it from a different angle. I need to establish a secure link between a client and server using SSL (TLS actually). I have to develop the client side, and another company has already created the server side. Although I have a million questions about the client side, my question concerns the server side.
Can I (using the instructions found in the whitepaper entitled, Setting up SSL of Web Services in LabVIEW 2009) setup a LabVIEW server on the same PC so that I can test my client. I just want to debug my handshaking code, and verify that I can setup a secure link. I'm not sure how I'll know just yet, but I'm wondering (until I get the 3rd party server) if I can do it all locally to accelarate testing.
One can only guess what could go wrong when MrBean does LabVIEW! (The TV Character, not the user, of course.)
Bill
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all. -
Cannot compile code with debug symbols
I have a source code file that will not compile with debug symbols. I get an assertion failed in file ../src/regman/regman_local.cc at line 5224. The compile command and output are below.
/opt/SUNWspro/bin/cc -g -xarch=v9b -xopenmp=noopt -xc99=all -c -o output/spirecon.o spirecon.c
cg: assertion failed in file ../src/regman/regman_local.cc at line 5224
cg: Out of range
cg: 1 errors
cc: cg failed for spirecon.c
However without the debug options and using the default -fast switch, i.e.
/opt/SUNWspro/bin/cc -fast -xarch=v9b -xopenmp=noopt -xc99=all -c -o output/spirecon.o spirecon.c
it compiles without any problems.
I was hoping someone might have a suggestion as to how what might cause this type of error.I have been told this is bugid: 4420630
It only happens when you try to use the optimizing
backend code generator without any optimization.
(That's what -xopenmp=noopt does)
If you add an -xO1 flag the assertion should go away, but you
will also lose some (but not all) of your debuggability.
--chris -
[solved]How to compile a software with debug symbol from aur?
How does auch developers compile their project? Seems that archlinux user always trying to avoid build software from git/svn directly. But after searching a lot I sill haven't found how to compile with debug symbol while using PKGBUILD.
Anyone help?
Last edited by ranjiao (2009-08-27 14:28:09)ranjiao wrote:PKGBUILD calls autogen.sh before calling make, and gnome-autogen.sh is called in autogen.sh
I have tried to add --enable-debug while calling autogen.sh and gnome-autogen.sh, but it doesn't work.
Isn't PKGBUILD just a script? It calls what you make it calls by adding commands... -
Using GDB to debug a code compiled with Sun cc
When using gdb to debug C code compiled with Sun's cc, the step-into doesn't work, i can only "step into" a function if i put a breakpoint on it. Also, sometimes if i set a breakpoint on a function name, like "break foo", gdb indeed breaks when foo is reached, but without showing the source code (this i could not reproduce with a small demo program).
I am using Sun Studio 12 on a SunOS 5.10 sun4u sparc machine.
My demo program is:
#include <stdio.h>
#include <strings.h>
void func1(str)
char str;
printf("This is the first line\n");
printf("STR: %s\n",str);
int main()
char str[10];
strcpy(str,"lalalal");
printf("Calling func1\n");
func1(str);
printf("Returned from func1\n");
The compilation command i run is:
cc -c -g step_into.c -o step_into.o
cc -g -o step_into step_into.o
When running the program with gdb, the "step" command does not step into func1, but runs it like "next".
I know there's the dbx debugger, but if there's a way to fix this with gdb - it is much preferable for us. Switching to dbx is not really feasible for us.
Regards,
YaelHello Yael,
I tried your example on my laptop (OpenSolaris x86/x64) with Sun Studio 12 update 1
and GDB 6.3.50 - it works properly:
$ gdb dist/Debug/SunStudio-Solaris-x86/forum_c_20091230
GNU gdb 6.3.50_2004-11-23-cvs
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-pc-solaris2.11"...
(gdb) break main
Breakpoint 1 at 0x8050a87: file src/args.c, line 15.
(gdb) run
Starting program: /export/home/nikm/SunStudioProjects/Forum_C_20091230/dist/Debug/SunStudio-Solaris-x86/forum_c_20091230
Breakpoint 1, main () at src/args.c:15
15 printf("Calling func1\n");
Current language: auto; currently minimal
(gdb) next
Calling func1
16 func1(str);
(gdb) step
This is the first line
func1 (str=0x80477ba "lalalal") at src/args.c:7
7 printf("STR: %s\n",str);
(gdb) Could you please download and try Sun Studio 12 update 1?
It is available for free. Here is the web page:
http://developers.sun.com/sunstudio/
BTW, which GDB version do you use?
I'll try it on a sparc system and let you know.
Thanks.
Nik
P.S.: there is a typo in the source code:
void func1(str)
*char *str;I think it should be:
void func1(char *str)Probably a copy-paste problem.
Please use "CODE" mode when you copy-paste source lines (selected text, press 'CODE' button).
Maybe you are looking for
-
Ssl_error_rx_record_too_long with email
I am receiving Error code: ssl_error_rx_record_too_long on Firefox when trying to access rcn webmail using Verizon Wireless 4G LTE USB Modem 551L.. Any suggestions
-
JDBC runtime error using data source (Oracle 9i server & Oracle 8i client)
Hi, Wud someone help me with this? Why am I getting this run-time error? D:\shilpa\javaprogs>java -classpath %classpath%;.; CreateMovieTables javax.naming.NoInitialContextException: Need to specify class name in environmen t or system property, or as
-
Dear Guru's Please find my query mentioned below....... QUERY: We are using Taxinn as a procedure Scenario: Same vendor same material same plant I want to create 2 Seperate PO 1) With Zero Excise duty 2) With 16 % Excise Duty How to Solve this Quer
-
How to get sql query data and write into csv file?
I am writing to seek help, in how can I create bat. script which can execute the following logic: connection to the database run sql query create CSV file output query data, into CSV file save the CSV file osql -S 84.18.111.111 -U adw -P rem -i "c:\q
-
Why configuring clock using clock set command is not accepted in nexus 7k?
Hello, I have a message like this: Admin-CORE1_VDC# clock set 15:26:00 7 december 2014 Setting clock from CLI is not allowed in this VDC. Use the following config command to use the "clock set" command. clock protocol none vdc <vdc_id> If I issue tha