public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: vladimir.mezentsev@oracle.com
To: binutils@sourceware.org
Cc: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
Subject: [PATCH] PR29788, gprofng cannot display Java's generated assembly code
Date: Tue, 15 Nov 2022 21:33:26 -0800	[thread overview]
Message-ID: <20221116053326.1337432-1-vladimir.mezentsev@oracle.com> (raw)

From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>

gprofng/ChangeLog
2022-11-15  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

	PR gprofng/29788
	* src/Experiment.h: Declare dyntext_name.
	* src/Experiment.cc: Use dyntext_name to initialize img_fname.
---
 gprofng/src/Experiment.cc | 10 +++++-----
 gprofng/src/Experiment.h  |  3 ++-
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/gprofng/src/Experiment.cc b/gprofng/src/Experiment.cc
index 98aae9714ac..44de387f3d2 100644
--- a/gprofng/src/Experiment.cc
+++ b/gprofng/src/Experiment.cc
@@ -1370,6 +1370,7 @@ Experiment::Experiment ()
   expt_name = NULL;
   arch_name = NULL;
   fndr_arch_name = NULL;
+  dyntext_name = NULL;
   logFile = NULL;
 
   dataDscrs = new Vector<DataDescriptor*>;
@@ -1432,6 +1433,7 @@ Experiment::~Experiment ()
   free (expt_name);
   free (arch_name);
   free (fndr_arch_name);
+  free (dyntext_name);
   delete jthreads_idx;
   delete cstack;
   delete cstackShowHide;
@@ -6052,11 +6054,10 @@ Experiment::fetch_pprocq ()
 int
 Experiment::read_dyntext_file ()
 {
-  char *data_file_name = dbe_sprintf ("%s/%s", expt_name, SP_DYNTEXT_FILE);
-  Data_window *dwin = new Data_window (data_file_name);
+  dyntext_name = dbe_sprintf ("%s/%s", expt_name, SP_DYNTEXT_FILE);
+  Data_window *dwin = new Data_window (dyntext_name);
   if (dwin->not_opened ())
     {
-      free (data_file_name);
       delete dwin;
       return 1;
     }
@@ -6089,7 +6090,7 @@ Experiment::read_dyntext_file ()
 	case DT_CODE:
 	  if (fp)
 	    {
-	      fp->img_fname = data_file_name;
+	      fp->img_fname = dyntext_name;
 	      fp->img_offset = offset + sizeof (DT_common);
 	      if ((platform != Intel) && (platform != Amd64))
 		{ //ARCH(SPARC)
@@ -6178,7 +6179,6 @@ Experiment::read_dyntext_file ()
       offset += cpcktsize;
     }
   free (progress_msg);
-  free (data_file_name);
   delete dwin;
   return 0;
 }
diff --git a/gprofng/src/Experiment.h b/gprofng/src/Experiment.h
index 17c91bda23e..46abbc73d3d 100644
--- a/gprofng/src/Experiment.h
+++ b/gprofng/src/Experiment.h
@@ -434,7 +434,8 @@ protected:
   char *expt_name;      // name of experiment
   char *arch_name;      // <experiment>/archive
   char *fndr_arch_name; // <founder_experiment>/archive
-  //TBR? hrtime_t sample_time;  // total of sample durations
+  char *dyntext_name;   // <experiment>/dyntext
+
   int yyparse ();       // Allow yyparse actions to access
   Vaddr stack_base;     // Stack base
 
-- 
2.31.1


                 reply	other threads:[~2022-11-16  5:33 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221116053326.1337432-1-vladimir.mezentsev@oracle.com \
    --to=vladimir.mezentsev@oracle.com \
    --cc=binutils@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).