conversion to the cmake building system #4

Merged
SlavekB merged 3 commits from feat/cmakeConv into master 3 years ago
Ghost commented 5 years ago

I'd like the user to entry the name for the log file (GDB_TRANSCRIPT) but I've got no clue how to do It.

I'd like the user to entry the name for the log file (GDB_TRANSCRIPT) but I've got no clue how to do It.
Ghost added this to the R14.0.7 release milestone 5 years ago
Ghost added the PR/rfc PR/wip labels 5 years ago
Ghost removed the PR/rfc PR/wip labels 5 years ago
Ghost closed this pull request 5 years ago
Owner

Because we definitely don't want to lose the great work Greg did on CMake conversion, I made an rebase to the current head and reopened it so we can continue in work and finish it.

Because we definitely don't want to lose the great work Greg did on CMake conversion, I made an rebase to the current head and reopened it so we can continue in work and finish it.
SlavekB reopened this pull request 5 years ago
Ghost modified the milestone from R14.0.7 release to R14.1.0 release 5 years ago
Ghost added the PR/wip label 4 years ago
Ghost force-pushed feat/cmakeConv from d694e55806 to f1b0901016 3 years ago
Ghost changed title from WIP:conversion to the cmake building system to conversion to the cmake building system 3 years ago
Ghost removed the PR/wip label 3 years ago
Ghost removed this from the R14.1.0 release milestone 3 years ago
Ghost commented 3 years ago
Poster

My only concern is with the GDB_TRANSCRIPT definition, I'm not sure It's the right way to do It.

We shall see what Slavek Senpai says about this. 😅

My only concern is with the GDB_TRANSCRIPT definition, I'm not sure It's the right way to do It. We shall see what Slavek Senpai says about this. :sweat_smile:
Ghost commented 3 years ago
Poster

@MicheleC If you have some spare time, can you have a look at removing the TQT_NO_COMPAT definition?

@MicheleC If you have some spare time, can you have a look at removing the TQT_NO_COMPAT definition?
Ghost force-pushed feat/cmakeConv from f1b0901016 to 8c71902fba 3 years ago
Owner

@MicheleC If you have some spare time, can you have a look at removing the TQT_NO_COMPAT definition?

Just for reference, that was done already 👍

> @MicheleC If you have some spare time, can you have a look at removing the TQT_NO_COMPAT definition? > Just for reference, that was done already :+1:
Ghost commented 3 years ago
Poster

@SlavekB I'd like to include Michele patch against the TQT_NO_COMPAT definition after you have reviewed and commented the cmake conversion, this should spare me from rebasing/reordering regularly during the reviewing process.

@SlavekB I'd like to include Michele patch against the TQT_NO_COMPAT definition after you have reviewed and commented the cmake conversion, this should spare me from rebasing/reordering regularly during the reviewing process.
Ghost commented 3 years ago
Poster

patch from @MicheleC to get rid of some deprecated, I leave it there.

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9e818ab..13125e2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -62,7 +62,7 @@ include( ConfigureChecks.cmake )
 
 ###### global compiler settings
 
-add_definitions( -DHAVE_CONFIG_H -UTQT_NO_ASCII_CAST -UTQT_NO_COMPAT )
+add_definitions( -DHAVE_CONFIG_H -UTQT_NO_ASCII_CAST -DTQT_NO_COMPAT )
 
 set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TQT_CXX_FLAGS}" )
 set( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined" )
diff --git a/kdbg/gdbdriver.cpp b/kdbg/gdbdriver.cpp
index 933c191..a7f450f 100644
--- a/kdbg/gdbdriver.cpp
+++ b/kdbg/gdbdriver.cpp
@@ -358,9 +358,9 @@ void GdbDriver::parseMarker()
     // extract filename and line number
     static TQRegExp MarkerRE(":[0-9]+:[0-9]+:[begmidl]+:0x");
 
-    int len;
-    int lineNoStart = MarkerRE.match(startMarker, 0, &len);
+    int lineNoStart = MarkerRE.search(startMarker, 0);
     if (lineNoStart >= 0) {
+			int len = MarkerRE.matchedLength();
 	int lineNo = atoi(startMarker + lineNoStart+1);
 
 	// get address
diff --git a/kdbg/xsldbgdriver.cpp b/kdbg/xsldbgdriver.cpp
index 63b3227..3497121 100644
--- a/kdbg/xsldbgdriver.cpp
+++ b/kdbg/xsldbgdriver.cpp
@@ -294,7 +294,7 @@ XsldbgDriver::parseMarker()
 
     // TRACE("parseMarker : xsldbg");
     //  TRACE(m_output);
-    int len, markerStart = -1;
+    int len = 0, markerStart = -1;
     char *p = m_output;
 
     while (markerStart == -1) {
@@ -303,13 +303,16 @@ XsldbgDriver::parseMarker()
             return;
         }
         //TRACE(TQString("parseMarker is looking at :") + p);
-        markerStart = m_markerRE.match(p, 0, &len);
+        markerStart = m_markerRE.search(p, 0);
         if (markerStart == -1) {
             // try to marker on next line !
             p = strchr(p, '\n');
             if ((p != 0) && (*p != '\0'))
                 p++;
         }
+				else {
+					len = m_markerRE.matchedLength();
+				}
     }
 
 
@@ -327,7 +330,8 @@ XsldbgDriver::parseMarker()
     // extract filename and line number
     static TQRegExp MarkerRE(" at line [0-9]+");
 
-    int lineNoStart = MarkerRE.match(startMarker, 0, &len);
+		len = 0;
+    int lineNoStart = MarkerRE.search(startMarker, 0);
 
     if (lineNoStart >= 0) {
         int lineNo = atoi(startMarker + lineNoStart + 8);
@@ -1317,7 +1321,7 @@ XsldbgDriver::parseChangeExecutable(const char *output, TQString & message)
      * message (no debugging symbols found)...
      */
     TQRegExp exp(".*Load of source deferred. Use the run command.*");
-    int len, index = exp.match(output, 0, &len);
+    int index = exp.search(output, 0);
 
     if (index != -1) {
         TRACE("Parsed stylesheet executable");
@@ -1332,7 +1336,7 @@ XsldbgDriver::parseCoreFile(const char *output)
     TRACE("XsldbgDriver::parseCoreFile");
     TRACE(output);
     TQRegExp exp(".*Load of data file deferred. Use the run command.*");
-    int len, index = exp.match(output, 0, &len);
+    int index = exp.search(output, 0);
 
     if (index != -1) {
         m_haveCoreFile = true;

patch from @MicheleC to get rid of some deprecated, I leave it there. ``` diff --git a/CMakeLists.txt b/CMakeLists.txt index 9e818ab..13125e2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -62,7 +62,7 @@ include( ConfigureChecks.cmake ) ###### global compiler settings -add_definitions( -DHAVE_CONFIG_H -UTQT_NO_ASCII_CAST -UTQT_NO_COMPAT ) +add_definitions( -DHAVE_CONFIG_H -UTQT_NO_ASCII_CAST -DTQT_NO_COMPAT ) set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TQT_CXX_FLAGS}" ) set( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined" ) diff --git a/kdbg/gdbdriver.cpp b/kdbg/gdbdriver.cpp index 933c191..a7f450f 100644 --- a/kdbg/gdbdriver.cpp +++ b/kdbg/gdbdriver.cpp @@ -358,9 +358,9 @@ void GdbDriver::parseMarker() // extract filename and line number static TQRegExp MarkerRE(":[0-9]+:[0-9]+:[begmidl]+:0x"); - int len; - int lineNoStart = MarkerRE.match(startMarker, 0, &len); + int lineNoStart = MarkerRE.search(startMarker, 0); if (lineNoStart >= 0) { + int len = MarkerRE.matchedLength(); int lineNo = atoi(startMarker + lineNoStart+1); // get address diff --git a/kdbg/xsldbgdriver.cpp b/kdbg/xsldbgdriver.cpp index 63b3227..3497121 100644 --- a/kdbg/xsldbgdriver.cpp +++ b/kdbg/xsldbgdriver.cpp @@ -294,7 +294,7 @@ XsldbgDriver::parseMarker() // TRACE("parseMarker : xsldbg"); // TRACE(m_output); - int len, markerStart = -1; + int len = 0, markerStart = -1; char *p = m_output; while (markerStart == -1) { @@ -303,13 +303,16 @@ XsldbgDriver::parseMarker() return; } //TRACE(TQString("parseMarker is looking at :") + p); - markerStart = m_markerRE.match(p, 0, &len); + markerStart = m_markerRE.search(p, 0); if (markerStart == -1) { // try to marker on next line ! p = strchr(p, '\n'); if ((p != 0) && (*p != '\0')) p++; } + else { + len = m_markerRE.matchedLength(); + } } @@ -327,7 +330,8 @@ XsldbgDriver::parseMarker() // extract filename and line number static TQRegExp MarkerRE(" at line [0-9]+"); - int lineNoStart = MarkerRE.match(startMarker, 0, &len); + len = 0; + int lineNoStart = MarkerRE.search(startMarker, 0); if (lineNoStart >= 0) { int lineNo = atoi(startMarker + lineNoStart + 8); @@ -1317,7 +1321,7 @@ XsldbgDriver::parseChangeExecutable(const char *output, TQString & message) * message (no debugging symbols found)... */ TQRegExp exp(".*Load of source deferred. Use the run command.*"); - int len, index = exp.match(output, 0, &len); + int index = exp.search(output, 0); if (index != -1) { TRACE("Parsed stylesheet executable"); @@ -1332,7 +1336,7 @@ XsldbgDriver::parseCoreFile(const char *output) TRACE("XsldbgDriver::parseCoreFile"); TRACE(output); TQRegExp exp(".*Load of data file deferred. Use the run command.*"); - int len, index = exp.match(output, 0, &len); + int index = exp.search(output, 0); if (index != -1) { m_haveCoreFile = true; ```
SlavekB reviewed 3 years ago
SlavekB left a comment
Owner

I haven't done the test yet, but after the first review, here are only a minimum of comments.

I haven't done the test yet, but after the first review, here are only a minimum of comments.
CMakeLists.txt Outdated
############################################
cmake_minimum_required( VERSION 2.8 )
Owner

Please update to 2.8.12.

Please update to 2.8.12.
SlavekB marked this conversation as resolved
CMakeLists.txt Outdated
option( WITH_GCC_VISIBILITY "Enable fvisibility and fvisibility-inlines-hidden" ${WITH_ALL_OPTIONS} )
option( WITH_TRACE_OUTPUT "Generate lots of trace output" OFF )
option( WITH_GDB_TRANSCRIPT "Provide file log" OFF )
option( BUILD_TESTPROGS "Build testprogs executables" OFF )
Owner

Since this is BUILD_, it should probably be in the section below.

Since this is `BUILD_`, it should probably be in the section below.
SlavekB marked this conversation as resolved
Owner

patch from @MicheleC to get rid of some deprecated, I leave it there.

Hi Greg, just wonder why you have not applied this to the code. Anything unclear or not working from the patch?

> patch from @MicheleC to get rid of some deprecated, I leave it there. Hi Greg, just wonder why you have not applied this to the code. Anything unclear or not working from the patch?
Ghost force-pushed feat/cmakeConv from 8c71902fba to 2e1f6a7f11 3 years ago
Ghost force-pushed feat/cmakeConv from 2e1f6a7f11 to 49c43d74d8 3 years ago
Owner

I'm a little confused about TQT_NO_COMPAT. I tried to give away -UTQT_NO_COMPAT and without doing any further change, build was successful. It is not clear to me whether the above patch is needed?

I'm a little confused about `TQT_NO_COMPAT`. I tried to give away `-UTQT_NO_COMPAT` and without doing any further change, build was successful. It is not clear to me whether the above patch is needed?
Owner

I'm a little confused about TQT_NO_COMPAT. I tried to give away -UTQT_NO_COMPAT and without doing any further change, build was successful. It is not clear to me whether the above patch is needed?

Ignore it – I forgot to update deb rules to be used cmake :)

> I'm a little confused about `TQT_NO_COMPAT`. I tried to give away `-UTQT_NO_COMPAT` and without doing any further change, build was successful. It is not clear to me whether the above patch is needed? Ignore it – I forgot to update deb rules to be used cmake :)
SlavekB added 2 commits 3 years ago
4b34cf6bed
Update the use of TQRegExp so that it does not require an old API.
627fc0ed62
Added controlled conversions to char* instead of automatic ascii conversions.
Owner

It looks good. There seems nothing to prevent it from becoming part of R14.0.10. I added patches to resolve TQT_NO_COMPAT and TQT_NO_ASCII_CAST. Please test it on your system.

It looks good. There seems nothing to prevent it from becoming part of R14.0.10. I added patches to resolve `TQT_NO_COMPAT` and `TQT_NO_ASCII_CAST`. Please test it on your system.
Owner

Nice to see a PR that almost got lost 2 years ago making it into master code soon 😄

Nice to see a PR that almost got lost 2 years ago making it into master code soon :smile:
Owner

For us nothing is lost – sooner or later it is processed 😺

For us nothing is lost – sooner or later it is processed 😺
SlavekB merged commit 627fc0ed62 into master 3 years ago
SlavekB deleted branch feat/cmakeConv 3 years ago
SlavekB added this to the R14.0.10 release milestone 3 years ago
The pull request has been merged as 627fc0ed62.
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
3 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: TDE/kdbg#4
Loading…
There is no content yet.